neams-th-coe / cardinal

High-Fidelity Multiphysics
https://cardinal.cels.anl.gov/
Other
89 stars 43 forks source link

Tutorial improvements: coolant_density function in OpenMC model scripts #831

Closed lewisgross1296 closed 6 months ago

lewisgross1296 commented 7 months ago

Reason

I made a simulation mistake that I think other neutronics-focused researchers could also easily make and wanted to add some documentation / change the tutorial to prevent this. Essentially, I used the coolant_density function incorrectly. It computes in units of kg/m3 (normal in the MOOSE world), but we are used to doing everything in g/cm3 (OpenMC world).

Design

Either add a big warning + comments or divide by 1000 in the return and change all units to g/cm3 in the python scripts. The coolant density function is used in gas_compact/unit_cell.py, gas_assembly/assembly.py, and gas_compact_multiphysics/unit_cell.py.

Impact

Prevent future errors in neutronics files based on these tutorials.

I am willing to make this PR if the community thinks it is worth changing.

aprilnovak commented 7 months ago

Did you copy-paste the function into a new input file and not realize which units it was in? Or are you saying that the OpenMC python files are incorrectly setting the helium density?

I am okay to change the units to be g/cm3 if it may be less confusing.

lewisgross1296 commented 7 months ago

I copy pasted the function and used the wrong units elsewhere in my script. You used the correct units in the tutorial.