Search code examples
modelicadymolafluid-dynamics

Modelica.Media.R134a Error


In the Modelica Standard Library 3.2.1 a model for the refrigerant R134a was included, but it seems not to work properly with Modelica.Fluid. In a simple example with one DynamicPipe, it results in the following error:

A calculation of two-phase properties with input of pressure and temperature is not possible.
Please use setState_dTX or setState_phX instead.
The stack of functions is:
setState_pTX_Unique15
setState_pTX_Unique15(101325, 293.15, {1.0}, 0)

use_T_start is false. What is the problem here? How can it be solved?

TIA

Update:

The selected states are h and p, as it should be. The parameters of the pTX call seem to be the default values for the chosen medium.

PartialStaggeredFlowModel uses Medium.density_pTX and Medium.setState_pTX, but changing these to the respective phX-functions does not solve the problem.


Solution

  • The solution is already in my update. PartialStaggeredFlowModel uses Medium.density_pTX and Medium.setState_pTX. Replacing these with Medium.density_phX and Medium.setState_phX avoids the pT-problem. The reason why it did not work at first was one reference to the unmodified class I forgot to change.

    Other Modelica.Fluid-components have the same problem, e.g. the pump-models are based on PartialPump, which also uses Medium.density_pTX.

    Thank you for your contributions.