Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consistent variations of material temperature/pressure #103

Open
2 tasks
DanShort12 opened this issue Oct 28, 2020 · 1 comment
Open
2 tasks

Consistent variations of material temperature/pressure #103

DanShort12 opened this issue Oct 28, 2020 · 1 comment

Comments

@DanShort12
Copy link
Collaborator

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
Copy link
Collaborator Author

Thinking about this a bit more, I'm wondering if it's worth considering consolidating the density information into a callable property, then the value can be obtained at whatever temperature the user requests - the temperature and pressure aren't intrinsic properties of the material after all, unlike density (particularly if defined by a function), composition, etc. I believe that may have been discussed before though, so would be happy to see if there are any opinions on that before I put something together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant