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

Issues with Modelica.Media.Incompressible.TableBased.T_ph #3399

Closed
HansOlsson opened this issue Feb 11, 2020 · 0 comments · Fixed by #3402
Closed

Issues with Modelica.Media.Incompressible.TableBased.T_ph #3399

HansOlsson opened this issue Feb 11, 2020 · 0 comments · Fixed by #3402
Assignees
Labels
bug Critical/severe issue L: Media Issue addresses Modelica.Media
Milestone

Comments

@HansOlsson
Copy link
Contributor

In Modelica.Media.Incompressible.TableBased.BaseProperties we have:
h = if enthalpyOfT then h_T(T) else h_pT(p,T,densityOfT);
assumedly that implies that if enthalphyOfT is true we should ignore the pressure-part of the enthalphy.

If we now look at T_ph we find:

function T_ph "Compute temperature from pressure and specific enthalpy"
 ...
protected 
  function f_nonlinear "Solve h_T(T) or h_pT(p,T) for T with given h"
   ...
  algorithm 
    y := (if singleState then h_T(T=u) else h_pT(p=p, T=u)) - h;
  end f_nonlinear;
..
  annotation(Inline=false, LateInline=true, inverse(h=h_pT(p,T)));
end T_ph;

Which has the following issues:

  • When computing T_ph we ignore the pressure-dependency on enthalphy when a different constant, singleState, whereas BaseProperties ignores it when enthalphOfT is true. (In BaseProperties singleState is used to ignore pressure influence on u.)
  • The inverse always include the pressure-dependency, regardless of this.

Note that h_pT doesn't just magically ignore the pressure-dependency.

Modelica.Media.Incompressible.Examples.Essotherm650.h_T(290)=30408
Modelica.Media.Incompressible.Examples.Essotherm650.h_pT(1e5, 290)=30407
Modelica.Media.Incompressible.Examples.Essotherm650.h_pT(1.1e5, 290)=30418
@HansOlsson HansOlsson added bug Critical/severe issue L: Media Issue addresses Modelica.Media labels Feb 11, 2020
beutlich added a commit to beutlich/ModelicaStandardLibrary that referenced this issue Feb 11, 2020
@beutlich beutlich assigned beutlich and unassigned thorade and hubertus65 Feb 11, 2020
@beutlich beutlich added this to the MSL4.0.0 milestone Feb 11, 2020
beutlich added a commit to beutlich/ModelicaStandardLibrary that referenced this issue Feb 12, 2020
@beutlich beutlich linked a pull request Feb 12, 2020 that will close this issue
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
4 participants