This package provides high accuracy physical properties for water according to the IAPWS/IF97 standard. It has been part of the ThermoFluid Modelica library and been extended, reorganized and documented to become part of the Modelica Standard library.
An important feature that distinguishes this implementation of the IF97 steam property standard is that this implementation has been explicitly designed to work well in dynamic simulations. Computational performance has been of high importance. This means that there often exist several ways to get the same result from different functions if one of the functions is called often but can be optimized for that purpose.
The original documentation of the IAPWS/IF97 steam properties can freely be distributed with computer implementations, so for curious minds the complete standard documentation is provided with the Modelica properties library. The following documents are included (in directory Modelica/Resources/Documentation/Media/Water/IF97documentation):
Extends from Modelica.Icons.Package (Icon for standard packages).
Name | Description |
---|---|
BaseIF97 | Modelica Physical Property Model: the new industrial formulation IAPWS-IF97 |
iter | |
waterBaseProp_ph | intermediate property record for water |
waterBaseProp_ps | intermediate property record for water |
rho_props_ps | density as function of pressure and specific entropy |
rho_ps | density as function of pressure and specific entropy |
T_props_ps | temperature as function of pressure and specific entropy |
T_ps | temperature as function of pressure and specific entropy |
h_props_ps | specific enthalpy as function or pressure and temperature |
h_ps | specific enthalpy as function or pressure and temperature |
phase_ps | phase as a function of pressure and specific entropy |
phase_ph | phase as a function of pressure and specific enthalpy |
phase_dT | phase as a function of pressure and temperature |
rho_props_ph | density as function of pressure and specific enthalpy |
rho_ph | density as function of pressure and specific enthalpy |
rho_ph_der | derivative function of rho_ph |
T_props_ph | temperature as function of pressure and specific enthalpy |
T_ph | temperature as function of pressure and specific enthalpy |
T_ph_der | derivative function of T_ph |
s_props_ph | specific entropy as function of pressure and specific enthalpy |
s_ph | specific entropy as function of pressure and specific enthalpy |
s_ph_der | specific entropy as function of pressure and specific enthalpy |
cv_props_ph | specific heat capacity at constant volume as function of pressure and specific enthalpy |
cv_ph | specific heat capacity at constant volume as function of pressure and specific enthalpy |
regionAssertReal | assert function for inlining |
cp_props_ph | specific heat capacity at constant pressure as function of pressure and specific enthalpy |
cp_ph | specific heat capacity at constant pressure as function of pressure and specific enthalpy |
beta_props_ph | isobaric expansion coefficient as function of pressure and specific enthalpy |
beta_ph | isobaric expansion coefficient as function of pressure and specific enthalpy |
kappa_props_ph | isothermal compressibility factor as function of pressure and specific enthalpy |
kappa_ph | isothermal compressibility factor as function of pressure and specific enthalpy |
velocityOfSound_props_ph | speed of sound as function of pressure and specific enthalpy |
velocityOfSound_ph | |
isentropicExponent_props_ph | isentropic exponent as function of pressure and specific enthalpy |
isentropicExponent_ph | isentropic exponent as function of pressure and specific enthalpy |
ddph_props | density derivative by pressure |
ddph | density derivative by pressure |
ddhp_props | density derivative by specific enthalpy |
ddhp | density derivative by specific enthalpy |
waterBaseProp_pT | intermediate property record for water (p and T prefered states) |
rho_props_pT | density as function or pressure and temperature |
rho_pT | density as function or pressure and temperature |
h_props_pT | specific enthalpy as function or pressure and temperature |
h_pT | specific enthalpy as function or pressure and temperature |
h_pT_der | derivative function of h_pT |
rho_pT_der | derivative function of rho_pT |
s_props_pT | specific entropy as function of pressure and temperature |
s_pT | temperature as function of pressure and temperature |
cv_props_pT | specific heat capacity at constant volume as function of pressure and temperature |
cv_pT | specific heat capacity at constant volume as function of pressure and temperature |
cp_props_pT | specific heat capacity at constant pressure as function of pressure and temperature |
cp_pT | specific heat capacity at constant pressure as function of pressure and temperature |
beta_props_pT | isobaric expansion coefficient as function of pressure and temperature |
beta_pT | isobaric expansion coefficient as function of pressure and temperature |
kappa_props_pT | isothermal compressibility factor as function of pressure and temperature |
kappa_pT | isothermal compressibility factor as function of pressure and temperature |
velocityOfSound_props_pT | speed of sound as function of pressure and temperature |
velocityOfSound_pT | speed of sound as function of pressure and temperature |
isentropicExponent_props_pT | isentropic exponent as function of pressure and temperature |
isentropicExponent_pT | isentropic exponent as function of pressure and temperature |
waterBaseProp_dT | intermediate property record for water (d and T prefered states) |
h_props_dT | specific enthalpy as function of density and temperature |
h_dT | specific enthalpy as function of density and temperature |
h_dT_der | derivative function of h_dT |
p_props_dT | pressure as function of density and temperature |
p_dT | pressure as function of density and temperature |
p_dT_der | derivative function of p_dT |
s_props_dT | specific entropy as function of density and temperature |
s_dT | temperature as function of density and temperature |
cv_props_dT | specific heat capacity at constant volume as function of density and temperature |
cv_dT | specific heat capacity at constant volume as function of density and temperature |
cp_props_dT | specific heat capacity at constant pressure as function of density and temperature |
cp_dT | specific heat capacity at constant pressure as function of density and temperature |
beta_props_dT | isobaric expansion coefficient as function of density and temperature |
beta_dT | isobaric expansion coefficient as function of density and temperature |
kappa_props_dT | isothermal compressibility factor as function of density and temperature |
kappa_dT | isothermal compressibility factor as function of density and temperature |
velocityOfSound_props_dT | speed of sound as function of density and temperature |
velocityOfSound_dT | speed of sound as function of density and temperature |
isentropicExponent_props_dT | isentropic exponent as function of density and temperature |
isentropicExponent_dT | isentropic exponent as function of density and temperature |
ThermoFluidSpecial | |
hl_p | compute the saturated liquid specific h(p) |
hv_p | compute the saturated vapour specific h(p) |
sl_p | compute the saturated liquid specific s(p) |
sv_p | compute the saturated vapour specific s(p) |
rhol_T | compute the saturated liquid d(T) |
rhov_T | compute the saturated vapour d(T) |
rhol_p | compute the saturated liquid d(p) |
rhov_p | compute the saturated vapour d(p) |
dynamicViscosity | compute eta(d,T) in the one-phase region |
thermalConductivity | compute lambda(d,T,p) in the one-phase region |
surfaceTension | compute sigma(T) at saturation T |
isentropicEnthalpy | isentropic specific enthalpy from p,s (preferably use dynamicIsentropicEnthalpy in dynamic simulation!) |
isentropicEnthalpy_props | |
isentropicEnthalpy_der | derivative of isentropic specific enthalpy from p,s |
dynamicIsentropicEnthalpy | isentropic specific enthalpy from p,s and good guesses of d and T |
replaceable record iter = BaseIF97.IterationData;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
SpecificEnthalpy | h | specific enthalpy [J/kg] | |
Integer | phase | 0 | phase: 2 for two-phase, 1 for one phase, 0 if unknown |
Integer | region | 0 | if 0, do region computation, otherwise assume the region is this input |
Type | Name | Description |
---|---|---|
IF97BaseTwoPhase | aux | auxiliary record |
function waterBaseProp_ph "intermediate property record for water" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.SpecificEnthalpy h "specific enthalpy"; input Integer phase = 0 "phase: 2 for two-phase, 1 for one phase, 0 if unknown"; input Integer region = 0 "if 0, do region computation, otherwise assume the region is this input"; output Common.IF97BaseTwoPhase aux "auxiliary record"; protected Common.GibbsDerivs g "dimensionless Gibbs funcion and dervatives w.r.t. pi and tau"; Common.HelmholtzDerivs f "dimensionless Helmholtz funcion and dervatives w.r.t. delta and tau"; Integer error "error flag for inverse iterations"; SI.SpecificEnthalpy h_liq "liquid specific enthalpy"; SI.Density d_liq "liquid density"; SI.SpecificEnthalpy h_vap "vapour specific enthalpy"; SI.Density d_vap "vapour density"; Common.PhaseBoundaryProperties liq "phase boundary property record"; Common.PhaseBoundaryProperties vap "phase boundary property record"; Common.GibbsDerivs gl "dimensionless Gibbs funcion and dervatives w.r.t. pi and tau"; Common.GibbsDerivs gv "dimensionless Gibbs funcion and dervatives w.r.t. pi and tau"; Modelica.Media.Common.HelmholtzDerivs fl "dimensionless Helmholtz function and dervatives w.r.t. delta and tau"; Modelica.Media.Common.HelmholtzDerivs fv "dimensionless Helmholtz function and dervatives w.r.t. delta and tau"; SI.Temperature t1 "temperature at phase boundary, using inverse from region 1"; SI.Temperature t2 "temperature at phase boundary, using inverse from region 2"; algorithm aux.region := if region == 0 then (if phase == 2 then 4 else BaseIF97.Regions.region_ph(p=p,h= h,phase= phase)) else region; aux.phase := if phase <> 0 then phase else if aux.region == 4 then 2 else 1; aux.p := max(p,611.657); aux.h := max(h,1e3); aux.R := BaseIF97.data.RH2O; if (aux.region == 1) then aux.T := BaseIF97.Basic.tph1(aux.p, aux.h); g := BaseIF97.Basic.g1(p, aux.T); aux.s := aux.R*(g.tau*g.gtau - g.g); aux.rho := p/(aux.R*aux.T*g.pi*g.gpi); aux.vt := aux.R/p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi); aux.vp := aux.R*aux.T/(p*p)*g.pi*g.pi*g.gpipi; aux.cp := -aux.R*g.tau*g.tau*g.gtautau; aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/g.gpipi)); aux.x := 0.0; aux.dpT := -aux.vt/aux.vp; elseif (aux.region == 2) then aux.T := BaseIF97.Basic.tph2(aux.p, aux.h); g := BaseIF97.Basic.g2(p, aux.T); aux.s := aux.R*(g.tau*g.gtau - g.g); aux.rho := p/(aux.R*aux.T*g.pi*g.gpi); aux.vt := aux.R/p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi); aux.vp := aux.R*aux.T/(p*p)*g.pi*g.pi*g.gpipi; aux.cp := -aux.R*g.tau*g.tau*g.gtautau; aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/g.gpipi)); aux.x := 1.0; aux.dpT := -aux.vt/aux.vp; elseif (aux.region == 3) then (aux.rho,aux.T,error) := BaseIF97.Inverses.dtofph3(p=aux.p,h=aux.h,delp= 1.0e-7,delh= 1.0e-6); f := BaseIF97.Basic.f3(aux.rho, aux.T); aux.h := aux.R*aux.T*(f.tau*f.ftau + f.delta*f.fdelta); aux.s := aux.R*(f.tau*f.ftau - f.f); aux.pd := aux.R*aux.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta); aux.pt := aux.R*aux.rho*f.delta*(f.fdelta - f.tau*f.fdeltatau); aux.cv := abs(aux.R*(-f.tau*f.tau*f.ftautau)) "can be close to neg. infinity near critical point"; aux.cp := (aux.rho*aux.rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt)/(aux.rho*aux.rho*aux.pd); aux.x := 0.0; aux.dpT := aux.pt; /*safety against div-by-0 in initialization*/ elseif (aux.region == 4) then h_liq := hl_p(p); h_vap := hv_p(p); aux.x := if (h_vap <> h_liq) then (h - h_liq)/(h_vap - h_liq) else 1.0; if p < BaseIF97.data.PLIMIT4A then t1:= BaseIF97.Basic.tph1(aux.p, h_liq); t2:= BaseIF97.Basic.tph2(aux.p, h_vap); gl := BaseIF97.Basic.g1(aux.p, t1); gv := BaseIF97.Basic.g2(aux.p, t2); liq := Common.gibbsToBoundaryProps(gl); vap := Common.gibbsToBoundaryProps(gv); aux.T := t1 + aux.x*(t2-t1); else aux.T := BaseIF97.Basic.tsat(aux.p); // how to avoid ? d_liq:= rhol_T(aux.T); d_vap:= rhov_T(aux.T); fl := BaseIF97.Basic.f3(d_liq, aux.T); fv := BaseIF97.Basic.f3(d_vap, aux.T); liq := Common.helmholtzToBoundaryProps(fl); vap := Common.helmholtzToBoundaryProps(fv); // aux.dpT := BaseIF97.Basic.dptofT(aux.T); end if; aux.dpT := if (liq.d <> vap.d) then (vap.s - liq.s)*liq.d*vap.d/(liq.d - vap.d) else BaseIF97.Basic.dptofT(aux.T); aux.s := liq.s + aux.x*(vap.s - liq.s); aux.rho := liq.d*vap.d/(vap.d + aux.x*(liq.d - vap.d)); aux.cv := Common.cv2Phase(liq, vap, aux.x, aux.T, p); aux.cp := liq.cp + aux.x*(vap.cp - liq.cp); aux.pt := liq.pt + aux.x*(vap.pt - liq.pt); aux.pd := liq.pd + aux.x*(vap.pd - liq.pd); elseif (aux.region == 5) then (aux.T,error) := BaseIF97.Inverses.tofph5(p=aux.p,h= aux.h,reldh= 1.0e-7); assert(error == 0, "error in inverse iteration of steam tables"); g := BaseIF97.Basic.g5(aux.p, aux.T); aux.s := aux.R*(g.tau*g.gtau - g.g); aux.rho := p/(aux.R*aux.T*g.pi*g.gpi); aux.vt := aux.R/p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi); aux.vp := aux.R*aux.T/(p*p)*g.pi*g.pi*g.gpipi; aux.cp := -aux.R*g.tau*g.tau*g.gtautau; aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/g.gpipi)); aux.dpT := -aux.vt/aux.vp; else assert(false, "error in region computation of IF97 steam tables" + "(p = " + String(p) + ", h = " + String(h) + ")"); end if; end waterBaseProp_ph;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
SpecificEntropy | s | specific entropy [J/(kg.K)] | |
Integer | phase | 0 | phase: 2 for two-phase, 1 for one phase, 0 if unknown |
Integer | region | 0 | if 0, do region computation, otherwise assume the region is this input |
Type | Name | Description |
---|---|---|
IF97BaseTwoPhase | aux | auxiliary record |
function waterBaseProp_ps "intermediate property record for water" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.SpecificEntropy s "specific entropy"; input Integer phase = 0 "phase: 2 for two-phase, 1 for one phase, 0 if unknown"; input Integer region = 0 "if 0, do region computation, otherwise assume the region is this input"; output Common.IF97BaseTwoPhase aux "auxiliary record"; protected Common.GibbsDerivs g "dimensionless Gibbs funcion and dervatives w.r.t. pi and tau"; Common.HelmholtzDerivs f "dimensionless Helmholtz funcion and dervatives w.r.t. delta and tau"; Integer error "error flag for inverse iterations"; SI.SpecificEntropy s_liq "liquid specific entropy"; SI.Density d_liq "liquid density"; SI.SpecificEntropy s_vap "vapour specific entropy"; SI.Density d_vap "vapour density"; Common.PhaseBoundaryProperties liq "phase boundary property record"; Common.PhaseBoundaryProperties vap "phase boundary property record"; Common.GibbsDerivs gl "dimensionless Gibbs funcion and dervatives w.r.t. pi and tau"; Common.GibbsDerivs gv "dimensionless Gibbs funcion and dervatives w.r.t. pi and tau"; Modelica.Media.Common.HelmholtzDerivs fl "dimensionless Helmholtz function and dervatives w.r.t. delta and tau"; Modelica.Media.Common.HelmholtzDerivs fv "dimensionless Helmholtz function and dervatives w.r.t. delta and tau"; SI.Temperature t1 "temperature at phase boundary, using inverse from region 1"; SI.Temperature t2 "temperature at phase boundary, using inverse from region 2"; algorithm aux.region := if region == 0 then (if phase == 2 then 4 else BaseIF97.Regions.region_ps(p=p,s=s,phase=phase)) else region; aux.phase := if phase <> 0 then phase else if aux.region == 4 then 2 else 1; aux.p := p; aux.s := s; aux.R := BaseIF97.data.RH2O; if (aux.region == 1) then aux.T := BaseIF97.Basic.tps1(p, s); g := BaseIF97.Basic.g1(p, aux.T); aux.h := aux.R*aux.T*g.tau*g.gtau; aux.rho := p/(aux.R*aux.T*g.pi*g.gpi); aux.vt := aux.R/p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi); aux.vp := aux.R*aux.T/(p*p)*g.pi*g.pi*g.gpipi; aux.cp := -aux.R*g.tau*g.tau*g.gtautau; aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/g.gpipi)); aux.x := 0.0; elseif (aux.region == 2) then aux.T := BaseIF97.Basic.tps2(p, s); g := BaseIF97.Basic.g2(p, aux.T); aux.h := aux.R*aux.T*g.tau*g.gtau; aux.rho := p/(aux.R*aux.T*g.pi*g.gpi); aux.vt := aux.R/p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi); aux.vp := aux.R*aux.T/(p*p)*g.pi*g.pi*g.gpipi; aux.cp := -aux.R*g.tau*g.tau*g.gtautau; aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/g.gpipi)); aux.x := 1.0; elseif (aux.region == 3) then (aux.rho,aux.T,error) := BaseIF97.Inverses.dtofps3(p=p,s=s,delp=1.0e-7,dels= 1.0e-6); f := BaseIF97.Basic.f3(aux.rho, aux.T); aux.h := aux.R*aux.T*(f.tau*f.ftau + f.delta*f.fdelta); aux.s := aux.R*(f.tau*f.ftau - f.f); aux.pd := aux.R*aux.T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta); aux.pt := aux.R*aux.rho*f.delta*(f.fdelta - f.tau*f.fdeltatau); aux.cv := aux.R*(-f.tau*f.tau*f.ftautau); aux.cp := (aux.rho*aux.rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt)/(aux.rho*aux.rho*aux.pd); aux.x := 0.0; elseif (aux.region == 4) then s_liq := BaseIF97.Regions.sl_p(p); s_vap := BaseIF97.Regions.sv_p(p); aux.x := if (s_vap <> s_liq) then (s - s_liq)/(s_vap - s_liq) else 1.0; if p < BaseIF97.data.PLIMIT4A then t1 := BaseIF97.Basic.tps1(p, s_liq); t2 := BaseIF97.Basic.tps2(p, s_vap); gl := BaseIF97.Basic.g1(p, t1); gv := BaseIF97.Basic.g2(p, t2); liq := Common.gibbsToBoundaryProps(gl); vap := Common.gibbsToBoundaryProps(gv); aux.T := t1 + aux.x*(t2 - t1); else aux.T := BaseIF97.Basic.tsat(p); d_liq := rhol_T(aux.T); d_vap := rhov_T(aux.T); fl := BaseIF97.Basic.f3(d_liq, aux.T); fv := BaseIF97.Basic.f3(d_vap, aux.T); liq := Common.helmholtzToBoundaryProps(fl); vap := Common.helmholtzToBoundaryProps(fv); end if; aux.dpT := if (liq.d <> vap.d) then (vap.s - liq.s)*liq.d*vap.d/(liq.d - vap.d) else BaseIF97.Basic.dptofT(aux.T); aux.h := liq.h + aux.x*(vap.h - liq.h); aux.rho := liq.d*vap.d/(vap.d + aux.x*(liq.d - vap.d)); aux.cv := Common.cv2Phase(liq, vap, aux.x, aux.T, p); aux.cp := liq.cp + aux.x*(vap.cp - liq.cp); aux.pt := liq.pt + aux.x*(vap.pt - liq.pt); aux.pd := liq.pd + aux.x*(vap.pd - liq.pd); elseif (aux.region == 5) then (aux.T,error) := BaseIF97.Inverses.tofps5(p=p,s=s,relds= 1.0e-7); assert(error == 0, "error in inverse iteration of steam tables"); g := BaseIF97.Basic.g5(p, aux.T); aux.h := aux.R*aux.T*g.tau*g.gtau; aux.rho := p/(aux.R*aux.T*g.pi*g.gpi); aux.vt := aux.R/p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi); aux.vp := aux.R*aux.T/(p*p)*g.pi*g.pi*g.gpipi; aux.cp := -aux.R*g.tau*g.tau*g.gtautau; aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/g.gpipi)); else assert(false, "error in region computation of IF97 steam tables" + "(p = " + String(p) + ", s = " + String(s) + ")"); end if; end waterBaseProp_ps;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
SpecificEntropy | s | specific entropy [J/(kg.K)] | |
IF97BaseTwoPhase | properties | auxiliary record |
Type | Name | Description |
---|---|---|
Density | rho | density [kg/m3] |
function rho_props_ps "density as function of pressure and specific entropy" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.SpecificEntropy s "specific entropy"; input Common.IF97BaseTwoPhase properties "auxiliary record"; output SI.Density rho "density"; algorithm rho := properties.rho;end rho_props_ps;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
SpecificEntropy | s | specific entropy [J/(kg.K)] | |
Integer | phase | 0 | 2 for two-phase, 1 for one-phase, 0 if not known |
Integer | region | 0 | if 0, region is unknown, otherwise known and this input |
Type | Name | Description |
---|---|---|
Density | rho | density [kg/m3] |
function rho_ps "density as function of pressure and specific entropy" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.SpecificEntropy s "specific entropy"; input Integer phase = 0 "2 for two-phase, 1 for one-phase, 0 if not known"; input Integer region = 0 "if 0, region is unknown, otherwise known and this input"; output SI.Density rho "density"; algorithm rho := rho_props_ps(p, s, waterBaseProp_ps(p, s, phase, region)); end rho_ps;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
SpecificEntropy | s | specific entropy [J/(kg.K)] | |
IF97BaseTwoPhase | properties | auxiliary record |
Type | Name | Description |
---|---|---|
Temperature | T | temperature [K] |
function T_props_ps "temperature as function of pressure and specific entropy" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.SpecificEntropy s "specific entropy"; input Common.IF97BaseTwoPhase properties "auxiliary record"; output SI.Temperature T "temperature"; algorithm T := properties.T;end T_props_ps;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
SpecificEntropy | s | specific entropy [J/(kg.K)] | |
Integer | phase | 0 | 2 for two-phase, 1 for one-phase, 0 if not known |
Integer | region | 0 | if 0, region is unknown, otherwise known and this input |
Type | Name | Description |
---|---|---|
Temperature | T | Temperature [K] |
function T_ps "temperature as function of pressure and specific entropy" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.SpecificEntropy s "specific entropy"; input Integer phase = 0 "2 for two-phase, 1 for one-phase, 0 if not known"; input Integer region = 0 "if 0, region is unknown, otherwise known and this input"; output SI.Temperature T "Temperature"; algorithm T := T_props_ps(p, s, waterBaseProp_ps(p, s, phase, region)); end T_ps;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
SpecificEntropy | s | specific entropy [J/(kg.K)] | |
IF97BaseTwoPhase | aux | auxiliary record |
Type | Name | Description |
---|---|---|
SpecificEnthalpy | h | specific enthalpy [J/kg] |
function h_props_ps "specific enthalpy as function or pressure and temperature" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.SpecificEntropy s "specific entropy"; input Common.IF97BaseTwoPhase aux "auxiliary record"; output SI.SpecificEnthalpy h "specific enthalpy"; algorithm h := aux.h;end h_props_ps;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
SpecificEntropy | s | specific entropy [J/(kg.K)] | |
Integer | phase | 0 | 2 for two-phase, 1 for one-phase, 0 if not known |
Integer | region | 0 | if 0, region is unknown, otherwise known and this input |
Type | Name | Description |
---|---|---|
SpecificEnthalpy | h | specific enthalpy [J/kg] |
function h_ps "specific enthalpy as function or pressure and temperature" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.SpecificEntropy s "specific entropy"; input Integer phase = 0 "2 for two-phase, 1 for one-phase, 0 if not known"; input Integer region = 0 "if 0, region is unknown, otherwise known and this input"; output SI.SpecificEnthalpy h "specific enthalpy"; algorithm h := h_props_ps(p, s, waterBaseProp_ps(p, s, phase, region)); end h_ps;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
SpecificEntropy | s | specific entropy [J/(kg.K)] |
Type | Name | Description |
---|---|---|
Integer | phase | true if in liquid or gas or supercritical region |
function phase_ps "phase as a function of pressure and specific entropy" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.SpecificEntropy s "specific entropy"; output Integer phase "true if in liquid or gas or supercritical region"; algorithm phase := if ((s < sl_p(p) or s > sv_p(p)) or p > BaseIF97.data.PCRIT) then 1 else 2;end phase_ps;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
SpecificEnthalpy | h | specific enthalpy [J/kg] |
Type | Name | Description |
---|---|---|
Integer | phase | true if in liquid or gas or supercritical region |
function phase_ph "phase as a function of pressure and specific enthalpy" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.SpecificEnthalpy h "specific enthalpy"; output Integer phase "true if in liquid or gas or supercritical region"; algorithm phase := if ((h < hl_p(p) or h > hv_p(p)) or p > BaseIF97.data.PCRIT) then 1 else 2;end phase_ph;
Type | Name | Default | Description |
---|---|---|---|
Density | rho | density [kg/m3] | |
Temperature | T | temperature [K] |
Type | Name | Description |
---|---|---|
Integer | phase | true if in liquid or gas or supercritical region |
function phase_dT "phase as a function of pressure and temperature" extends Modelica.Icons.Function; input SI.Density rho "density"; input SI.Temperature T "temperature"; output Integer phase "true if in liquid or gas or supercritical region"; algorithm phase := if not ((rho < rhol_T(T) and rho > rhov_T(T)) and T < BaseIF97. data.TCRIT) then 1 else 2;end phase_dT;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
SpecificEnthalpy | h | specific enthalpy [J/kg] | |
IF97BaseTwoPhase | properties | auxiliary record |
Type | Name | Description |
---|---|---|
Density | rho | density [kg/m3] |
function rho_props_ph "density as function of pressure and specific enthalpy" annotation(derivative=rho_ph_der); extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.SpecificEnthalpy h "specific enthalpy"; input Common.IF97BaseTwoPhase properties "auxiliary record"; output SI.Density rho "density"; algorithm rho := properties.rho;end rho_props_ph;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
SpecificEnthalpy | h | specific enthalpy [J/kg] | |
Integer | phase | 0 | 2 for two-phase, 1 for one-phase, 0 if not known |
Integer | region | 0 | if 0, region is unknown, otherwise known and this input |
Type | Name | Description |
---|---|---|
Density | rho | density [kg/m3] |
function rho_ph "density as function of pressure and specific enthalpy" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.SpecificEnthalpy h "specific enthalpy"; input Integer phase = 0 "2 for two-phase, 1 for one-phase, 0 if not known"; input Integer region = 0 "if 0, region is unknown, otherwise known and this input"; output SI.Density rho "density"; algorithm rho := rho_props_ph(p, h, waterBaseProp_ph(p, h, phase, region)); end rho_ph;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
SpecificEnthalpy | h | specific enthalpy [J/kg] | |
IF97BaseTwoPhase | aux | auxiliary record | |
Real | p_der | derivative of pressure | |
Real | h_der | derivative of specific enthalpy |
Type | Name | Description |
---|---|---|
Real | rho_der | derivative of density |
function rho_ph_der "derivative function of rho_ph" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.SpecificEnthalpy h "specific enthalpy"; input Common.IF97BaseTwoPhase aux "auxiliary record"; input Real p_der "derivative of pressure"; input Real h_der "derivative of specific enthalpy"; output Real rho_der "derivative of density"; algorithm if (aux.region == 4) then rho_der := (aux.rho*(aux.rho*aux.cv/aux.dpT + 1.0)/(aux.dpT*aux.T))*p_der + (-aux.rho*aux.rho/(aux.dpT*aux.T))*h_der; elseif (aux.region == 3) then rho_der := ((aux.rho*(aux.cv*aux.rho + aux.pt))/(aux.rho*aux.rho*aux.pd* aux.cv + aux.T*aux.pt*aux.pt))*p_der + (-aux.rho*aux.rho*aux.pt/(aux. rho*aux.rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt))*h_der; else //regions 1,2,5 rho_der := (-aux.rho*aux.rho*(aux.vp*aux.cp - aux.vt/aux.rho + aux.T*aux. vt*aux.vt)/aux.cp)*p_der + (-aux.rho*aux.rho*aux.vt/(aux.cp))*h_der; end if; end rho_ph_der;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
SpecificEnthalpy | h | specific enthalpy [J/kg] | |
IF97BaseTwoPhase | properties | auxiliary record |
Type | Name | Description |
---|---|---|
Temperature | T | temperature [K] |
function T_props_ph "temperature as function of pressure and specific enthalpy" annotation(derivative=T_ph_der); extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.SpecificEnthalpy h "specific enthalpy"; input Common.IF97BaseTwoPhase properties "auxiliary record"; output SI.Temperature T "temperature"; algorithm T := properties.T;end T_props_ph;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
SpecificEnthalpy | h | specific enthalpy [J/kg] | |
Integer | phase | 0 | 2 for two-phase, 1 for one-phase, 0 if not known |
Integer | region | 0 | if 0, region is unknown, otherwise known and this input |
Type | Name | Description |
---|---|---|
Temperature | T | Temperature [K] |
function T_ph "temperature as function of pressure and specific enthalpy" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.SpecificEnthalpy h "specific enthalpy"; input Integer phase = 0 "2 for two-phase, 1 for one-phase, 0 if not known"; input Integer region = 0 "if 0, region is unknown, otherwise known and this input"; output SI.Temperature T "Temperature"; algorithm T := T_props_ph(p, h, waterBaseProp_ph(p, h, phase, region)); end T_ph;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
SpecificEnthalpy | h | specific enthalpy [J/kg] | |
IF97BaseTwoPhase | aux | auxiliary record | |
Real | p_der | derivative of pressure | |
Real | h_der | derivative of specific enthalpy |
Type | Name | Description |
---|---|---|
Real | T_der | derivative of temperature |
function T_ph_der "derivative function of T_ph" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.SpecificEnthalpy h "specific enthalpy"; input Common.IF97BaseTwoPhase aux "auxiliary record"; input Real p_der "derivative of pressure"; input Real h_der "derivative of specific enthalpy"; output Real T_der "derivative of temperature"; algorithm if (aux.region == 4) then T_der := 1/aux.dpT*p_der; elseif (aux.region == 3) then T_der := ((-aux.rho*aux.pd + aux.T*aux.pt)/(aux.rho*aux.rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt))*p_der + ((aux.rho*aux.rho*aux.pd)/(aux.rho*aux. rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt))*h_der; else //regions 1,2 or 5 T_der := ((-1/aux.rho + aux.T*aux.vt)/aux.cp)*p_der + (1/aux.cp)*h_der; end if; end T_ph_der;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
SpecificEnthalpy | h | specific enthalpy [J/kg] | |
IF97BaseTwoPhase | properties | auxiliary record |
Type | Name | Description |
---|---|---|
SpecificEntropy | s | specific entropy [J/(kg.K)] |
function s_props_ph "specific entropy as function of pressure and specific enthalpy" annotation(derivative=s_ph_der); extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.SpecificEnthalpy h "specific enthalpy"; input Common.IF97BaseTwoPhase properties "auxiliary record"; output SI.SpecificEntropy s "specific entropy"; algorithm s := properties.s;end s_props_ph;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
SpecificEnthalpy | h | specific enthalpy [J/kg] | |
Integer | phase | 0 | 2 for two-phase, 1 for one-phase, 0 if not known |
Integer | region | 0 | if 0, region is unknown, otherwise known and this input |
Type | Name | Description |
---|---|---|
SpecificEntropy | s | specific entropy [J/(kg.K)] |
function s_ph "specific entropy as function of pressure and specific enthalpy" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.SpecificEnthalpy h "specific enthalpy"; input Integer phase = 0 "2 for two-phase, 1 for one-phase, 0 if not known"; input Integer region = 0 "if 0, region is unknown, otherwise known and this input"; output SI.SpecificEntropy s "specific entropy"; algorithm s := s_props_ph(p, h, waterBaseProp_ph(p, h, phase, region)); end s_ph;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
SpecificEnthalpy | h | specific enthalpy [J/kg] | |
IF97BaseTwoPhase | aux | auxiliary record | |
Real | p_der | derivative of pressure | |
Real | h_der | derivative of specific enthalpy |
Type | Name | Description |
---|---|---|
Real | s_der | derivative of entropy |
function s_ph_der "specific entropy as function of pressure and specific enthalpy" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.SpecificEnthalpy h "specific enthalpy"; input Common.IF97BaseTwoPhase aux "auxiliary record"; input Real p_der "derivative of pressure"; input Real h_der "derivative of specific enthalpy"; output Real s_der "derivative of entropy"; algorithm s_der := -1/(aux.rho*aux.T)*p_der + 1/aux.T*h_der; end s_ph_der;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
SpecificEnthalpy | h | specific enthalpy [J/kg] | |
IF97BaseTwoPhase | aux | auxiliary record |
Type | Name | Description |
---|---|---|
SpecificHeatCapacity | cv | specific heat capacity [J/(kg.K)] |
function cv_props_ph "specific heat capacity at constant volume as function of pressure and specific enthalpy" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.SpecificEnthalpy h "specific enthalpy"; input Common.IF97BaseTwoPhase aux "auxiliary record"; output SI.SpecificHeatCapacity cv "specific heat capacity"; algorithm cv := aux.cv;end cv_props_ph;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
SpecificEnthalpy | h | specific enthalpy [J/kg] | |
Integer | phase | 0 | 2 for two-phase, 1 for one-phase, 0 if not known |
Integer | region | 0 | if 0, region is unknown, otherwise known and this input |
Type | Name | Description |
---|---|---|
SpecificHeatCapacity | cv | specific heat capacity [J/(kg.K)] |
function cv_ph "specific heat capacity at constant volume as function of pressure and specific enthalpy" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.SpecificEnthalpy h "specific enthalpy"; input Integer phase = 0 "2 for two-phase, 1 for one-phase, 0 if not known"; input Integer region = 0 "if 0, region is unknown, otherwise known and this input"; output SI.SpecificHeatCapacity cv "specific heat capacity"; algorithm cv := cv_props_ph(p, h, waterBaseProp_ph(p, h, phase, region)); end cv_ph;
Type | Name | Default | Description |
---|---|---|---|
Boolean | check | condition to check |
Type | Name | Description |
---|---|---|
Real | dummy | dummy output |
function regionAssertReal "assert function for inlining" extends Modelica.Icons.Function; input Boolean check "condition to check"; output Real dummy "dummy output"; algorithm assert(check, "this function can not be called with two-phase inputs!"); end regionAssertReal;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
SpecificEnthalpy | h | specific enthalpy [J/kg] | |
IF97BaseTwoPhase | aux | auxiliary record |
Type | Name | Description |
---|---|---|
SpecificHeatCapacity | cp | specific heat capacity [J/(kg.K)] |
function cp_props_ph "specific heat capacity at constant pressure as function of pressure and specific enthalpy" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.SpecificEnthalpy h "specific enthalpy"; input Common.IF97BaseTwoPhase aux "auxiliary record"; output SI.SpecificHeatCapacity cp "specific heat capacity"; algorithm cp := aux.cp;end cp_props_ph;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
SpecificEnthalpy | h | specific enthalpy [J/kg] | |
Integer | phase | 0 | 2 for two-phase, 1 for one-phase, 0 if not known |
Integer | region | 0 | if 0, region is unknown, otherwise known and this input |
Type | Name | Description |
---|---|---|
SpecificHeatCapacity | cp | specific heat capacity [J/(kg.K)] |
function cp_ph "specific heat capacity at constant pressure as function of pressure and specific enthalpy" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.SpecificEnthalpy h "specific enthalpy"; input Integer phase = 0 "2 for two-phase, 1 for one-phase, 0 if not known"; input Integer region = 0 "if 0, region is unknown, otherwise known and this input"; output SI.SpecificHeatCapacity cp "specific heat capacity"; algorithm cp := cp_props_ph(p, h, waterBaseProp_ph(p, h, phase, region)); end cp_ph;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
SpecificEnthalpy | h | specific enthalpy [J/kg] | |
IF97BaseTwoPhase | aux | auxiliary record |
Type | Name | Description |
---|---|---|
RelativePressureCoefficient | beta | isobaric expansion coefficient [1/K] |
function beta_props_ph "isobaric expansion coefficient as function of pressure and specific enthalpy" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.SpecificEnthalpy h "specific enthalpy"; input Common.IF97BaseTwoPhase aux "auxiliary record"; output SI.RelativePressureCoefficient beta "isobaric expansion coefficient"; algorithm beta := if aux.region == 3 or aux.region == 4 then aux.pt/(aux.rho*aux.pd) else aux.vt*aux.rho;end beta_props_ph;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
SpecificEnthalpy | h | specific enthalpy [J/kg] | |
Integer | phase | 0 | 2 for two-phase, 1 for one-phase, 0 if not known |
Integer | region | 0 | if 0, region is unknown, otherwise known and this input |
Type | Name | Description |
---|---|---|
RelativePressureCoefficient | beta | isobaric expansion coefficient [1/K] |
function beta_ph "isobaric expansion coefficient as function of pressure and specific enthalpy" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.SpecificEnthalpy h "specific enthalpy"; input Integer phase = 0 "2 for two-phase, 1 for one-phase, 0 if not known"; input Integer region = 0 "if 0, region is unknown, otherwise known and this input"; output SI.RelativePressureCoefficient beta "isobaric expansion coefficient"; algorithm beta := beta_props_ph(p, h, waterBaseProp_ph(p, h, phase, region)); end beta_ph;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
SpecificEnthalpy | h | specific enthalpy [J/kg] | |
IF97BaseTwoPhase | aux | auxiliary record |
Type | Name | Description |
---|---|---|
IsothermalCompressibility | kappa | isothermal compressibility factor [1/Pa] |
function kappa_props_ph "isothermal compressibility factor as function of pressure and specific enthalpy" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.SpecificEnthalpy h "specific enthalpy"; input Common.IF97BaseTwoPhase aux "auxiliary record"; output SI.IsothermalCompressibility kappa "isothermal compressibility factor"; algorithm kappa := if aux.region == 3 or aux.region == 4 then 1/(aux.rho*aux.pd) else -aux.vp*aux.rho;end kappa_props_ph;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
SpecificEnthalpy | h | specific enthalpy [J/kg] | |
Integer | phase | 0 | 2 for two-phase, 1 for one-phase, 0 if not known |
Integer | region | 0 | if 0, region is unknown, otherwise known and this input |
Type | Name | Description |
---|---|---|
IsothermalCompressibility | kappa | isothermal compressibility factor [1/Pa] |
function kappa_ph "isothermal compressibility factor as function of pressure and specific enthalpy" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.SpecificEnthalpy h "specific enthalpy"; input Integer phase = 0 "2 for two-phase, 1 for one-phase, 0 if not known"; input Integer region = 0 "if 0, region is unknown, otherwise known and this input"; output SI.IsothermalCompressibility kappa "isothermal compressibility factor"; algorithm kappa := kappa_props_ph(p, h, waterBaseProp_ph(p, h, phase, region)); end kappa_ph;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
SpecificEnthalpy | h | specific enthalpy [J/kg] | |
IF97BaseTwoPhase | aux | auxiliary record |
Type | Name | Description |
---|---|---|
Velocity | v_sound | speed of sound [m/s] |
function velocityOfSound_props_ph "speed of sound as function of pressure and specific enthalpy" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.SpecificEnthalpy h "specific enthalpy"; input Common.IF97BaseTwoPhase aux "auxiliary record"; output SI.Velocity v_sound "speed of sound"; algorithm // dp/drho at constant s v_sound := if aux.region == 3 then sqrt(max(0,(aux.pd*aux.rho*aux.rho*aux.cv + aux.pt*aux.pt*aux.T)/(aux.rho*aux.rho*aux.cv))) else if aux.region == 4 then sqrt(max(0,1/((aux.rho*(aux.rho*aux.cv/aux.dpT + 1.0)/(aux.dpT*aux.T)) - 1/aux.rho*aux.rho*aux.rho/(aux.dpT*aux.T)))) else sqrt(max(0,-aux.cp/(aux.rho*aux.rho*(aux.vp*aux.cp+aux.vt*aux.vt*aux.T))));end velocityOfSound_props_ph;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
SpecificEnthalpy | h | specific enthalpy [J/kg] | |
Integer | phase | 0 | 2 for two-phase, 1 for one-phase, 0 if not known |
Integer | region | 0 | if 0, region is unknown, otherwise known and this input |
Type | Name | Description |
---|---|---|
Velocity | v_sound | speed of sound [m/s] |
function velocityOfSound_ph extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.SpecificEnthalpy h "specific enthalpy"; input Integer phase = 0 "2 for two-phase, 1 for one-phase, 0 if not known"; input Integer region = 0 "if 0, region is unknown, otherwise known and this input"; output SI.Velocity v_sound "speed of sound"; algorithm v_sound := velocityOfSound_props_ph(p, h, waterBaseProp_ph(p, h, phase, region)); end velocityOfSound_ph;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
SpecificEnthalpy | h | specific enthalpy [J/kg] | |
IF97BaseTwoPhase | aux | auxiliary record |
Type | Name | Description |
---|---|---|
Real | gamma | isentropic exponent |
function isentropicExponent_props_ph "isentropic exponent as function of pressure and specific enthalpy" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.SpecificEnthalpy h "specific enthalpy"; input Common.IF97BaseTwoPhase aux "auxiliary record"; output Real gamma "isentropic exponent"; algorithm gamma := if aux.region == 3 then 1/(aux.rho*p)*((aux.pd*aux.cv*aux.rho*aux.rho + aux.pt*aux.pt*aux.T)/(aux.cv)) else if aux.region == 4 then 1/(aux.rho*p)*aux.dpT*aux.dpT*aux.T/aux.cv else -1/(aux.rho*aux.p)*aux.cp/(aux.vp*aux.cp + aux.vt*aux.vt*aux.T);end isentropicExponent_props_ph;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
SpecificEnthalpy | h | specific enthalpy [J/kg] | |
Integer | phase | 0 | 2 for two-phase, 1 for one-phase, 0 if not known |
Integer | region | 0 | if 0, region is unknown, otherwise known and this input |
Type | Name | Description |
---|---|---|
Real | gamma | isentropic exponent |
function isentropicExponent_ph "isentropic exponent as function of pressure and specific enthalpy" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.SpecificEnthalpy h "specific enthalpy"; input Integer phase = 0 "2 for two-phase, 1 for one-phase, 0 if not known"; input Integer region = 0 "if 0, region is unknown, otherwise known and this input"; output Real gamma "isentropic exponent"; algorithm gamma := isentropicExponent_props_ph(p, h, waterBaseProp_ph(p, h, phase, region));end isentropicExponent_ph;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
SpecificEnthalpy | h | specific enthalpy [J/kg] | |
IF97BaseTwoPhase | aux | auxiliary record |
Type | Name | Description |
---|---|---|
DerDensityByPressure | ddph | density derivative by pressure [s2/m2] |
function ddph_props "density derivative by pressure" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.SpecificEnthalpy h "specific enthalpy"; input Common.IF97BaseTwoPhase aux "auxiliary record"; output SI.DerDensityByPressure ddph "density derivative by pressure"; algorithm ddph := if aux.region == 3 then ((aux.rho*(aux.cv*aux.rho + aux.pt))/(aux.rho*aux.rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt)) else if aux.region == 4 then (aux.rho*(aux.rho*aux.cv/aux.dpT + 1.0)/(aux.dpT*aux.T)) else (-aux.rho*aux.rho*(aux.vp*aux.cp - aux.vt/aux.rho + aux.T*aux.vt*aux.vt)/aux.cp);end ddph_props;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
SpecificEnthalpy | h | specific enthalpy [J/kg] | |
Integer | phase | 0 | 2 for two-phase, 1 for one-phase, 0 if not known |
Integer | region | 0 | if 0, region is unknown, otherwise known and this input |
Type | Name | Description |
---|---|---|
DerDensityByPressure | ddph | density derivative by pressure [s2/m2] |
function ddph "density derivative by pressure" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.SpecificEnthalpy h "specific enthalpy"; input Integer phase = 0 "2 for two-phase, 1 for one-phase, 0 if not known"; input Integer region = 0 "if 0, region is unknown, otherwise known and this input"; output SI.DerDensityByPressure ddph "density derivative by pressure"; algorithm ddph := ddph_props(p, h, waterBaseProp_ph(p, h, phase, region)); end ddph;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
SpecificEnthalpy | h | specific enthalpy [J/kg] | |
IF97BaseTwoPhase | aux | auxiliary record |
Type | Name | Description |
---|---|---|
DerDensityByEnthalpy | ddhp | density derivative by specific enthalpy [kg.s2/m5] |
function ddhp_props "density derivative by specific enthalpy" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.SpecificEnthalpy h "specific enthalpy"; input Common.IF97BaseTwoPhase aux "auxiliary record"; output SI.DerDensityByEnthalpy ddhp "density derivative by specific enthalpy"; algorithm ddhp := if aux.region == 3 then -aux.rho*aux.rho*aux.pt/(aux.rho*aux.rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt) else if aux.region == 4 then -aux.rho*aux.rho/(aux.dpT*aux.T) else -aux.rho*aux.rho*aux.vt/(aux.cp);end ddhp_props;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
SpecificEnthalpy | h | specific enthalpy [J/kg] | |
Integer | phase | 0 | 2 for two-phase, 1 for one-phase, 0 if not known |
Integer | region | 0 | if 0, region is unknown, otherwise known and this input |
Type | Name | Description |
---|---|---|
DerDensityByEnthalpy | ddhp | density derivative by specific enthalpy [kg.s2/m5] |
function ddhp "density derivative by specific enthalpy" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.SpecificEnthalpy h "specific enthalpy"; input Integer phase = 0 "2 for two-phase, 1 for one-phase, 0 if not known"; input Integer region = 0 "if 0, region is unknown, otherwise known and this input"; output SI.DerDensityByEnthalpy ddhp "density derivative by specific enthalpy"; algorithm ddhp := ddhp_props(p, h, waterBaseProp_ph(p, h, phase, region)); end ddhp;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
Temperature | T | temperature [K] | |
Integer | region | 0 | if 0, do region computation, otherwise assume the region is this input |
Type | Name | Description |
---|---|---|
IF97BaseTwoPhase | aux | auxiliary record |
function waterBaseProp_pT "intermediate property record for water (p and T prefered states)" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.Temperature T "temperature"; input Integer region = 0 "if 0, do region computation, otherwise assume the region is this input"; output Common.IF97BaseTwoPhase aux "auxiliary record"; protected Common.GibbsDerivs g "dimensionless Gibbs funcion and dervatives w.r.t. pi and tau"; Common.HelmholtzDerivs f "dimensionless Helmholtz funcion and dervatives w.r.t. delta and tau"; Integer error "error flag for inverse iterations"; algorithm aux.phase := 1; aux.region := if region == 0 then BaseIF97.Regions.region_pT(p=p,T= T) else region; aux.R := BaseIF97.data.RH2O; aux.p := p; aux.T := T; if (aux.region == 1) then g := BaseIF97.Basic.g1(p, T); aux.h := aux.R*aux.T*g.tau*g.gtau; aux.s := aux.R*(g.tau*g.gtau - g.g); aux.rho := p/(aux.R*T*g.pi*g.gpi); aux.vt := aux.R/p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi); aux.vp := aux.R*T/(p*p)*g.pi*g.pi*g.gpipi; aux.cp := -aux.R*g.tau*g.tau*g.gtautau; aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/g.gpipi)); aux.x := 0.0; elseif (aux.region == 2) then g := BaseIF97.Basic.g2(p, T); aux.h := aux.R*aux.T*g.tau*g.gtau; aux.s := aux.R*(g.tau*g.gtau - g.g); aux.rho := p/(aux.R*T*g.pi*g.gpi); aux.vt := aux.R/p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi); aux.vp := aux.R*T/(p*p)*g.pi*g.pi*g.gpipi; aux.cp := -aux.R*g.tau*g.tau*g.gtautau; aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/g.gpipi)); aux.x := 1.0; elseif (aux.region == 3) then (aux.rho,error) := BaseIF97.Inverses.dofpt3(p=p,T= T,delp= 1.0e-7); f := BaseIF97.Basic.f3(aux.rho, T); aux.h := aux.R*T*(f.tau*f.ftau + f.delta*f.fdelta); aux.s := aux.R*(f.tau*f.ftau - f.f); aux.pd := aux.R*T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta); aux.pt := aux.R*aux.rho*f.delta*(f.fdelta - f.tau*f.fdeltatau); aux.cv := aux.R*(-f.tau*f.tau*f.ftautau); aux.x := 0.0; elseif (aux.region == 5) then g := BaseIF97.Basic.g5(p, T); aux.h := aux.R*aux.T*g.tau*g.gtau; aux.s := aux.R*(g.tau*g.gtau - g.g); aux.rho := p/(aux.R*T*g.pi*g.gpi); aux.vt := aux.R/p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi); aux.vp := aux.R*T/(p*p)*g.pi*g.pi*g.gpipi; aux.cp := -aux.R*g.tau*g.tau*g.gtautau; aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/g.gpipi)); else assert(false, "error in region computation of IF97 steam tables" + "(p = " + String(p) + ", T = " + String(T) + ")"); end if; end waterBaseProp_pT;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
Temperature | T | temperature [K] | |
IF97BaseTwoPhase | aux | auxiliary record |
Type | Name | Description |
---|---|---|
Density | rho | density [kg/m3] |
function rho_props_pT "density as function or pressure and temperature" annotation(derivative=rho_pT_der); extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.Temperature T "temperature"; input Common.IF97BaseTwoPhase aux "auxiliary record"; output SI.Density rho "density"; algorithm rho := aux.rho;end rho_props_pT;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
Temperature | T | temperature [K] | |
Integer | region | 0 | if 0, region is unknown, otherwise known and this input |
Type | Name | Description |
---|---|---|
Density | rho | density [kg/m3] |
function rho_pT "density as function or pressure and temperature" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.Temperature T "temperature"; input Integer region = 0 "if 0, region is unknown, otherwise known and this input"; output SI.Density rho "density"; algorithm rho := rho_props_pT(p, T, waterBaseProp_pT(p, T, region)); end rho_pT;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
Temperature | T | temperature [K] | |
IF97BaseTwoPhase | aux | auxiliary record |
Type | Name | Description |
---|---|---|
SpecificEnthalpy | h | specific enthalpy [J/kg] |
function h_props_pT "specific enthalpy as function or pressure and temperature" annotation(derivative=h_pT_der); extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.Temperature T "temperature"; input Common.IF97BaseTwoPhase aux "auxiliary record"; output SI.SpecificEnthalpy h "specific enthalpy"; algorithm h := aux.h;end h_props_pT;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
Temperature | T | Temperature [K] | |
Integer | region | 0 | if 0, region is unknown, otherwise known and this input |
Type | Name | Description |
---|---|---|
SpecificEnthalpy | h | specific enthalpy [J/kg] |
function h_pT "specific enthalpy as function or pressure and temperature" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.Temperature T "Temperature"; input Integer region = 0 "if 0, region is unknown, otherwise known and this input"; output SI.SpecificEnthalpy h "specific enthalpy"; algorithm h := h_props_pT(p, T, waterBaseProp_pT(p, T, region)); end h_pT;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
Temperature | T | temperature [K] | |
IF97BaseTwoPhase | aux | auxiliary record | |
Real | p_der | derivative of pressure | |
Real | T_der | derivative of temperature |
Type | Name | Description |
---|---|---|
Real | h_der | derivative of specific enthalpy |
function h_pT_der "derivative function of h_pT" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.Temperature T "temperature"; input Common.IF97BaseTwoPhase aux "auxiliary record"; input Real p_der "derivative of pressure"; input Real T_der "derivative of temperature"; output Real h_der "derivative of specific enthalpy"; algorithm if (aux.region == 3) then h_der := ((-aux.rho*aux.pd + T*aux.pt)/(aux.rho*aux.rho*aux.pd))*p_der + ((aux.rho*aux.rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt)/(aux.rho*aux.rho *aux.pd))*T_der; else //regions 1,2 or 5 h_der := (1/aux.rho - aux.T*aux.vt)*p_der + aux.cp*T_der; end if; end h_pT_der;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
Temperature | T | temperature [K] | |
IF97BaseTwoPhase | aux | auxiliary record | |
Real | p_der | derivative of pressure | |
Real | T_der | derivative of temperature |
Type | Name | Description |
---|---|---|
Real | rho_der | derivative of density |
function rho_pT_der "derivative function of rho_pT" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.Temperature T "temperature"; input Common.IF97BaseTwoPhase aux "auxiliary record"; input Real p_der "derivative of pressure"; input Real T_der "derivative of temperature"; output Real rho_der "derivative of density"; algorithm if (aux.region == 3) then rho_der := (1/aux.pd)*p_der - (aux.pt/aux.pd)*T_der; else //regions 1,2 or 5 rho_der := (-aux.rho*aux.rho*aux.vp)*p_der + (-aux.rho*aux.rho*aux.vt)* T_der; end if; end rho_pT_der;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
Temperature | T | temperature [K] | |
IF97BaseTwoPhase | aux | auxiliary record |
Type | Name | Description |
---|---|---|
SpecificEntropy | s | specific entropy [J/(kg.K)] |
function s_props_pT "specific entropy as function of pressure and temperature" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.Temperature T "temperature"; input Common.IF97BaseTwoPhase aux "auxiliary record"; output SI.SpecificEntropy s "specific entropy"; algorithm s := aux.s;end s_props_pT;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
Temperature | T | temperature [K] | |
Integer | region | 0 | if 0, region is unknown, otherwise known and this input |
Type | Name | Description |
---|---|---|
SpecificEntropy | s | specific entropy [J/(kg.K)] |
function s_pT "temperature as function of pressure and temperature" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.Temperature T "temperature"; input Integer region = 0 "if 0, region is unknown, otherwise known and this input"; output SI.SpecificEntropy s "specific entropy"; algorithm s := s_props_pT(p, T, waterBaseProp_pT(p, T, region));end s_pT;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
Temperature | T | temperature [K] | |
IF97BaseTwoPhase | aux | auxiliary record |
Type | Name | Description |
---|---|---|
SpecificHeatCapacity | cv | specific heat capacity [J/(kg.K)] |
function cv_props_pT "specific heat capacity at constant volume as function of pressure and temperature" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.Temperature T "temperature"; input Common.IF97BaseTwoPhase aux "auxiliary record"; output SI.SpecificHeatCapacity cv "specific heat capacity"; algorithm cv := aux.cv;end cv_props_pT;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
Temperature | T | temperature [K] | |
Integer | region | 0 | if 0, region is unknown, otherwise known and this input |
Type | Name | Description |
---|---|---|
SpecificHeatCapacity | cv | specific heat capacity [J/(kg.K)] |
function cv_pT "specific heat capacity at constant volume as function of pressure and temperature" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.Temperature T "temperature"; input Integer region = 0 "if 0, region is unknown, otherwise known and this input"; output SI.SpecificHeatCapacity cv "specific heat capacity"; algorithm cv := cv_props_pT(p, T, waterBaseProp_pT(p, T, region));end cv_pT;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
Temperature | T | temperature [K] | |
IF97BaseTwoPhase | aux | auxiliary record |
Type | Name | Description |
---|---|---|
SpecificHeatCapacity | cp | specific heat capacity [J/(kg.K)] |
function cp_props_pT "specific heat capacity at constant pressure as function of pressure and temperature" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.Temperature T "temperature"; input Common.IF97BaseTwoPhase aux "auxiliary record"; output SI.SpecificHeatCapacity cp "specific heat capacity"; algorithm cp := if aux.region == 3 then (aux.rho*aux.rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt)/(aux.rho*aux.rho*aux.pd) else aux.cp;end cp_props_pT;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
Temperature | T | temperature [K] | |
Integer | region | 0 | if 0, region is unknown, otherwise known and this input |
Type | Name | Description |
---|---|---|
SpecificHeatCapacity | cp | specific heat capacity [J/(kg.K)] |
function cp_pT "specific heat capacity at constant pressure as function of pressure and temperature" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.Temperature T "temperature"; input Integer region = 0 "if 0, region is unknown, otherwise known and this input"; output SI.SpecificHeatCapacity cp "specific heat capacity"; algorithm cp := cp_props_pT(p, T, waterBaseProp_pT(p, T, region));end cp_pT;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
Temperature | T | temperature [K] | |
IF97BaseTwoPhase | aux | auxiliary record |
Type | Name | Description |
---|---|---|
RelativePressureCoefficient | beta | isobaric expansion coefficient [1/K] |
function beta_props_pT "isobaric expansion coefficient as function of pressure and temperature" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.Temperature T "temperature"; input Common.IF97BaseTwoPhase aux "auxiliary record"; output SI.RelativePressureCoefficient beta "isobaric expansion coefficient"; algorithm beta := if aux.region == 3 then aux.pt/(aux.rho*aux.pd) else aux.vt*aux.rho;end beta_props_pT;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
Temperature | T | temperature [K] | |
Integer | region | 0 | if 0, region is unknown, otherwise known and this input |
Type | Name | Description |
---|---|---|
RelativePressureCoefficient | beta | isobaric expansion coefficient [1/K] |
function beta_pT "isobaric expansion coefficient as function of pressure and temperature" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.Temperature T "temperature"; input Integer region = 0 "if 0, region is unknown, otherwise known and this input"; output SI.RelativePressureCoefficient beta "isobaric expansion coefficient"; algorithm beta := beta_props_pT(p, T, waterBaseProp_pT(p, T, region));end beta_pT;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
Temperature | T | temperature [K] | |
IF97BaseTwoPhase | aux | auxiliary record |
Type | Name | Description |
---|---|---|
IsothermalCompressibility | kappa | isothermal compressibility factor [1/Pa] |
function kappa_props_pT "isothermal compressibility factor as function of pressure and temperature" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.Temperature T "temperature"; input Common.IF97BaseTwoPhase aux "auxiliary record"; output SI.IsothermalCompressibility kappa "isothermal compressibility factor"; algorithm kappa := if aux.region == 3 then 1/(aux.rho*aux.pd) else -aux.vp*aux.rho;end kappa_props_pT;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
Temperature | T | temperature [K] | |
Integer | region | 0 | if 0, region is unknown, otherwise known and this input |
Type | Name | Description |
---|---|---|
IsothermalCompressibility | kappa | isothermal compressibility factor [1/Pa] |
function kappa_pT "isothermal compressibility factor as function of pressure and temperature" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.Temperature T "temperature"; input Integer region = 0 "if 0, region is unknown, otherwise known and this input"; output SI.IsothermalCompressibility kappa "isothermal compressibility factor"; algorithm kappa := kappa_props_pT(p, T, waterBaseProp_pT(p, T, region));end kappa_pT;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
Temperature | T | temperature [K] | |
IF97BaseTwoPhase | aux | auxiliary record |
Type | Name | Description |
---|---|---|
Velocity | v_sound | speed of sound [m/s] |
function velocityOfSound_props_pT "speed of sound as function of pressure and temperature" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.Temperature T "temperature"; input Common.IF97BaseTwoPhase aux "auxiliary record"; output SI.Velocity v_sound "speed of sound"; algorithm // dp/drho at constant s v_sound := if aux.region == 3 then sqrt(max(0,(aux.pd*aux.rho*aux.rho*aux.cv + aux.pt*aux.pt*aux.T)/(aux.rho*aux.rho*aux.cv))) else sqrt(max(0,-aux.cp/(aux.rho*aux.rho*(aux.vp*aux.cp+aux.vt*aux.vt*aux.T))));end velocityOfSound_props_pT;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
Temperature | T | temperature [K] | |
Integer | region | 0 | if 0, region is unknown, otherwise known and this input |
Type | Name | Description |
---|---|---|
Velocity | v_sound | speed of sound [m/s] |
function velocityOfSound_pT "speed of sound as function of pressure and temperature" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.Temperature T "temperature"; input Integer region = 0 "if 0, region is unknown, otherwise known and this input"; output SI.Velocity v_sound "speed of sound"; algorithm v_sound := velocityOfSound_props_pT(p, T, waterBaseProp_pT(p, T, region)); end velocityOfSound_pT;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
Temperature | T | temperature [K] | |
IF97BaseTwoPhase | aux | auxiliary record |
Type | Name | Description |
---|---|---|
Real | gamma | isentropic exponent |
function isentropicExponent_props_pT "isentropic exponent as function of pressure and temperature" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.Temperature T "temperature"; input Common.IF97BaseTwoPhase aux "auxiliary record"; output Real gamma "isentropic exponent"; algorithm gamma := if aux.region == 3 then 1/(aux.rho*p)*((aux.pd*aux.cv*aux.rho*aux.rho + aux.pt*aux.pt*aux.T)/(aux.cv)) else -1/(aux.rho*aux.p)*aux.cp/(aux.vp*aux.cp + aux.vt*aux.vt*aux.T);end isentropicExponent_props_pT;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
Temperature | T | temperature [K] | |
Integer | region | 0 | if 0, region is unknown, otherwise known and this input |
Type | Name | Description |
---|---|---|
Real | gamma | isentropic exponent |
function isentropicExponent_pT "isentropic exponent as function of pressure and temperature" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.Temperature T "temperature"; input Integer region = 0 "if 0, region is unknown, otherwise known and this input"; output Real gamma "isentropic exponent"; algorithm gamma := isentropicExponent_props_pT(p, T, waterBaseProp_pT(p, T, region));end isentropicExponent_pT;
Type | Name | Default | Description |
---|---|---|---|
Density | rho | density [kg/m3] | |
Temperature | T | temperature [K] | |
Integer | phase | 0 | phase: 2 for two-phase, 1 for one phase, 0 if unknown |
Integer | region | 0 | if 0, do region computation, otherwise assume the region is this input |
Type | Name | Description |
---|---|---|
IF97BaseTwoPhase | aux | auxiliary record |
function waterBaseProp_dT "intermediate property record for water (d and T prefered states)" extends Modelica.Icons.Function; input SI.Density rho "density"; input SI.Temperature T "temperature"; input Integer phase = 0 "phase: 2 for two-phase, 1 for one phase, 0 if unknown"; input Integer region = 0 "if 0, do region computation, otherwise assume the region is this input"; output Common.IF97BaseTwoPhase aux "auxiliary record"; protected SI.SpecificEnthalpy h_liq "liquid specific enthalpy"; SI.Density d_liq "liquid density"; SI.SpecificEnthalpy h_vap "vapour specific enthalpy"; SI.Density d_vap "vapour density"; Common.GibbsDerivs g "dimensionless Gibbs funcion and dervatives w.r.t. pi and tau"; Common.HelmholtzDerivs f "dimensionless Helmholtz funcion and dervatives w.r.t. delta and tau"; Modelica.Media.Common.PhaseBoundaryProperties liq "phase boundary property record"; Modelica.Media.Common.PhaseBoundaryProperties vap "phase boundary property record"; Modelica.Media.Common.GibbsDerivs gl "dimensionless Gibbs funcion and dervatives w.r.t. pi and tau"; Modelica.Media.Common.GibbsDerivs gv "dimensionless Gibbs funcion and dervatives w.r.t. pi and tau"; Modelica.Media.Common.HelmholtzDerivs fl "dimensionless Helmholtz function and dervatives w.r.t. delta and tau"; Modelica.Media.Common.HelmholtzDerivs fv "dimensionless Helmholtz function and dervatives w.r.t. delta and tau"; Integer error "error flag for inverse iterations"; algorithm aux.region := if region == 0 then (if phase == 2 then 4 else BaseIF97.Regions.region_dT(d=rho,T= T,phase= phase)) else region; aux.phase := if aux.region == 4 then 2 else 1; aux.R := BaseIF97.data.RH2O; aux.rho := rho; aux.T := T; if (aux.region == 1) then (aux.p,error) := BaseIF97.Inverses.pofdt125(d=rho,T= T,reldd= 1.0e-8,region= 1); g := BaseIF97.Basic.g1(aux.p, T); aux.h := aux.R*aux.T*g.tau*g.gtau; aux.s := aux.R*(g.tau*g.gtau - g.g); aux.rho := aux.p/(aux.R*T*g.pi*g.gpi); aux.vt := aux.R/aux.p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi); aux.vp := aux.R*T/(aux.p*aux.p)*g.pi*g.pi*g.gpipi; aux.cp := -aux.R*g.tau*g.tau*g.gtautau; aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/g.gpipi)); aux.x := 0.0; elseif (aux.region == 2) then (aux.p,error) := BaseIF97.Inverses.pofdt125(d=rho,T= T,reldd= 1.0e-8,region= 2); g := BaseIF97.Basic.g2(aux.p, T); aux.h := aux.R*aux.T*g.tau*g.gtau; aux.s := aux.R*(g.tau*g.gtau - g.g); aux.rho := aux.p/(aux.R*T*g.pi*g.gpi); aux.vt := aux.R/aux.p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi); aux.vp := aux.R*T/(aux.p*aux.p)*g.pi*g.pi*g.gpipi; aux.cp := -aux.R*g.tau*g.tau*g.gtautau; aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/g.gpipi)); aux.x := 1.0; elseif (aux.region == 3) then f := BaseIF97.Basic.f3(rho, T); aux.p := aux.R*rho*T*f.delta*f.fdelta; aux.h := aux.R*T*(f.tau*f.ftau + f.delta*f.fdelta); aux.s := aux.R*(f.tau*f.ftau - f.f); aux.pd := aux.R*T*f.delta*(2.0*f.fdelta + f.delta*f.fdeltadelta); aux.pt := aux.R*rho*f.delta*(f.fdelta - f.tau*f.fdeltatau); aux.cp := (aux.rho*aux.rho*aux.pd*aux.cv + aux.T*aux.pt*aux.pt)/(aux.rho*aux.rho*aux.pd); aux.cv := aux.R*(-f.tau*f.tau*f.ftautau); aux.x := 0.0; elseif (aux.region == 4) then aux.p := BaseIF97.Basic.psat(T); d_liq := rhol_T(T); d_vap := rhov_T(T); h_liq := hl_p(aux.p); h_vap := hv_p(aux.p); aux.x := if (d_vap <> d_liq) then (1/rho - 1/d_liq)/(1/d_vap - 1/d_liq) else 1.0; aux.h := h_liq + aux.x*(h_vap - h_liq); if T < BaseIF97.data.TLIMIT1 then gl := BaseIF97.Basic.g1(aux.p, T); gv := BaseIF97.Basic.g2(aux.p, T); liq := Common.gibbsToBoundaryProps(gl); vap := Common.gibbsToBoundaryProps(gv); else fl := BaseIF97.Basic.f3(d_liq, T); fv := BaseIF97.Basic.f3(d_vap, T); liq := Common.helmholtzToBoundaryProps(fl); vap := Common.helmholtzToBoundaryProps(fv); end if; aux.dpT := if (liq.d <> vap.d) then (vap.s - liq.s)*liq.d*vap.d/(liq.d - vap.d) else BaseIF97.Basic.dptofT(aux.T); aux.s := liq.s + aux.x*(vap.s - liq.s); aux.cv := Common.cv2Phase(liq, vap, aux.x, aux.T, aux.p); aux.cp := liq.cp + aux.x*(vap.cp - liq.cp); aux.pt := liq.pt + aux.x*(vap.pt - liq.pt); aux.pd := liq.pd + aux.x*(vap.pd - liq.pd); elseif (aux.region == 5) then (aux.p,error) := BaseIF97.Inverses.pofdt125(d=rho,T= T,reldd= 1.0e-8,region=5); g := BaseIF97.Basic.g2(aux.p, T); aux.h := aux.R*aux.T*g.tau*g.gtau; aux.s := aux.R*(g.tau*g.gtau - g.g); aux.rho := aux.p/(aux.R*T*g.pi*g.gpi); aux.vt := aux.R/aux.p*(g.pi*g.gpi - g.tau*g.pi*g.gtaupi); aux.vp := aux.R*T/(aux.p*aux.p)*g.pi*g.pi*g.gpipi; aux.cp := -aux.R*g.tau*g.tau*g.gtautau; aux.cv := aux.R*(-g.tau*g.tau*g.gtautau + ((g.gpi - g.tau*g.gtaupi)*(g.gpi - g.tau*g.gtaupi)/g.gpipi)); else assert(false, "error in region computation of IF97 steam tables" + "(rho = " + String(rho) + ", T = " + String(T) + ")"); end if; end waterBaseProp_dT;
Type | Name | Default | Description |
---|---|---|---|
Density | d | density [kg/m3] | |
Temperature | T | Temperature [K] | |
IF97BaseTwoPhase | aux | auxiliary record |
Type | Name | Description |
---|---|---|
SpecificEnthalpy | h | specific enthalpy [J/kg] |
function h_props_dT "specific enthalpy as function of density and temperature" annotation(derivative=h_dT_der); extends Modelica.Icons.Function; input SI.Density d "density"; input SI.Temperature T "Temperature"; input Common.IF97BaseTwoPhase aux "auxiliary record"; output SI.SpecificEnthalpy h "specific enthalpy"; algorithm h := aux.h;end h_props_dT;
Type | Name | Default | Description |
---|---|---|---|
Density | d | density [kg/m3] | |
Temperature | T | Temperature [K] | |
Integer | phase | 0 | 2 for two-phase, 1 for one-phase, 0 if not known |
Integer | region | 0 | if 0, region is unknown, otherwise known and this input |
Type | Name | Description |
---|---|---|
SpecificEnthalpy | h | specific enthalpy [J/kg] |
function h_dT "specific enthalpy as function of density and temperature" extends Modelica.Icons.Function; input SI.Density d "density"; input SI.Temperature T "Temperature"; input Integer phase = 0 "2 for two-phase, 1 for one-phase, 0 if not known"; input Integer region = 0 "if 0, region is unknown, otherwise known and this input"; output SI.SpecificEnthalpy h "specific enthalpy"; algorithm h := h_props_dT(d, T, waterBaseProp_dT(d, T, phase, region)); end h_dT;
Type | Name | Default | Description |
---|---|---|---|
Density | d | density [kg/m3] | |
Temperature | T | temperature [K] | |
IF97BaseTwoPhase | aux | auxiliary record | |
Real | d_der | derivative of density | |
Real | T_der | derivative of temperature |
Type | Name | Description |
---|---|---|
Real | h_der | derivative of specific enthalpy |
function h_dT_der "derivative function of h_dT" extends Modelica.Icons.Function; input SI.Density d "density"; input SI.Temperature T "temperature"; input Common.IF97BaseTwoPhase aux "auxiliary record"; input Real d_der "derivative of density"; input Real T_der "derivative of temperature"; output Real h_der "derivative of specific enthalpy"; algorithm if (aux.region == 3) then h_der := ((-d*aux.pd + T*aux.pt)/(d*d))*d_der + ((aux.cv*d + aux.pt)/d)* T_der; elseif (aux.region == 4) then h_der := T*aux.dpT/(d*d)*d_der + ((aux.cv*d + aux.dpT)/d)*T_der; else //regions 1,2 or 5 h_der := (-(-1/d + T*aux.vt)/(d*d*aux.vp))*d_der + ((aux.vp*aux.cp - aux. vt/d + T*aux.vt*aux.vt)/aux.vp)*T_der; end if; end h_dT_der;
Type | Name | Default | Description |
---|---|---|---|
Density | d | density [kg/m3] | |
Temperature | T | Temperature [K] | |
IF97BaseTwoPhase | aux | auxiliary record |
Type | Name | Description |
---|---|---|
Pressure | p | pressure [Pa] |
function p_props_dT "pressure as function of density and temperature" annotation(derivative=p_dT_der); extends Modelica.Icons.Function; input SI.Density d "density"; input SI.Temperature T "Temperature"; input Common.IF97BaseTwoPhase aux "auxiliary record"; output SI.Pressure p "pressure"; algorithm p := aux.p;end p_props_dT;
Type | Name | Default | Description |
---|---|---|---|
Density | d | density [kg/m3] | |
Temperature | T | Temperature [K] | |
Integer | phase | 0 | 2 for two-phase, 1 for one-phase, 0 if not known |
Integer | region | 0 | if 0, region is unknown, otherwise known and this input |
Type | Name | Description |
---|---|---|
Pressure | p | pressure [Pa] |
function p_dT "pressure as function of density and temperature" extends Modelica.Icons.Function; input SI.Density d "density"; input SI.Temperature T "Temperature"; input Integer phase = 0 "2 for two-phase, 1 for one-phase, 0 if not known"; input Integer region = 0 "if 0, region is unknown, otherwise known and this input"; output SI.Pressure p "pressure"; algorithm p := p_props_dT(d, T, waterBaseProp_dT(d, T, phase, region)); end p_dT;
Type | Name | Default | Description |
---|---|---|---|
Density | d | density [kg/m3] | |
Temperature | T | temperature [K] | |
IF97BaseTwoPhase | aux | auxiliary record | |
Real | d_der | derivative of density | |
Real | T_der | derivative of temperature |
Type | Name | Description |
---|---|---|
Real | p_der | derivative of pressure |
function p_dT_der "derivative function of p_dT" extends Modelica.Icons.Function; input SI.Density d "density"; input SI.Temperature T "temperature"; input Common.IF97BaseTwoPhase aux "auxiliary record"; input Real d_der "derivative of density"; input Real T_der "derivative of temperature"; output Real p_der "derivative of pressure"; algorithm if (aux.region == 3) then p_der := aux.pd*d_der + aux.pt*T_der; elseif (aux.region == 4) then p_der := aux.dpT*T_der; /*density derivative is 0.0*/ else //regions 1,2 or 5 p_der := (-1/(d*d*aux.vp))*d_der + (-aux.vt/aux.vp)*T_der; end if; end p_dT_der;
Type | Name | Default | Description |
---|---|---|---|
Density | d | density [kg/m3] | |
Temperature | T | Temperature [K] | |
IF97BaseTwoPhase | aux | auxiliary record |
Type | Name | Description |
---|---|---|
SpecificEntropy | s | specific entropy [J/(kg.K)] |
function s_props_dT "specific entropy as function of density and temperature" extends Modelica.Icons.Function; input SI.Density d "density"; input SI.Temperature T "Temperature"; input Common.IF97BaseTwoPhase aux "auxiliary record"; output SI.SpecificEntropy s "specific entropy"; algorithm s := aux.s;end s_props_dT;
Type | Name | Default | Description |
---|---|---|---|
Density | d | density [kg/m3] | |
Temperature | T | Temperature [K] | |
Integer | phase | 0 | 2 for two-phase, 1 for one-phase, 0 if not known |
Integer | region | 0 | if 0, region is unknown, otherwise known and this input |
Type | Name | Description |
---|---|---|
SpecificEntropy | s | specific entropy [J/(kg.K)] |
function s_dT "temperature as function of density and temperature" extends Modelica.Icons.Function; input SI.Density d "density"; input SI.Temperature T "Temperature"; input Integer phase = 0 "2 for two-phase, 1 for one-phase, 0 if not known"; input Integer region = 0 "if 0, region is unknown, otherwise known and this input"; output SI.SpecificEntropy s "specific entropy"; algorithm s := s_props_dT(d, T, waterBaseProp_dT(d, T, phase, region)); end s_dT;
Type | Name | Default | Description |
---|---|---|---|
Density | d | density [kg/m3] | |
Temperature | T | temperature [K] | |
IF97BaseTwoPhase | aux | auxiliary record |
Type | Name | Description |
---|---|---|
SpecificHeatCapacity | cv | specific heat capacity [J/(kg.K)] |
function cv_props_dT "specific heat capacity at constant volume as function of density and temperature" extends Modelica.Icons.Function; input SI.Density d "density"; input SI.Temperature T "temperature"; input Common.IF97BaseTwoPhase aux "auxiliary record"; output SI.SpecificHeatCapacity cv "specific heat capacity"; algorithm cv := aux.cv;end cv_props_dT;
Type | Name | Default | Description |
---|---|---|---|
Density | d | density [kg/m3] | |
Temperature | T | temperature [K] | |
Integer | phase | 0 | 2 for two-phase, 1 for one-phase, 0 if not known |
Integer | region | 0 | if 0, region is unknown, otherwise known and this input |
Type | Name | Description |
---|---|---|
SpecificHeatCapacity | cv | specific heat capacity [J/(kg.K)] |
function cv_dT "specific heat capacity at constant volume as function of density and temperature" extends Modelica.Icons.Function; input SI.Density d "density"; input SI.Temperature T "temperature"; input Integer phase = 0 "2 for two-phase, 1 for one-phase, 0 if not known"; input Integer region = 0 "if 0, region is unknown, otherwise known and this input"; output SI.SpecificHeatCapacity cv "specific heat capacity"; algorithm cv := cv_props_dT(d, T, waterBaseProp_dT(d, T, phase, region)); end cv_dT;
Type | Name | Default | Description |
---|---|---|---|
Density | d | density [kg/m3] | |
Temperature | T | temperature [K] | |
IF97BaseTwoPhase | aux | auxiliary record |
Type | Name | Description |
---|---|---|
SpecificHeatCapacity | cp | specific heat capacity [J/(kg.K)] |
function cp_props_dT "specific heat capacity at constant pressure as function of density and temperature" extends Modelica.Icons.Function; input SI.Density d "density"; input SI.Temperature T "temperature"; input Common.IF97BaseTwoPhase aux "auxiliary record"; output SI.SpecificHeatCapacity cp "specific heat capacity"; algorithm cp := aux.cp;end cp_props_dT;
Type | Name | Default | Description |
---|---|---|---|
Density | d | density [kg/m3] | |
Temperature | T | temperature [K] | |
Integer | phase | 0 | 2 for two-phase, 1 for one-phase, 0 if not known |
Integer | region | 0 | if 0, region is unknown, otherwise known and this input |
Type | Name | Description |
---|---|---|
SpecificHeatCapacity | cp | specific heat capacity [J/(kg.K)] |
function cp_dT "specific heat capacity at constant pressure as function of density and temperature" extends Modelica.Icons.Function; input SI.Density d "density"; input SI.Temperature T "temperature"; input Integer phase = 0 "2 for two-phase, 1 for one-phase, 0 if not known"; input Integer region = 0 "if 0, region is unknown, otherwise known and this input"; output SI.SpecificHeatCapacity cp "specific heat capacity"; algorithm cp := cp_props_dT(d, T, waterBaseProp_dT(d, T, phase, region)); end cp_dT;
Type | Name | Default | Description |
---|---|---|---|
Density | d | density [kg/m3] | |
Temperature | T | temperature [K] | |
IF97BaseTwoPhase | aux | auxiliary record |
Type | Name | Description |
---|---|---|
RelativePressureCoefficient | beta | isobaric expansion coefficient [1/K] |
function beta_props_dT "isobaric expansion coefficient as function of density and temperature" extends Modelica.Icons.Function; input SI.Density d "density"; input SI.Temperature T "temperature"; input Common.IF97BaseTwoPhase aux "auxiliary record"; output SI.RelativePressureCoefficient beta "isobaric expansion coefficient"; algorithm beta := if aux.region == 3 or aux.region == 4 then aux.pt/(aux.rho*aux.pd) else aux.vt*aux.rho;end beta_props_dT;
Type | Name | Default | Description |
---|---|---|---|
Density | d | density [kg/m3] | |
Temperature | T | temperature [K] | |
Integer | phase | 0 | 2 for two-phase, 1 for one-phase, 0 if not known |
Integer | region | 0 | if 0, region is unknown, otherwise known and this input |
Type | Name | Description |
---|---|---|
RelativePressureCoefficient | beta | isobaric expansion coefficient [1/K] |
function beta_dT "isobaric expansion coefficient as function of density and temperature" extends Modelica.Icons.Function; input SI.Density d "density"; input SI.Temperature T "temperature"; input Integer phase = 0 "2 for two-phase, 1 for one-phase, 0 if not known"; input Integer region = 0 "if 0, region is unknown, otherwise known and this input"; output SI.RelativePressureCoefficient beta "isobaric expansion coefficient"; algorithm beta := beta_props_dT(d, T, waterBaseProp_dT(d, T, phase, region)); end beta_dT;
Type | Name | Default | Description |
---|---|---|---|
Density | d | density [kg/m3] | |
Temperature | T | temperature [K] | |
IF97BaseTwoPhase | aux | auxiliary record |
Type | Name | Description |
---|---|---|
IsothermalCompressibility | kappa | isothermal compressibility factor [1/Pa] |
function kappa_props_dT "isothermal compressibility factor as function of density and temperature" extends Modelica.Icons.Function; input SI.Density d "density"; input SI.Temperature T "temperature"; input Common.IF97BaseTwoPhase aux "auxiliary record"; output SI.IsothermalCompressibility kappa "isothermal compressibility factor"; algorithm kappa := if aux.region == 3 or aux.region == 4 then 1/(aux.rho*aux.pd) else -aux.vp*aux.rho;end kappa_props_dT;
Type | Name | Default | Description |
---|---|---|---|
Density | d | density [kg/m3] | |
Temperature | T | temperature [K] | |
Integer | phase | 0 | 2 for two-phase, 1 for one-phase, 0 if not known |
Integer | region | 0 | if 0, region is unknown, otherwise known and this input |
Type | Name | Description |
---|---|---|
IsothermalCompressibility | kappa | isothermal compressibility factor [1/Pa] |
function kappa_dT "isothermal compressibility factor as function of density and temperature" extends Modelica.Icons.Function; input SI.Density d "density"; input SI.Temperature T "temperature"; input Integer phase = 0 "2 for two-phase, 1 for one-phase, 0 if not known"; input Integer region = 0 "if 0, region is unknown, otherwise known and this input"; output SI.IsothermalCompressibility kappa "isothermal compressibility factor"; algorithm kappa := kappa_props_dT(d, T, waterBaseProp_dT(d, T, phase, region)); end kappa_dT;
Type | Name | Default | Description |
---|---|---|---|
Density | d | density [kg/m3] | |
Temperature | T | temperature [K] | |
IF97BaseTwoPhase | aux | auxiliary record |
Type | Name | Description |
---|---|---|
Velocity | v_sound | speed of sound [m/s] |
function velocityOfSound_props_dT "speed of sound as function of density and temperature" extends Modelica.Icons.Function; input SI.Density d "density"; input SI.Temperature T "temperature"; input Common.IF97BaseTwoPhase aux "auxiliary record"; output SI.Velocity v_sound "speed of sound"; algorithm // dp/drho at constant s v_sound := if aux.region == 3 then sqrt(max(0,((aux.pd*aux.rho*aux.rho*aux.cv + aux.pt*aux.pt*aux.T)/(aux.rho*aux.rho*aux.cv)))) else if aux.region == 4 then sqrt(max(0,1/((aux.rho*(aux.rho*aux.cv/aux.dpT + 1.0)/(aux.dpT*aux.T)) - 1/aux.rho*aux.rho*aux.rho/(aux.dpT*aux.T)))) else sqrt(max(0,-aux.cp/(aux.rho*aux.rho*(aux.vp*aux.cp+aux.vt*aux.vt*aux.T))));end velocityOfSound_props_dT;
Type | Name | Default | Description |
---|---|---|---|
Density | d | density [kg/m3] | |
Temperature | T | temperature [K] | |
Integer | phase | 0 | 2 for two-phase, 1 for one-phase, 0 if not known |
Integer | region | 0 | if 0, region is unknown, otherwise known and this input |
Type | Name | Description |
---|---|---|
Velocity | v_sound | speed of sound [m/s] |
function velocityOfSound_dT "speed of sound as function of density and temperature" extends Modelica.Icons.Function; input SI.Density d "density"; input SI.Temperature T "temperature"; input Integer phase = 0 "2 for two-phase, 1 for one-phase, 0 if not known"; input Integer region = 0 "if 0, region is unknown, otherwise known and this input"; output SI.Velocity v_sound "speed of sound"; algorithm v_sound := velocityOfSound_props_dT(d, T, waterBaseProp_dT(d, T, phase, region)); end velocityOfSound_dT;
Type | Name | Default | Description |
---|---|---|---|
Density | d | density [kg/m3] | |
Temperature | T | temperature [K] | |
IF97BaseTwoPhase | aux | auxiliary record |
Type | Name | Description |
---|---|---|
Real | gamma | isentropic exponent |
function isentropicExponent_props_dT "isentropic exponent as function of density and temperature" extends Modelica.Icons.Function; input SI.Density d "density"; input SI.Temperature T "temperature"; input Common.IF97BaseTwoPhase aux "auxiliary record"; output Real gamma "isentropic exponent"; algorithm gamma := if aux.region == 3 then 1/(aux.rho*aux.p)*((aux.pd*aux.cv*aux.rho*aux.rho + aux.pt*aux.pt*aux.T)/(aux.cv)) else if aux.region == 4 then 1/(aux.rho*aux.p)*aux.dpT*aux.dpT*aux.T/aux.cv else -1/(aux.rho*aux.p)*aux.cp/(aux.vp*aux.cp + aux.vt*aux.vt*aux.T);end isentropicExponent_props_dT;
Type | Name | Default | Description |
---|---|---|---|
Density | d | density [kg/m3] | |
Temperature | T | temperature [K] | |
Integer | phase | 0 | 2 for two-phase, 1 for one-phase, 0 if not known |
Integer | region | 0 | if 0, region is unknown, otherwise known and this input |
Type | Name | Description |
---|---|---|
Real | gamma | isentropic exponent |
function isentropicExponent_dT "isentropic exponent as function of density and temperature" extends Modelica.Icons.Function; input SI.Density d "density"; input SI.Temperature T "temperature"; input Integer phase = 0 "2 for two-phase, 1 for one-phase, 0 if not known"; input Integer region = 0 "if 0, region is unknown, otherwise known and this input"; output Real gamma "isentropic exponent"; algorithm gamma := isentropicExponent_props_dT(d, T, waterBaseProp_dT(d, T, phase, region));end isentropicExponent_dT;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] |
Type | Name | Description |
---|---|---|
SpecificEnthalpy | h | specific enthalpy [J/kg] |
function hl_p = BaseIF97.Regions.hl_p "compute the saturated liquid specific h(p)";
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] |
Type | Name | Description |
---|---|---|
SpecificEnthalpy | h | specific enthalpy [J/kg] |
function hv_p = BaseIF97.Regions.hv_p "compute the saturated vapour specific h(p)";
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] |
Type | Name | Description |
---|---|---|
SpecificEntropy | s | specific entropy [J/(kg.K)] |
function sl_p = BaseIF97.Regions.sl_p "compute the saturated liquid specific s(p)";
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] |
Type | Name | Description |
---|---|---|
SpecificEntropy | s | specific entropy [J/(kg.K)] |
function sv_p = BaseIF97.Regions.sv_p "compute the saturated vapour specific s(p)";
Type | Name | Default | Description |
---|---|---|---|
Temperature | T | temperature [K] |
Type | Name | Description |
---|---|---|
Density | d | density of water at the boiling point [kg/m3] |
function rhol_T = BaseIF97.Regions.rhol_T "compute the saturated liquid d(T)";
Type | Name | Default | Description |
---|---|---|---|
Temperature | T | temperature [K] |
Type | Name | Description |
---|---|---|
Density | d | density of steam at the condensation point [kg/m3] |
function rhov_T = BaseIF97.Regions.rhov_T "compute the saturated vapour d(T)";
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | saturation pressure [Pa] |
Type | Name | Description |
---|---|---|
Density | rho | density of steam at the condensation point [kg/m3] |
function rhol_p = BaseIF97.Regions.rhol_p "compute the saturated liquid d(p)";
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | saturation pressure [Pa] |
Type | Name | Description |
---|---|---|
Density | rho | density of steam at the condensation point [kg/m3] |
function rhov_p = BaseIF97.Regions.rhov_p "compute the saturated vapour d(p)";
Type | Name | Default | Description |
---|---|---|---|
Density | d | density [kg/m3] | |
Temperature | T | temperature (K) [K] | |
Pressure | p | pressure (only needed for region of validity) [Pa] | |
Integer | phase | 0 | 2 for two-phase, 1 for one-phase, 0 if not known |
Type | Name | Description |
---|---|---|
DynamicViscosity | eta | dynamic viscosity [Pa.s] |
function dynamicViscosity = BaseIF97.Transport.visc_dTp "compute eta(d,T) in the one-phase region";
Type | Name | Default | Description |
---|---|---|---|
Density | d | density [kg/m3] | |
Temperature | T | temperature (K) [K] | |
Pressure | p | pressure [Pa] | |
Integer | phase | 0 | 2 for two-phase, 1 for one-phase, 0 if not known |
Boolean | industrialMethod | true | if true, the industrial method is used, otherwise the scientific one |
Type | Name | Description |
---|---|---|
ThermalConductivity | lambda | thermal conductivity [W/(m.K)] |
function thermalConductivity = BaseIF97.Transport.cond_dTp "compute lambda(d,T,p) in the one-phase region";
Type | Name | Default | Description |
---|---|---|---|
Temperature | T | temperature (K) [K] |
Type | Name | Description |
---|---|---|
SurfaceTension | sigma | surface tension in SI units [N/m] |
function surfaceTension = BaseIF97.Transport.surfaceTension "compute sigma(T) at saturation T";
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
SpecificEntropy | s | specific entropy [J/(kg.K)] | |
Integer | phase | 0 | 2 for two-phase, 1 for one-phase, 0 if not known |
Integer | region | 0 | if 0, region is unknown, otherwise known and this input |
Type | Name | Description |
---|---|---|
SpecificEnthalpy | h | specific enthalpy [J/kg] |
function isentropicEnthalpy "isentropic specific enthalpy from p,s (preferably use dynamicIsentropicEnthalpy in dynamic simulation!)" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.SpecificEntropy s "specific entropy"; input Integer phase = 0 "2 for two-phase, 1 for one-phase, 0 if not known"; input Integer region = 0 "if 0, region is unknown, otherwise known and this input"; output SI.SpecificEnthalpy h "specific enthalpy"; algorithm h := isentropicEnthalpy_props(p, s, waterBaseProp_ps(p, s, phase, region)); end isentropicEnthalpy;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
SpecificEntropy | s | specific entropy [J/(kg.K)] | |
IF97BaseTwoPhase | aux | auxiliary record |
Type | Name | Description |
---|---|---|
SpecificEnthalpy | h | isentropic enthalpay [J/kg] |
function isentropicEnthalpy_props annotation(derivative=isentropicEnthalpy_der); extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.SpecificEntropy s "specific entropy"; input Common.IF97BaseTwoPhase aux "auxiliary record"; output SI.SpecificEnthalpy h "isentropic enthalpay"; algorithm h := aux.h;end isentropicEnthalpy_props;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
SpecificEntropy | s | specific entropy [J/(kg.K)] | |
IF97BaseTwoPhase | aux | auxiliary record | |
Real | p_der | pressure derivative | |
Real | s_der | entropy derivative |
Type | Name | Description |
---|---|---|
Real | h_der | specific enthalpy derivative |
function isentropicEnthalpy_der "derivative of isentropic specific enthalpy from p,s" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.SpecificEntropy s "specific entropy"; input Common.IF97BaseTwoPhase aux "auxiliary record"; input Real p_der "pressure derivative"; input Real s_der "entropy derivative"; output Real h_der "specific enthalpy derivative"; algorithm h_der := 1/aux.rho*p_der + aux.T*s_der; end isentropicEnthalpy_der;
Type | Name | Default | Description |
---|---|---|---|
Pressure | p | pressure [Pa] | |
SpecificEntropy | s | specific entropy [J/(kg.K)] | |
Density | dguess | good guess density, e.g., from adjacent volume [kg/m3] | |
Temperature | Tguess | good guess temperature, e.g., from adjacent volume [K] | |
Integer | phase | 0 | 2 for two-phase, 1 for one-phase, 0 if not known |
Type | Name | Description |
---|---|---|
SpecificEnthalpy | h | specific enthalpy [J/kg] |
function dynamicIsentropicEnthalpy "isentropic specific enthalpy from p,s and good guesses of d and T" extends Modelica.Icons.Function; input SI.Pressure p "pressure"; input SI.SpecificEntropy s "specific entropy"; input SI.Density dguess "good guess density, e.g., from adjacent volume"; input SI.Temperature Tguess "good guess temperature, e.g., from adjacent volume"; input Integer phase = 0 "2 for two-phase, 1 for one-phase, 0 if not known"; output SI.SpecificEnthalpy h "specific enthalpy"; algorithm h := BaseIF97.Isentropic.water_hisentropic_dyn(p,s,dguess,Tguess,0); end dynamicIsentropicEnthalpy;