arfc / msr-neutronics

To hold development code, milestones, and developments for msr neutronics.
BSD 3-Clause "New" or "Revised" License
7 stars 9 forks source link

Type 2 flows with depletion can cause negative mass #55

Open LukeSeifert opened 3 years ago

LukeSeifert commented 3 years ago

Type 2 flows in Serpent by themselves can raise errors if used improperly due to the equation for flow rate that they follow in BurnMaterials.c. However, even if used properly, if depletion is active, the mass can go negative, hence this bug. Based off current results, it seems that this bug occurs due to the order in which Serpent handles depletion and moving materials. Specifically, Serpent seems to read material masses, deplete, and then move masses based on the pre-depletion masses. The result of this is that if someone creates a flow regime which moves 100% of mass out of a material when depletion is not active, then upon enabling depletion there will be some amount of negative mass proportional to the time step used (since the amount of material moved and the amount of depletion which occurs are both proportional to the size of the time step). A temporary fix in Serpent to this is to comment out the lines which check if the mass is less than -1E-12. A fix for Serpent would be to find where Serpent depletes and where Serpent moves masses with flows and change the order (though this would likely be more difficult in practice). A workaround which enables users to bypass this bug is to simply use smaller time steps, though depending on the situation that can prove to be impractical.