Dear experts,
I’m trying to run multiple depletion simulations in one script by looping over 2 variables. Each run is almost the same ,except for the variables. In pseudocode it works like this:
for var1 in var1_list:
for var2 in var2_list:
run_burn_simulation(var1,var2,time_step=[30]*72)
for t in every 3 months:
stepRes=read_from_burn_results(t)
run_decay_simulation(stepRes,time_step=[30]*120)
As can be seen, there are a lot of depletion simulations in one looping step of var1 and var2. In the decay simulations, I try to run a “pure” decay simulation(all isotopes included, no transport) as I understand it. I expect it to run at a fast speed(several minutes per decay simulation) since there are no transport simulations at all. At first it does, but as every new round of simulations start, it becomes slower and slower(to several hours per decay simulation). When I ctrl+C the program, I have to hit it multiple times to kill the program(multiple “KeyboardInterrupted” outputed). I think that suggests unknown recursions? And when I restart the progarm, the previous slow performance vanishes, and it’s able to run at a fast speed again, until it worsens. I tried to reload the openmc module via importlib.reload(), but the performance issue persists.
So here are my questions: What caused the performance issue above? Does the issue affect my simulation results? Is there a way to “cleanly” restart/reload openmc?
I attach my script in the attachments. To make things clear, function burn_model_run() handles the burn simulation, with geometry, material and other definiotions. Function decay_model_run() handles decay simulation, where an openmc.deplete IndependentOperator is used to avoid calling the openmc executable at all. Function dpl_proc() is for automatic data processing. The main loop is at the bottom of the script. The paths are edited, fyi.
main_all.py (12.4 KB)