Hi @paulromano ,
I am writing to report a small error in the OpenMC source code. You might already be aware of this, but when using the get_mass
function, it converts the value of ‘g’ to ‘kg’ by multiplying by 1e+03 instead of 1e-03.
As I mentioned, you might already know this. However, I felt it was appropriate to report it.
Have a good day.
Thanks for reporting this @Jefferson . This bug has actually already been fixed in our development branch and will be part of the next release:
openmc-dev:develop
← nplinden:mass_conversion
opened 09:02AM - 07 Nov 23 UTC
# Description
The openmc.deplete.Results class provides a get_mass method tha… t can provides mass values in g (default), g/cm3, and kg.
To convert from g to kg, the mass is multiplied by 1_000, which convert to mg instead.
# Fixes
I changed to * operator to the / operator for correct conversion.
# Checklist
- [x] I have performed a self-review of my own code
- [ ] I have run [clang-format](https://docs.openmc.org/en/latest/devguide/styleguide.html#automatic-formatting) (version 15) on any C++ source files (if applicable)
- [ ] I have followed the [style guidelines](https://docs.openmc.org/en/latest/devguide/styleguide.html#python) for Python source files (if applicable)
- [ ] I have made corresponding changes to the documentation (if applicable)
- [x] I have added tests that prove my fix is effective or that my feature works (if applicable)