2
votes

I am trying to model an isentropic problem (i.e. specific entropy remains constant). My goal is to do this without making assumptions about the fluid being either an ideal or calorically perfect gas, so I am left with the basic conservation laws. This is not a problem, but I need to use the process (isentropic) to relate my various states. What I need to do is set s1 = s2, but it doesn't seem like Modelica's BaseProperties has a means of doing this. What I would like to know is:

  1. Can I pass specific entropy "s" (not to be confused with enthalpy "h") to BaseProperties or some other function along with another property (maybe P) and get back the thermodynamic state of the medium? I've looked through most of the workings of the Media library and I see there are functions for returning specific entropy given a thermodynamic state, but I don't think I can provide "s" and a variable to get my state.
  2. On a related note: Is it possible to easily integrate CoolProp into Modelica? I see there is an External Fluid library, but it is built to the Media library standard which means it too doesn't seem to accept "s" as an argument to determining thermodynamic state.

Thank you for your time.

2

2 Answers

0
votes

Specific entropy is not included in BaseProperties. However, you can retrieve the thermodynamic state of a medium as a function of (p,s) with the functions setState_ps() and setState_psX(). For example

model Isentropy
  package Medium = Modelica.Media.Water.StandardWater;

  Medium.ThermodynamicState state1=Medium.setState_pT(1e6, 573.15);
  Medium.ThermodynamicState state2=Medium.setState_ps(5e5, s1);

  Medium.SpecificEntropy s1=Medium.specificEntropy(state1);

  // retrieve e.g. specific enthalpies from state records
  Medium.SpecificEnthalpy h1=Medium.specificEnthalpy(state1);
  Medium.SpecificEnthalpy h2=Medium.specificEnthalpy(state2);
end Isentropy;
0
votes

Regarding your second question: Yes, you can use the ExternalMedia to calculate properties with the CoolProp Data quite easily. The problem with s should be solved by the suggestion from Rene Just Nielsen above. The ExternalMedia uses the same media definition such that you can easily replace media models from the MSL with media from e.g. CoolProp.