Hi,
Is there a way to reassign in memory a new geometry to the openmc shared library without re-initialize with openmc.init()? It is possible to re-assign materials, doing something like this, but I can’t find a way for geometries.:
`mat=openmc.lib.materials[id]
mat.set_densities(nuc1,dens1)
mat.set_densities(nuc2,dens2) `
Hi @lorenzo. Right now, it is unfortunately not possible to reassign an entirely new geometry when using openmc.lib
without reinitializing with openmc.init()
. What kind of changes would you want to make to your geometry? Just want to get a sense of what the potential use case would be.
Hi @paulromano. thank you for your answer.
The need is to introduce a variable (a geometry feature, material composition, etc.) to a depletion analysis that can be varied to keep the system critical, without having to stop the calculation and restart. I’ve actually found a temporary solution for the geometry, by adding a method to core.py
that calls separately free_memory_geometry()
and free_memory_surfaces()
from the shared-library and re-initialize only the geometry with read_geometry_xml()
and finalize_geometry()
.
1 Like
Glad you were able to find a temporary solution. I’d encourage you to be careful with the volumes of depletable materials if you are changing the actual geometry, since the volume will affect the normalization of reaction rates.