neutronics_material_maker icon indicating copy to clipboard operation
neutronics_material_maker copied to clipboard

Consistent variations of material temperature/pressure

Open DanShort12 opened this issue 3 years ago • 1 comments

Currently the temperature (temperature_in_K and temperature_in_C) and pressure (pressure_in_Pa) are exposed via properties. However, nmm does not handle side effects of varying one of these properties. For example, changing the temperature_in_K should consistently change the temperature_in_C (currently one can end up with a material who's temperature in C is not 273.15 less than the temperature in K). It also appears that the density is not recalculated when changing the temperature or pressure, which may similarly lead to unexpected behaviour.

This can likely be handled by the following:

  • [ ] Adjust the setters for temperature_in_K and temperature_in_C to also set the temperature in the alternative units.
  • [ ] Adjust the setters for temperature_in_K, temperature_in_C, and pressure_in_Pa to re-evaluate the density, if the material is flagged as temperature/pressure dependent.

An alternative to the second point could be to adjust the getter for density to re-evaluate the density on each request, although I suspect setting the density when a dependent property is changed may be more efficient.

DanShort12 avatar Oct 28 '20 13:10 DanShort12