Modelica.Media.Water.IF97_Utilities.BaseIF97.TwoPhase

steam properties in the two-phase rgion and on the phase boundaries

Information

Package description

Package TwoPhase provides functions to compute the steam properties in the two-phase region and on the phase boundaries

Package contents

Version Info and Revision history

Author: Hubertus Tummescheit,
Modelon AB
Ideon Science Park
SE-22370 Lund, Sweden
email: hubertus@modelon.se

Extends from Modelica.Icons.Library (Icon for library).

Package Content

NameDescription
Modelica.Media.Water.IF97_Utilities.BaseIF97.TwoPhase.waterLiq_p waterLiq_p properties on the liquid phase boundary of region 4
Modelica.Media.Water.IF97_Utilities.BaseIF97.TwoPhase.waterVap_p waterVap_p properties on the vapour phase boundary of region 4
Modelica.Media.Water.IF97_Utilities.BaseIF97.TwoPhase.waterSat_ph waterSat_ph Water saturation properties in the 2-phase region (4) as f(p,h)
Modelica.Media.Water.IF97_Utilities.BaseIF97.TwoPhase.waterR4_ph waterR4_ph Water/Steam properties in region 4 of IAPWS/IF97 (two-phase)
Modelica.Media.Water.IF97_Utilities.BaseIF97.TwoPhase.waterR4_dT waterR4_dT Water properties in region 4 as function of d and T


Modelica.Media.Water.IF97_Utilities.BaseIF97.TwoPhase.waterLiq_p Modelica.Media.Water.IF97_Utilities.BaseIF97.TwoPhase.waterLiq_p

properties on the liquid phase boundary of region 4

Information

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

Inputs

TypeNameDefaultDescription
Pressurep pressure [Pa]

Outputs

TypeNameDescription
PhaseBoundaryPropertiesliqliquid thermodynamic property collection

Modelica definition

function waterLiq_p 
  "properties on the liquid phase boundary of region 4"

  extends Modelica.Icons.Function;
  input SI.Pressure p "pressure";
  output Modelica.Media.Common.PhaseBoundaryProperties liq 
    "liquid thermodynamic property collection";
protected 
  SI.Temperature Tsat "saturation temperature";
  Real dpT "derivative of saturation pressure wrt temperature";
  SI.Density dl "liquid density";
  Modelica.Media.Common.GibbsDerivs g 
    "dimensionless Gibbs funcion and dervatives wrt pi and tau";
  Modelica.Media.Common.HelmholtzDerivs f 
    "dimensionless Helmholtz function and dervatives wrt delta and tau";
algorithm 
  Tsat := Basic.tsat(p);
  dpT := Basic.dptofT(Tsat);
  if p < data.PLIMIT4A then
    g := Basic.g1(p, Tsat);
    liq := Modelica.Media.Common.gibbsToBoundaryProps(g);
  else
    dl := Regions.rhol_p_R4b(p);
    f := Basic.f3(dl, Tsat);
    liq := Modelica.Media.Common.helmholtzToBoundaryProps(f);
  end if;
end waterLiq_p;

Modelica.Media.Water.IF97_Utilities.BaseIF97.TwoPhase.waterVap_p Modelica.Media.Water.IF97_Utilities.BaseIF97.TwoPhase.waterVap_p

properties on the vapour phase boundary of region 4

Information

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

Inputs

TypeNameDefaultDescription
Pressurep pressure [Pa]

Outputs

TypeNameDescription
PhaseBoundaryPropertiesvapvapour thermodynamic property collection

Modelica definition

function waterVap_p 
  "properties on the vapour phase boundary of region 4"

  extends Modelica.Icons.Function;
  input SI.Pressure p "pressure";
  output Modelica.Media.Common.PhaseBoundaryProperties vap 
    "vapour thermodynamic property collection";
protected 
  SI.Temperature Tsat "saturation temperature";
  Real dpT "derivative of saturation pressure wrt temperature";
  SI.Density dv "vapour density";
  Modelica.Media.Common.GibbsDerivs g 
    "dimensionless Gibbs funcion and dervatives wrt pi and tau";
  Modelica.Media.Common.HelmholtzDerivs f 
    "dimensionless Helmholtz function and dervatives wrt delta and tau";
algorithm 
  Tsat := Basic.tsat(p);
  dpT := Basic.dptofT(Tsat);
  if p < data.PLIMIT4A then
    g := Basic.g2(p, Tsat);
    vap := Modelica.Media.Common.gibbsToBoundaryProps(g);
  else
    dv := Regions.rhov_p_R4b(p);
    f := Basic.f3(dv, Tsat);
    vap := Modelica.Media.Common.helmholtzToBoundaryProps(f);
  end if;
end waterVap_p;

Modelica.Media.Water.IF97_Utilities.BaseIF97.TwoPhase.waterSat_ph Modelica.Media.Water.IF97_Utilities.BaseIF97.TwoPhase.waterSat_ph

Water saturation properties in the 2-phase region (4) as f(p,h)

Information

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

Inputs

TypeNameDefaultDescription
Pressurep pressure [Pa]
SpecificEnthalpyh specific enthalpy [J/kg]

Outputs

TypeNameDescription
SaturationPropertiesprothermodynamic property collection

Modelica definition

function waterSat_ph 
  "Water saturation properties in the 2-phase region (4) as f(p,h)"

  extends Modelica.Icons.Function;
  input SI.Pressure p "pressure";
  input SI.SpecificEnthalpy h "specific enthalpy";
  output Modelica.Media.Common.SaturationProperties pro 
    "thermodynamic property collection";
protected 
  SI.Density dl "liquid density";
  SI.Density dv "vapour density";
  Modelica.Media.Common.GibbsDerivs gl 
    "dimensionless Gibbs funcion and dervatives wrt pi and tau";
  Modelica.Media.Common.GibbsDerivs gv 
    "dimensionless Gibbs funcion and dervatives wrt pi and tau";
  Modelica.Media.Common.HelmholtzDerivs fl 
    "dimensionless Helmholtz function and dervatives wrt delta and tau";
  Modelica.Media.Common.HelmholtzDerivs fv 
    "dimensionless Helmholtz function and dervatives wrt delta and tau";
algorithm 
  pro.h := h;
  pro.p := p;
  pro.T := Basic.tsat(p);
  pro.dpT := Basic.dptofT(pro.T);
  if p < data.PLIMIT4A then
    gl := Basic.g1(p, pro.T);
    gv := Basic.g2(p, pro.T);
    pro.liq := Modelica.Media.Common.gibbsToBoundaryProps(gl);
    pro.vap := Modelica.Media.Common.gibbsToBoundaryProps(gv);
  else
    dl := Regions.rhol_p_R4b(p);
    dv := Regions.rhov_p_R4b(p);
    fl := Basic.f3(dl, pro.T);
    fv := Basic.f3(dv, pro.T);
    pro.liq := Modelica.Media.Common.helmholtzToBoundaryProps(fl);
    pro.vap := Modelica.Media.Common.helmholtzToBoundaryProps(fv);
  end if;
  pro.x := if (h < pro.liq.h) then 0.0 else if (pro.vap.h <> pro.liq.h) then 
          (h - pro.liq.h)/(pro.vap.h - pro.liq.h) else 1.0;
  pro.d := pro.liq.d*pro.vap.d/(pro.vap.d + pro.x*(pro.liq.d - pro.vap.d));
  pro.u := pro.x*pro.vap.u + (1 - pro.x)*pro.liq.u;
  pro.s := pro.x*pro.vap.s + (1 - pro.x)*pro.liq.s;
  pro.cp := Modelica.Constants.inf;
  pro.cv := Modelica.Media.Common.cv2Phase(pro.liq, pro.vap, pro.x, pro.T,
     p);
  pro.kappa := 1/(pro.d*p)*pro.dpT*pro.dpT*pro.T/pro.cv;
  pro.R := data.RH2O;
end waterSat_ph;

Modelica.Media.Water.IF97_Utilities.BaseIF97.TwoPhase.waterR4_ph Modelica.Media.Water.IF97_Utilities.BaseIF97.TwoPhase.waterR4_ph

Water/Steam properties in region 4 of IAPWS/IF97 (two-phase)

Information

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

Inputs

TypeNameDefaultDescription
Pressurep pressure [Pa]
SpecificEnthalpyh specific enthalpy [J/kg]

Outputs

TypeNameDescription
ThermoProperties_phprothermodynamic property collection

Modelica definition

function waterR4_ph 
  "Water/Steam properties in region 4 of IAPWS/IF97 (two-phase)"

  extends Modelica.Icons.Function;
  input SI.Pressure p "pressure";
  input SI.SpecificEnthalpy h "specific enthalpy";
  output Modelica.Media.Common.ThermoFluidSpecial.ThermoProperties_ph pro 
    "thermodynamic property collection";
protected 
  SI.Density dl "liquid density";
  SI.Density dv "vapour density";
  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 wrt pi and tau";
  Modelica.Media.Common.GibbsDerivs gv 
    "dimensionless Gibbs funcion and dervatives wrt pi and tau";
  Modelica.Media.Common.HelmholtzDerivs fl 
    "dimensionless Helmholtz function and dervatives wrt delta and tau";
  Modelica.Media.Common.HelmholtzDerivs fv 
    "dimensionless Helmholtz function and dervatives wrt delta and tau";
  Real x "dryness fraction";
  Real dpT "derivative of saturation curve";
algorithm 
  pro.T := Basic.tsat(p);
  dpT := Basic.dptofT(pro.T);
  dl := Regions.rhol_p_R4b(p);
  dv := Regions.rhov_p_R4b(p);
  if p < data.PLIMIT4A then
    gl := Basic.g1(p, pro.T);
    gv := Basic.g2(p, pro.T);
    liq := Modelica.Media.Common.gibbsToBoundaryProps(gl);
    vap := Modelica.Media.Common.gibbsToBoundaryProps(gv);
  else
    fl := Basic.f3(dl, pro.T);
    fv := Basic.f3(dv, pro.T);
    liq := Modelica.Media.Common.helmholtzToBoundaryProps(fl);
    vap := Modelica.Media.Common.helmholtzToBoundaryProps(fv);
  end if;
  x := if (vap.h <> liq.h) then (h - liq.h)/(vap.h - liq.h) else 1.0;
  pro.d := liq.d*vap.d/(vap.d + x*(liq.d - vap.d));
  pro.u := x*vap.u + (1 - x)*liq.u;
  pro.s := x*vap.s + (1 - x)*liq.s;
  pro.cp := Modelica.Constants.inf;
  pro.cv := Modelica.Media.Common.cv2Phase(liq, vap, x, pro.T, p);
  pro.kappa := 1/(pro.d*p)*dpT*dpT*pro.T/pro.cv;
  pro.a := Modelica.Constants.inf;
  pro.R := data.RH2O;
  pro.ddph := pro.d*(pro.d*pro.cv/dpT + 1.0)/(dpT*pro.T);
  pro.ddhp := -pro.d*pro.d/(dpT*pro.T);
end waterR4_ph;

Modelica.Media.Water.IF97_Utilities.BaseIF97.TwoPhase.waterR4_dT Modelica.Media.Water.IF97_Utilities.BaseIF97.TwoPhase.waterR4_dT

Water properties in region 4 as function of d and T

Information

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

Inputs

TypeNameDefaultDescription
Densityd Density [kg/m3]
TemperatureT temperature [K]

Outputs

TypeNameDescription
ThermoProperties_dTprothermodynamic property collection

Modelica definition

function waterR4_dT 
  "Water properties in region 4 as function of d and T"

  extends Modelica.Icons.Function;
  input SI.Density d "Density";
  input SI.Temperature T "temperature";
  output Modelica.Media.Common.ThermoFluidSpecial.ThermoProperties_dT pro 
    "thermodynamic property collection";
protected 
  SI.Density dl "liquid density";
  SI.Density dv "vapour density";
  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 wrt pi and tau";
  Modelica.Media.Common.GibbsDerivs gv 
    "dimensionless Gibbs funcion and dervatives wrt pi and tau";
  Modelica.Media.Common.HelmholtzDerivs fl 
    "dimensionless Helmholtz function and dervatives wrt delta and tau";
  Modelica.Media.Common.HelmholtzDerivs fv 
    "dimensionless Helmholtz function and dervatives wrt delta and tau";
  Real x "dryness fraction";
  Real dpT "derivative of saturation curve";
algorithm 
  pro.p := Basic.psat(T);
  dpT := Basic.dptofT(T);
  dl := Regions.rhol_p_R4b(pro.p);
  dv := Regions.rhov_p_R4b(pro.p);
  if pro.p < data.PLIMIT4A then
    gl := Basic.g1(pro.p, T);
    gv := Basic.g2(pro.p, T);
    liq := Modelica.Media.Common.gibbsToBoundaryProps(gl);
    vap := Modelica.Media.Common.gibbsToBoundaryProps(gv);
  else
    fl := Basic.f3(dl, T);
    fv := Basic.f3(dv, T);
    liq := Modelica.Media.Common.helmholtzToBoundaryProps(fl);
    vap := Modelica.Media.Common.helmholtzToBoundaryProps(fv);
  end if;
  x := if (vap.d <> liq.d) then (1/d - 1/liq.d)/(1/vap.d - 1/liq.d) else 
    1.0;
  pro.u := x*vap.u + (1 - x)*liq.u;
  pro.h := x*vap.h + (1 - x)*liq.h;
  pro.cp := Modelica.Constants.inf;
  pro.cv := Modelica.Media.Common.cv2Phase(liq, vap, x, T, pro.p);
  pro.kappa := 1/(d*pro.p)*dpT*dpT*T/pro.cv;
  pro.a := Modelica.Constants.inf;
  pro.R := data.RH2O;
  pro.dudT := (pro.p - T*dpT)/(d*d);
end waterR4_dT;

HTML-documentation generated by Dymola Sun Jan 17 21:12:36 2010.