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

setState_dTX does not work correctly #1267

Closed
modelica-trac-importer opened this issue Jan 14, 2017 · 5 comments
Closed

setState_dTX does not work correctly #1267

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

Comments

@modelica-trac-importer
Copy link

Reported by mdempsey on 4 Sep 2013 09:57 UTC
The function Modelica.Media.Interfaces.PartialLinearFluid.setState_dTX does not produce correct results (at least in Dymola) because the algorithm that is used to calculate state.p references state.T rather than the function input argument of T.

In the compiled model state.T is assigned after state.p is calculated which means the calculation of state.p sees the wrong temperature and therefore gives wrong results.

The current algorithm is:

state := ThermodynamicState(p=((d - reference_d) + 
  (state.T - reference_T)*beta_const*reference_d)
  /(reference_d*kappa_const) + reference_p, T=T);

This should be rewritten as:

state := ThermodynamicState(p=((d - reference_d) + 
  (T - reference_T)*beta_const*reference_d)
  /(reference_d*kappa_const) + reference_p, T=T);

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

@modelica-trac-importer modelica-trac-importer added this to the MSL3.2.2 milestone Jan 14, 2017
@modelica-trac-importer modelica-trac-importer added bug Critical/severe issue L: Media Issue addresses Modelica.Media labels Jan 14, 2017
@modelica-trac-importer
Copy link
Author

Comment by beutlich on 29 Oct 2015 20:45 UTC
The proposed fix is applied by b06f0c9. Please cross-check and revert should the need arise.

I guess the regression results are affected by this commit. Actually I do not understand why such tickets (I mean rather critical and with a proposed patch for a single line change) are kept unconsidered and unaccepted for years.

@modelica-trac-importer
Copy link
Author

Changelog modified by beutlich on 29 Oct 2015 20:45 UTC
Fixed the computation of the thermodynamic state in Modelica.Media.Interfaces.PartialLinearFluid.setState_dTX.state

@modelica-trac-importer
Copy link
Author

Modified by beutlich on 29 Oct 2015 20:47 UTC

@modelica-trac-importer
Copy link
Author

Changelog modified by beutlich on 29 Oct 2015 20:47 UTC
Fixed the computation of the thermodynamic state Modelica.Media.Interfaces.PartialLinearFluid.setState_dTX.state

@modelica-trac-importer
Copy link
Author

Comment by hubertus on 29 Oct 2015 22:10 UTC
I have in the past regularly searched for tickets with me as an owner and the upcoming Milestone. I have never seen this ticket though. Not sure what went wrong: I usually fix such minor things as soon as I note them.

@beutlich beutlich changed the title setState_dTx does not work correctly setState_dTX does not work correctly Oct 21, 2019
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