ModelicaStandardLibrary icon indicating copy to clipboard operation
ModelicaStandardLibrary copied to clipboard

CO2 normalBoilingPoint = -1

Open jansilar opened this issue 4 years ago • 6 comments

Hi, may be I miss something, but why is the CO2 normalBoilingPoint = -1 in Modelica.Media.IdealGases.Common.FluidData? I think the correct value is 194.67°K (https://www.thermopedia.com/content/613/) The Modelica.Media.Interfaces.Types.Temperature type has min=1, so that it is out of the range.

jansilar avatar Aug 24 '21 06:08 jansilar

I'll let one of the experts answer on exactly why that value is used; and what the implications are. But I can understand that it is more complicated as technically CO2 doesn't boil in the sense of going from liquid to gas at that point, but it sublimes from solid to gas; and the media-library is focused on liquids and gases.

HansOlsson avatar Aug 24 '21 07:08 HansOlsson

..at normal pressure, that is. Between ~5 and ~70 bar, you can have a liquid-gas phase transition iirc.

bilderbuchi avatar Sep 04 '21 07:09 bilderbuchi

Hans is right, NBP is defined as saturated liquid at "normal" pressure of 101325 Pa (or, 1atm), and that is below the CO2 triple point pressure (517964 Pa). At atmospheric/normal pressure CO2 cannot be liquid, it can only be vapor or solid. Maybe a phase diagram on p,T axes can help to understand it, Wikipedia has this generic example: https://en.wikipedia.org/wiki/Phase_diagram#/media/File:Phase-diag2.svg

also see https://github.com/modelica/ModelicaStandardLibrary/pull/3766#issuecomment-951976651

thorade avatar Oct 27 '21 07:10 thorade

Still, it could be discussed what value to enter if the NBP is not defined, could be 0, or -1, or NaN. @jansilar If you think your question is answered, please close this issue.

thorade avatar Oct 27 '21 07:10 thorade

It would be nice to have something like a symbolic constant for "Undefined" or "NaN" here, which doesn't exist in Modelica. The -1 was my workaround to that. Unless somebody has a much better idea, I propose to close it.

hubertus65 avatar Dec 03 '21 22:12 hubertus65

NaN really sounds useful, yeah. Inf, too, also with an eye on ieee754. See also https://github.com/modelica/ModelicaSpecification/issues/2048 https://github.com/modelica/fmi-standard/issues/644

bilderbuchi avatar Dec 03 '21 22:12 bilderbuchi

It seems -1 is currently the best solution. I am closing the task. Sorry for the two-year delay :(.

jansilar avatar Oct 03 '23 11:10 jansilar