Pause and Change material density between each time step

Greeting,

I’m doing full core depletion analysis and trying to converge the moderator density for each depletion time step (mwd/kg) by extract the fission reaction rate at each block to calculate for new density and rerun at the same burnup step until it converges - then move to the next time step and perform the converge loop again. The main problem is I can not pause and change the material density in the material.xml file after done 1 timestep simulation and resume for the next /same time step.

Also, do the OpenMC automatic update the burnable fuel composition at each depletion time step or i have to update it manually?

I would really appreciate any help.

Edit I had attached this flow chart for the better understanding what I am trying to do

1 Like

Hi @Sivakorn.SSW

In the latest release of openmc (0.12.1), it is possible to export material.xml with non-burnable materials also from depletion results at each burn-up step.

import openmc.deplete as dep
r = dep.ResultsList.from_hdf5('depletion_results.h5')
exp = r.export_to_materials(1) # Index of burnup step to evaluate.
exp.export_to_xml()

Hi @Pranto

Thank you for the information provided. Can the latest release of OPENMC(0.12.1) possible to update the material.xml after done editing the density of the non-burnable materials before the step to the next/same burnup?

I found out that openmc.lib can be used to set up the simulation which could pause and update the material temperature and density openmc.lib – Python bindings to the C/C++ API — OpenMC Documentation . However, This could only be use to replace openmc.run not integrator.integrate .
I’m Looking for the command which quite similar to what openmc.lib does that could replace the integrator.integrate

Sorry for the late reply here @Sivakorn.SSW

After adjusting moderator density in materials.xml file, you can restart your depletion with the changes you’ve made and step to the next burnup step.

import openmc
import openmc.deplete

geo = openmc.Geometry.from_xml()
settings = openmc.Settings.from_xml()

chain_file = "/path/to/depletion_chain.xml file"
operator = openmc.deplete.Operator( geo, settings, chain_file)

# Let's run for the next 15 days
dt = 15
power = x 

cecm = openmc.deplete.CECMIntegrator( operator, dt, power, timestep_units  = 'd')
cecm.integrate()

Now reexport and adjust moderator density again

import openmc.deplete as dep
r = dep.ResultsList.from_hdf5('depletion_results.h5')
exp = r.export_to_materials(1) # Index of burnup step to evaluate.
exp.export_to_xml()

And the whole process will keep going.

@paulromano and @andrewjohnson can say better about this.

Hope this will help!

1 Like

@Sivakorn.SSW

What you are requesting is an oft-proposed capability: the ability to do something between depletion steps. There have been some other good discussions in the following links

What @Pranto has suggested (performing a single step, extracting materials.xml, modifying via python API, re-starting) is the closest thing we have to supported changing materials through depletion.

We don’t have a proper analogue for Intergrator.integrate like openmc.lib.run directly in the openmc C++ library, since the depletion and transport frameworks are intentionally separated.

If you wanted to develop a more tightly-coupled approach, I would recommend creating a subclass of your depletion scheme of choice (e.g., CECMIntegrator) that modifies the internals of the integrate method, specifically, CECMIntegrator.__call__. You may also want to create a custom Operator subclass that updates non-burnable materials through the openmc.lib API.

I have not tested any of this but it’s at least where I would start on this process.

One thing to be wary of with this approach is being careful when re-evaluating a depletion step before moving forward in time. That could get tricky as we essentially append new simulation results to the data file, meaning that you could end up with multiple sets of data (multiplication factor, reaction rates, concentrations, etc.) corresponding to the same depletion step.

Regards,

Andrew

2 Likes