Modelica.Media.Interfaces.PartialSimpleMedium.ThermodynamicState Modelica.Media.Interfaces.PartialSimpleMedium.ThermodynamicState

Thermodynamic state

Modelica definition

redeclare record extends ThermodynamicState "Thermodynamic state"
  AbsolutePressure p "Absolute pressure of medium";
  Temperature T "Temperature of medium";
end ThermodynamicState;

Modelica.Media.Interfaces.PartialSimpleMedium.BaseProperties Modelica.Media.Interfaces.PartialSimpleMedium.BaseProperties

Base properties

Information


This is the most simple incompressible medium model, where specific enthalpy h and specific internal energy u are only a function of temperature T and all other provided medium quantities are assumed to be constant.


Extends from .

Parameters

TypeNameDefaultDescription
Advanced
BooleanpreferredMediumStatesfalse= true if StateSelect.prefer shall be used for the independent property variables of the medium

Modelica definition

redeclare replaceable model extends BaseProperties(
        T(stateSelect=StateSelect.prefer)) "Base properties"
equation 
      assert(T >= T_min and T <= T_max, "
Temperature T (= " + String(T) + " K) is not
in the allowed range (" + String(T_min) + " K <= T <= " + String(T_max)
         + " K)
required from medium model \"" + mediumName + "\".
");

      // h = cp_const*(T-T0);
  h = specificEnthalpy_pTX(p,T,X);
  u = cv_const*(T-T0);
  d = d_const;
  R = 0;
  MM = MM_const;
  state.T = T;
  state.p = p;
end BaseProperties;

Modelica.Media.Interfaces.PartialSimpleMedium.setState_pTX Modelica.Media.Interfaces.PartialSimpleMedium.setState_pTX

Return thermodynamic state from p, T, and X or Xi

Information


Extends from Modelica.Icons.Function (Icon for a function).

Inputs

TypeNameDefaultDescription
AbsolutePressurep Pressure [Pa]
TemperatureT Temperature [K]
MassFractionX[:]reference_XMass fractions [kg/kg]

Outputs

TypeNameDescription
ThermodynamicStatestatethermodynamic state record

Modelica definition

redeclare function setState_pTX 
  "Return thermodynamic state from p, T, and X or Xi"
  extends Modelica.Icons.Function;
  input AbsolutePressure p "Pressure";
  input Temperature T "Temperature";
  input MassFraction X[:]=reference_X "Mass fractions";
  output ThermodynamicState state "thermodynamic state record";
algorithm 
  state := ThermodynamicState(p=p,T=T);
end setState_pTX;

Modelica.Media.Interfaces.PartialSimpleMedium.setState_phX Modelica.Media.Interfaces.PartialSimpleMedium.setState_phX

Return thermodynamic state from p, h, and X or Xi

Information


Extends from Modelica.Icons.Function (Icon for a function).

Inputs

TypeNameDefaultDescription
AbsolutePressurep Pressure [Pa]
SpecificEnthalpyh Specific enthalpy [J/kg]
MassFractionX[:]reference_XMass fractions [kg/kg]

Outputs

TypeNameDescription
ThermodynamicStatestatethermodynamic state record

Modelica definition

redeclare function setState_phX 
  "Return thermodynamic state from p, h, and X or Xi"
  extends Modelica.Icons.Function;
  input AbsolutePressure p "Pressure";
  input SpecificEnthalpy h "Specific enthalpy";
  input MassFraction X[:]=reference_X "Mass fractions";
  output ThermodynamicState state "thermodynamic state record";
algorithm 
  state := ThermodynamicState(p=p,T=T0+h/cp_const);
end setState_phX;

Modelica.Media.Interfaces.PartialSimpleMedium.setState_psX Modelica.Media.Interfaces.PartialSimpleMedium.setState_psX

Return thermodynamic state from p, s, and X or Xi

Information


Extends from Modelica.Icons.Function (Icon for a function).

Inputs

TypeNameDefaultDescription
AbsolutePressurep Pressure [Pa]
SpecificEntropys Specific entropy [J/(kg.K)]
MassFractionX[:]reference_XMass fractions [kg/kg]

Outputs

TypeNameDescription
ThermodynamicStatestatethermodynamic state record

Modelica definition

redeclare replaceable function setState_psX 
  "Return thermodynamic state from p, s, and X or Xi"
  extends Modelica.Icons.Function;
  input AbsolutePressure p "Pressure";
  input SpecificEntropy s "Specific entropy";
  input MassFraction X[:]=reference_X "Mass fractions";
  output ThermodynamicState state "thermodynamic state record";
algorithm 
  state := ThermodynamicState(p=p,T=Modelica.Math.exp(s/cp_const + Modelica.Math.log(reference_T))) 
    "here the incompressible limit is used, with cp as heat capacity";
end setState_psX;

Modelica.Media.Interfaces.PartialSimpleMedium.setState_dTX Modelica.Media.Interfaces.PartialSimpleMedium.setState_dTX

Return thermodynamic state from d, T, and X or Xi

Information


Extends from Modelica.Icons.Function (Icon for a function).

Inputs

TypeNameDefaultDescription
Densityd density [kg/m3]
TemperatureT Temperature [K]
MassFractionX[:]reference_XMass fractions [kg/kg]

Outputs

TypeNameDescription
ThermodynamicStatestatethermodynamic state record

Modelica definition

redeclare function setState_dTX 
  "Return thermodynamic state from d, T, and X or Xi"
  extends Modelica.Icons.Function;
  input Density d "density";
  input Temperature T "Temperature";
  input MassFraction X[:]=reference_X "Mass fractions";
  output ThermodynamicState state "thermodynamic state record";
algorithm 
  assert(false,"pressure can not be computed from temperature and density for an incompressible fluid!");
end setState_dTX;

Modelica.Media.Interfaces.PartialSimpleMedium.dynamicViscosity Modelica.Media.Interfaces.PartialSimpleMedium.dynamicViscosity

Return dynamic viscosity

Information


Extends from  (Return dynamic viscosity).

Inputs

TypeNameDefaultDescription
ThermodynamicStatestate thermodynamic state record

Outputs

TypeNameDescription
DynamicViscosityetaDynamic viscosity [Pa.s]

Modelica definition

redeclare function extends dynamicViscosity 
  "Return dynamic viscosity"

algorithm 
  eta := eta_const;
end dynamicViscosity;

Modelica.Media.Interfaces.PartialSimpleMedium.thermalConductivity Modelica.Media.Interfaces.PartialSimpleMedium.thermalConductivity

Return thermal conductivity

Information


Extends from  (Return thermal conductivity).

Inputs

TypeNameDefaultDescription
ThermodynamicStatestate thermodynamic state record

Outputs

TypeNameDescription
ThermalConductivitylambdaThermal conductivity [W/(m.K)]

Modelica definition

redeclare function extends thermalConductivity 
  "Return thermal conductivity"

algorithm 
  lambda := lambda_const;
end thermalConductivity;

Modelica.Media.Interfaces.PartialSimpleMedium.pressure Modelica.Media.Interfaces.PartialSimpleMedium.pressure

Return pressure

Information


Extends from  (Return pressure).

Inputs

TypeNameDefaultDescription
ThermodynamicStatestate thermodynamic state record

Outputs

TypeNameDescription
AbsolutePressurepPressure [Pa]

Modelica definition

redeclare function extends pressure "Return pressure"

algorithm 
  p := state.p;
end pressure;

Modelica.Media.Interfaces.PartialSimpleMedium.temperature Modelica.Media.Interfaces.PartialSimpleMedium.temperature

Return temperature

Information


Extends from  (Return temperature).

Inputs

TypeNameDefaultDescription
ThermodynamicStatestate thermodynamic state record

Outputs

TypeNameDescription
TemperatureTTemperature [K]

Modelica definition

redeclare function extends temperature "Return temperature"

algorithm 
  T := state.T;
end temperature;

Modelica.Media.Interfaces.PartialSimpleMedium.density Modelica.Media.Interfaces.PartialSimpleMedium.density

Return density

Information


Extends from  (Return density).

Inputs

TypeNameDefaultDescription
ThermodynamicStatestate thermodynamic state record

Outputs

TypeNameDescription
DensitydDensity [kg/m3]

Modelica definition

redeclare function extends density "Return density"

algorithm 
  d := d_const;
end density;

Modelica.Media.Interfaces.PartialSimpleMedium.specificEnthalpy Modelica.Media.Interfaces.PartialSimpleMedium.specificEnthalpy

Return specific enthalpy

Information


Extends from  (Return specific enthalpy).

Inputs

TypeNameDefaultDescription
ThermodynamicStatestate thermodynamic state record

Outputs

TypeNameDescription
SpecificEnthalpyhSpecific enthalpy [J/kg]

Modelica definition

redeclare function extends specificEnthalpy 
  "Return specific enthalpy"

algorithm 
  h := cp_const*(state.T-T0);
end specificEnthalpy;

Modelica.Media.Interfaces.PartialSimpleMedium.specificHeatCapacityCp Modelica.Media.Interfaces.PartialSimpleMedium.specificHeatCapacityCp

Return specific heat capacity at constant pressure

Information


Extends from  (Return specific heat capacity at constant pressure).

Inputs

TypeNameDefaultDescription
ThermodynamicStatestate thermodynamic state record

Outputs

TypeNameDescription
SpecificHeatCapacitycpSpecific heat capacity at constant pressure [J/(kg.K)]

Modelica definition

redeclare function extends specificHeatCapacityCp 
  "Return specific heat capacity at constant pressure"

algorithm 
  cp := cp_const;
end specificHeatCapacityCp;

Modelica.Media.Interfaces.PartialSimpleMedium.specificHeatCapacityCv Modelica.Media.Interfaces.PartialSimpleMedium.specificHeatCapacityCv

Return specific heat capacity at constant volume

Information


Extends from  (Return specific heat capacity at constant volume).

Inputs

TypeNameDefaultDescription
ThermodynamicStatestate thermodynamic state record

Outputs

TypeNameDescription
SpecificHeatCapacitycvSpecific heat capacity at constant volume [J/(kg.K)]

Modelica definition

redeclare function extends specificHeatCapacityCv 
  "Return specific heat capacity at constant volume"

algorithm 
  cv := cv_const;
end specificHeatCapacityCv;

Modelica.Media.Interfaces.PartialSimpleMedium.isentropicExponent Modelica.Media.Interfaces.PartialSimpleMedium.isentropicExponent

Return isentropic exponent

Information


Extends from  (Return isentropic exponent).

Inputs

TypeNameDefaultDescription
ThermodynamicStatestate thermodynamic state record

Outputs

TypeNameDescription
IsentropicExponentgammaIsentropic exponent [1]

Modelica definition

redeclare function extends isentropicExponent 
  "Return isentropic exponent"

algorithm 
  gamma := cp_const/cv_const;
end isentropicExponent;

Modelica.Media.Interfaces.PartialSimpleMedium.velocityOfSound Modelica.Media.Interfaces.PartialSimpleMedium.velocityOfSound

Return velocity of sound

Information


Extends from  (Return velocity of sound).

Inputs

TypeNameDefaultDescription
ThermodynamicStatestate thermodynamic state record

Outputs

TypeNameDescription
VelocityOfSoundaVelocity of sound [m/s]

Modelica definition

redeclare function extends velocityOfSound 
  "Return velocity of sound "

algorithm 
  a := a_const;
end velocityOfSound;

Modelica.Media.Interfaces.PartialSimpleMedium.specificEnthalpy_pTX Modelica.Media.Interfaces.PartialSimpleMedium.specificEnthalpy_pTX

Return specific enthalpy from p, T, and X or Xi

Information


Extends from Modelica.Icons.Function (Icon for a function).

Inputs

TypeNameDefaultDescription
AbsolutePressurep Pressure [Pa]
TemperatureT Temperature [K]
MassFractionX[nX] Mass fractions [kg/kg]

Outputs

TypeNameDescription
SpecificEnthalpyhSpecific enthalpy [J/kg]

Modelica definition

redeclare function specificEnthalpy_pTX 
  "Return specific enthalpy from p, T, and X or Xi"
  extends Modelica.Icons.Function;
  input AbsolutePressure p "Pressure";
  input Temperature T "Temperature";
  input MassFraction X[nX] "Mass fractions";
  output SpecificEnthalpy h "Specific enthalpy";
algorithm 
  h := cp_const*(T-T0);
end specificEnthalpy_pTX;

Modelica.Media.Interfaces.PartialSimpleMedium.temperature_phX Modelica.Media.Interfaces.PartialSimpleMedium.temperature_phX

Return temperature from p, h, and X or Xi

Information


Extends from Modelica.Icons.Function (Icon for a function).

Inputs

TypeNameDefaultDescription
AbsolutePressurep Pressure [Pa]
SpecificEnthalpyh Specific enthalpy [J/kg]
MassFractionX[nX] Mass fractions [kg/kg]

Outputs

TypeNameDescription
TemperatureTTemperature [K]

Modelica definition

redeclare function temperature_phX 
  "Return temperature from p, h, and X or Xi"
  extends Modelica.Icons.Function;
  input AbsolutePressure p "Pressure";
  input SpecificEnthalpy h "Specific enthalpy";
  input MassFraction X[nX] "Mass fractions";
  output Temperature T "Temperature";
algorithm 
  T := T0 + h/cp_const;
end temperature_phX;

Modelica.Media.Interfaces.PartialSimpleMedium.density_phX Modelica.Media.Interfaces.PartialSimpleMedium.density_phX

Return density from p, h, and X or Xi

Information


Extends from Modelica.Icons.Function (Icon for a function).

Inputs

TypeNameDefaultDescription
AbsolutePressurep Pressure [Pa]
SpecificEnthalpyh Specific enthalpy [J/kg]
MassFractionX[nX] Mass fractions [kg/kg]

Outputs

TypeNameDescription
Densityddensity [kg/m3]

Modelica definition

redeclare function density_phX 
  "Return density from p, h, and X or Xi"
  extends Modelica.Icons.Function;
  input AbsolutePressure p "Pressure";
  input SpecificEnthalpy h "Specific enthalpy";
  input MassFraction X[nX] "Mass fractions";
  output Density d "density";
algorithm 
  d := density(setState_phX(p,h,X));
end density_phX;

HTML-documentation generated by Dymola Thu Feb 19 16:53:31 2009.