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

Incorrect units, confusing style, and probably more in Modelica.Media.Air.ReferenceMoistAir #4368

Open
3 tasks
HansOlsson opened this issue Mar 27, 2024 · 0 comments
Labels
L: Media Issue addresses Modelica.Media

Comments

@HansOlsson
Copy link
Contributor

HansOlsson commented Mar 27, 2024

Issues listed below:

  • Using bww as temporary in function?
  • Rewrite division to be clearer?
  • Or?

It started from unit-checking MSL which detected something odd in:
Modelica.Media.Air.ReferenceMoistAir.Utilities.VirialCoefficients.Bww_dT specifically the line:

bww := (bww + N[55]*Delta55^b[55]*psi55 + N[56]*Delta56^b[56]*psi56)/
    Modelica.Media.Air.ReferenceMoistAir.Utilities.Water95_Utilities.Constants.rhored
    *Modelica.Media.Air.ReferenceMoistAir.Utilities.Water95_Utilities.Constants.MM;

It might be that bww on the line before is a "temporary" with a different unit, which could explain the unit-error.

However, regardless of that the style of ..../rhored*MM is a bit confusing to me (I have to spend a few second to remember the precedence). I would write ...*MM/rhored - to clarify the meaning. The same issue occurs in Modelica.Media.Air.ReferenceMoistAir.Utilities.Water95_Utilities - where criticalMolarVolume=1/322.0*0.018015268 (using identical literal values instead of constants - thus bypassing any unit-check).

But, that made me think once more: MM/rhored has unit [kg/mol]/[mol/m3]=[kg.m3.mol-2] whereas MolarVolume used for criticalMolarVolume has unit [m3.mol-1]. Is it just coincidence that it is the same values - or is there some additional issue? I know a factor of 1kg/m3 or 1000kg/m3 is easy to slip by for air or water; but that wouldn't explain it.

It could be:

  • Incorrect units for something.
  • Incorrect formula.
  • A missing conversion that happen to have the value 1 for some reason.
  • A coincidence that the values look similar.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L: Media Issue addresses Modelica.Media
Projects
None yet
Development

No branches or pull requests

1 participant