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

dpT calculation in waterBaseProp_dT #224

Closed
modelica-trac-importer opened this issue Jan 13, 2017 · 7 comments
Closed

dpT calculation in waterBaseProp_dT #224

modelica-trac-importer opened this issue Jan 13, 2017 · 7 comments
Assignees
Labels
bug Critical/severe issue L: Media Issue addresses Modelica.Media
Milestone

Comments

@modelica-trac-importer
Copy link

Reported by m.graeber on 22 Oct 2009 10:15 UTC
I suppose there is a bug in the calculation of dpT in

Modelica.Media.Water.IF97_Utilities.waterBaseProp_dT

For Region 4 there are to different lines where dpT is calculated:

aux.dpT := BaseIF97.Basic.dptofT(T);

and some lines below

aux.dpT := (vap.s - liq.s)*(if (liq.d <> vap.d) 
	then (vap.s - liq.s)*liq.d*vap.d/(liq.d - vap.d) 
	else BaseIF97.Basic.dptofT(aux.T));

The first algorithm should be the right one.


Migrated-From: https://trac.modelica.org/Modelica/ticket/224

@modelica-trac-importer modelica-trac-importer added bug Critical/severe issue L: Media Issue addresses Modelica.Media labels Jan 13, 2017
@modelica-trac-importer
Copy link
Author

Modified by dietmarw on 22 Oct 2009 16:40 UTC

@modelica-trac-importer
Copy link
Author

Comment by hubertus on 23 Oct 2009 19:15 UTC
The second formula is the Clausius-Clapeyron equation: dp/dT = (s2-s1)/(v2-v1). In IF97, the analytical curve p = f(T) is an approximation, even though a good one. Using Clausius-Clapeyron instead makes dp/dT in my view more consistent with other parts of the fundamental equation. But you have a point in that the first one should be removed. It is no error, anyways. Check, e.g. http://theory.phy.umist.ac.uk/~judith/stat_therm/node44.html

@modelica-trac-importer
Copy link
Author

Comment by m.graeber on 25 Oct 2009 16:09 UTC
Isn't there still an error in the equation? Shouldn't it be

aux.dpT := if (liq.d <> vap.d) then 
    (vap.s - liq.s)*liq.d*vap.d/(liq.d - vap.d) else
    Modelica.Media.Water.IF97_Utilities.BaseIF97.Basic.dptofT(aux.T);

without the term (vap.s - liq.s) in front of the if equation?

@modelica-trac-importer
Copy link
Author

Comment by hubertus on 25 Oct 2009 20:16 UTC
No, this is the right formula. Compare it against the derivative of the approximation function dpofT.

@modelica-trac-importer
Copy link
Author

Modified by dietmarw on 26 Oct 2009 07:17 UTC

@modelica-trac-importer
Copy link
Author

Comment by hubertus on 28 Oct 2009 23:36 UTC
fixed in d7a0945 in trunk. Will be merged to maintenance later, with other media changes

@modelica-trac-importer
Copy link
Author

Comment by dietmarw on 25 Nov 2009 11:53 UTC
Milestone MSL3.1.1 deleted

@modelica-trac-importer modelica-trac-importer added this to the MSL3.2 milestone Jan 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Critical/severe issue L: Media Issue addresses Modelica.Media
Projects
None yet
Development

No branches or pull requests

2 participants