Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

Help : Call R134a Properties

Help : Call R134a Properties

Hi,
I've been trying to built a compressor model using R134a as refrigerant but I cannot not calculate the density of the refrigerant when using Modelica.Medium.R134a.R134a_ph library.
I don't know how to declare the dendity function, especially how to declare nX in the following model ? Indeed I tried different ways but I always have a message error.

model test
package Medium = Modelica.Media.R134a.R134a_ph;
  parameter Medium.AbsolutePressure p = 300000;
  parameter Medium.SpecificEnthalpy h = 420000;
  Real rho;
equation
  rho = Medium.density(Medium.setState_phX(p, h,fill(0,Medium.nX)));
end test;

Thank you very much for your help

Re: Help : Call R134a Properties

R134a is a pure fluid, there is no composition.
The following worked for me:

Code:

model test

package Medium = Modelica.Media.R134a.R134a_ph;
  parameter Medium.AbsolutePressure p = 300000;
  parameter Medium.SpecificEnthalpy h = 420000;
  Real rho;
equation
  rho = Medium.density(Medium.setState_ph(p, h));
end test;

Re: Help : Call R134a Properties

Thank you matth. I can now call a function properly according to pressure and enthalpy but I would like also call a pT function for a superheated vapour but I think it is not possible because it is written that pTx is a dummy function.
Could you confirm me this "problem" ?
Thank you

Re: Help : Call R134a Properties

Currently, R134a has only setState_ph implemented. You cannot use other input pairs. That means, R134a is incompatible with parts of Modelica.Fluid.
Also read:
https://trac.modelica.org/Modelica/ticket/1394
http://stackoverflow.com/questions/2037 … 134a-error

There are 0 guests and 0 other users also viewing this topic
You are here: