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

Utilize molar gas constant in Modelica.Media.Interfaces.{TemplateMedium, PartialLinearFluid}.BaseProperties #3228

Merged
merged 2 commits into from
Dec 4, 2019

Conversation

beutlich
Copy link
Member

Utilize the molar gas constant R from Modelica.Constants instead of different approximations.

@beutlich beutlich added enhancement New feature or enhancement L: Media Issue addresses Modelica.Media labels Nov 12, 2019
@beutlich beutlich added this to the MSL4.0.0 milestone Nov 12, 2019
@beutlich beutlich self-assigned this Nov 12, 2019
@thorade
Copy link
Contributor

thorade commented Nov 13, 2019

This would require reading the publication, because if a different value of the gas constant was used in the publication, it must also be used in the implementation to get matching results.

Copy link
Contributor

@HansOlsson HansOlsson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

Modelica/Media/R134a.mo Outdated Show resolved Hide resolved
Modelica/Media/package.mo Show resolved Hide resolved
Modelica/Media/package.mo Show resolved Hide resolved
Modelica/Media/Air/ReferenceMoistAir.mo Outdated Show resolved Hide resolved
@mestinso
Copy link
Collaborator

I agree with @thorade here. Changes in Modelica/Media/package.mo make sense and should be implemented. However, for the R134a and Moist air reference cases, it is arguably wrong since this will cause the results to change. The R values should be considered fossilized/internal factors that you shouldn't care about externally. You either need two changes (two wrongs making a right) or no changes at all to keep it consistent with the publication. I would vote for the latter.

@beutlich beutlich changed the title Utilize molar gas constant Utilize molar gas constant in Modelica.Media.Interfaces.{TemplateMedium, PartialLinearFluid}.BaseProperties Nov 23, 2019
@beutlich
Copy link
Member Author

beutlich commented Dec 1, 2019

Changing it in Modelica.Media.Interfaces.PartialLinearFluid.BaseProperties also affects Modelica.Media.CompressibleLiquids.LinearColdWater and Modelica.Media.CompressibleLiquids.LinearWater_pT_Ambient via inheritance.

@casella Acceptable for you?

@casella
Copy link
Contributor

casella commented Dec 4, 2019

Changing it in Modelica.Media.Interfaces.PartialLinearFluid.BaseProperties also affects Modelica.Media.CompressibleLiquids.LinearColdWater and Modelica.Media.CompressibleLiquids.LinearWater_pT_Ambient via inheritance.

@casella Acceptable for you?

Absolutely!

In fact, those models do not really need a value for R, it is only provided because the interface asks for it. I'm not sure why we put some rounded numbers, but I guess that was the reason.

Please go ahead

@beutlich beutlich removed the request for review from hubertus65 December 4, 2019 19:05
@beutlich beutlich added P: low Low priority issue and removed enhancement New feature or enhancement labels Dec 4, 2019
@beutlich beutlich merged commit d86eecd into modelica:master Dec 4, 2019
@beutlich beutlich deleted the utilize-molar-gas-constant branch December 4, 2019 19:05
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 P: low Low priority issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants