Skip to content

Commit 624559d

Browse files
[gha-debug] update _get_start_data(self) to grab the beginning of timestep time so it will work whether a previous simulation completes or is interrupted
1 parent 879350c commit 624559d

4 files changed

Lines changed: 26 additions & 1726 deletions

File tree

openmc/deplete/abc.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -819,9 +819,31 @@ def _get_bos_data_from_restart(self, source_rate, bos_conc):
819819
return bos_conc, OperatorResult(k, rates)
820820

821821
def _get_start_data(self):
822+
"""
823+
This function fetches the starting state of a simulation in terms of the
824+
simulation physical time at which to start and the index at which the
825+
depletion simulation should start at. When no previous results exist,
826+
the time and index are both zero. When previous results do exist, it
827+
returns the time corresponding to beginning the previous resutls last
828+
timestep and the index as N-1 where N is the number of previous StepResults
829+
found in the previous Results.
830+
831+
Note that the openmc.deplete.Results.time object is a list of float with
832+
[t,t+dt] where t is the beginning of timestep time and t+dt is the end of
833+
timestep time. If the previous results correspond to a simulation that
834+
finished to completeion, it will contain a results in the form of [t,t],
835+
but if a simulation doesn't finish all the given timesteps, it is the t
836+
that is the desired start time, not t+dt. Thus, it is always save to take
837+
dtime[0].
838+
839+
Returns
840+
_______
841+
start_time : float
842+
index: index
843+
"""
822844
if self.operator.prev_res is None:
823845
return 0.0, 0
824-
return (self.operator.prev_res[-1].time[-1],
846+
return (self.operator.prev_res[-1].time[0],
825847
len(self.operator.prev_res) - 1)
826848

827849
def integrate(
-198 KB
Binary file not shown.

0 commit comments

Comments
 (0)