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

Problem of higher variability parameter.

Problem of higher variability parameter.

Hello

I have a problem to use thermocyle module added at openmodelica with externalmedia.
The problem is located on the calculation of sound velocity with the function of setState_pT.
In searching on google, I think that the problem from to evaluate pure /impure function.

Is it possible to add test loop on pure function ?
Modelica.SIunits.Velocity C_thr(start=Medium.velocityOfSound(Medium.setState_pT(p_choked_start, T_su_start)));

When I change this function in constant, the problem appears on this following function :
CheckCoolPropOptions

Can you advise me to modify this line ?

Thank you for your help
Steven

Re: Problem of higher variability parameter.

In testing other module, I have always a problem with  setState__pT.
I think this function don't return the right parameter.

function setState_pT
    "Return thermodynamic state record from p and T"
    extends Modelica.Icons.Function;
    input AbsolutePressure p "pressure";
    input Temperature T "temperature";
    input FixedPhase phase = 0
      "2 for two-phase, 1 for one-phase, 0 if not known";
    output ThermodynamicState state;
  external "C" TwoPhaseMedium_setState_pT_C_impl(p, T, state, mediumName, libraryName, substanceName)
    annotation(Include="#include \"externalmedialib.h\"", Library="ExternalMediaLib", IncludeDirectory="modelica://ExternalMedia/Resources/Include", LibraryDirectory="modelica://ExternalMedia/Resources/Library");
  end setState_pT;

I think my problem is principally on this function

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