Changeset 351

Show
Ignore:
Timestamp:
02/21/06 10:47:41 (3 years ago)
Author:
CRichter
Message:

changed Water to fit the new interface definition from the 47th Design Meeting, provided some alias functions in PartialPureSubstance and PartialTwoPhaseMedium

Location:
Modelica/trunk/Media
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • Modelica/trunk/Media/Water/package.mo

    r339 r351  
    209209</html>")); 
    210210 
     211 
    211212extends Modelica.Icons.Library; 
    212213  constant Interfaces.PartialMedium.FluidConstants[1] waterConstants( 
     
    227228     each hasCriticalData=true); 
    228229 
     230 
    229231package ConstantPropertyLiquidWater  
    230232  "Water: Simple liquid water medium (incompressible, constant data)"  
     
    263265end ConstantPropertyLiquidWater; 
    264266 
     267 
    265268package IdealSteam "Water: Steam as ideal gas from NASA source"  
    266269  extends IdealGases.SingleGases.H2O( 
     
    271274end IdealSteam; 
    272275 
     276 
    273277package StandardWater = WaterIF97_ph  
    274278  "Water using the IF97 standard, explicit in p and h. Recommended for most applications"; 
    275279 
     280 
    276281package StandardWaterOnePhase = WaterIF97_pT  
    277282  "Water using the IF97 standard, explicit in p and T. Recommended for one-phase applications"; 
     283 
    278284 
    279285package WaterIF97OnePhase_ph  
     
    290296end WaterIF97OnePhase_ph; 
    291297 
     298 
    292299package WaterIF97_pT "Water using the IF97 standard, explicit in p and T"  
    293300  extends WaterIF97_base( 
     
    299306end WaterIF97_pT; 
    300307 
     308 
    301309package WaterIF97_ph "Water using the IF97 standard, explicit in p and h"  
    302310  extends WaterIF97_base( 
     
    310318</html>")); 
    311319end WaterIF97_ph; 
     320 
    312321 
    313322partial package WaterIF97_base  
     
    441450    end if; 
    442451    if dT_explicit then 
    443       p = p_dT(d, T, phase); 
    444       h = h_dT(d, T, phase); 
     452      p = pressure_dT(d, T, phase); 
     453      h = specificEnthalpy_dT(d, T, phase); 
    445454      sat.Tsat = T; 
    446455      sat.psat = saturationPressure(T); 
    447456    elseif ph_explicit then 
    448       d = rho_ph(p, h, phase); 
    449       T = T_ph(p, h, phase); 
     457      d = density_ph(p, h, phase); 
     458      T = temperature_ph(p, h, phase); 
    450459      sat.Tsat = saturationTemperature(p); 
    451460      sat.psat = p; 
    452461    else 
    453       h = h_pT(p, T); 
    454       d = rho_pT(p, T); 
     462      h = specificEnthalpy_pT(p, T); 
     463      d = density_pT(p, T); 
    455464      sat.psat = p; 
    456465      sat.Tsat = saturationTemperature(p); 
     
    465474  end BaseProperties; 
    466475   
    467   redeclare function extends rho_ph  
    468     "compute density as a function of pressure and specific enthalpy"  
     476  redeclare function density_ph  
     477    "Computes density as a function of pressure and specific enthalpy"  
     478    extends Modelica.Icons.Function; 
     479    input AbsolutePressure p "Pressure"; 
     480    input SpecificEnthalpy h "Specific enthalpy"; 
     481    input FixedPhase phase "2 for two-phase, 1 for one-phase, 0 if not known"; 
     482    output Density d "Density"; 
    469483  algorithm  
    470484    d := IF97_Utilities.rho_ph(p, h, phase); 
    471   end rho_ph; 
    472    
    473   redeclare function extends T_ph  
    474     "compute temperature as a function of pressure and specific enthalpy"  
     485  end density_ph; 
     486   
     487  redeclare function temperature_ph  
     488    "Computes temperature as a function of pressure and specific enthalpy"  
     489    extends Modelica.Icons.Function; 
     490    input AbsolutePressure p "Pressure"; 
     491    input SpecificEnthalpy h "Specific enthalpy"; 
     492    input FixedPhase phase "2 for two-phase, 1 for one-phase, 0 if not known"; 
     493    output Temperature T "Temperature"; 
    475494  algorithm  
    476495    T := IF97_Utilities.T_ph(p, h, phase); 
    477   end T_ph; 
    478    
     496  end temperature_ph; 
     497/*   
    479498  redeclare function extends temperature_phX  
    480499    "Compute temperature from pressure and specific enthalpy"  
     
    482501    T := T_ph(p, h); 
    483502  end temperature_phX; 
    484    
     503  
    485504  redeclare function extends temperature_psX  
    486505    "Compute temperature from pressure and specific enthalpy"  
    487506  algorithm  
    488507  assert(false,"not yet implemented"); 
    489 //  T := IF97_Utilities.T_ps(p, s); 
     508    //  T := IF97_Utilities.T_ps(p, s); 
    490509  end temperature_psX; 
    491    
     510*/ 
     511  redeclare function temperature_ps  
     512    "Computes temperature as a function of pressure and specific entropy"  
     513    extends Modelica.Icons.Function; 
     514    input AbsolutePressure p "Pressure"; 
     515    input SpecificEntropy s "Specific entropy"; 
     516    input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; 
     517    output Temperature T "Temperature"; 
     518  algorithm  
     519    assert(false,"not yet implemented"); 
     520  end temperature_ps; 
     521/*   
    492522  redeclare function extends density_phX  
    493523    "Compute density from pressure and specific enthalpy"  
     
    495525    d := IF97_Utilities.rho_ph(p, h); 
    496526  end density_phX; 
    497    
    498   redeclare function extends p_dT  
    499     "compute pressure as a function of density and temperature"  
     527*/ 
     528  redeclare function pressure_dT  
     529    "Computes pressure as a function of density and temperature"  
     530    extends Modelica.Icons.Function; 
     531    input Density d "Density"; 
     532    input Temperature T "Temperature"; 
     533    input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; 
     534    output AbsolutePressure p "Pressure"; 
    500535  algorithm  
    501536    p := IF97_Utilities.p_dT(d, T, phase); 
    502   end p_dT; 
    503    
    504   redeclare function extends h_dT  
    505     "compute specific enthalpy as a function of density and temperature"  
     537  end pressure_dT; 
     538   
     539  redeclare function specificEnthalpy_dT  
     540    "Computes specific enthalpy as a function of density and temperature"  
     541    extends Modelica.Icons.Function; 
     542    input Density d "Density"; 
     543    input Temperature T "Temperature"; 
     544    input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; 
     545    output SpecificEnthalpy h "specific enthalpy"; 
    506546  algorithm  
    507547    h := IF97_Utilities.h_dT(d, T, phase); 
    508   end h_dT; 
    509    
    510   redeclare function extends h_pT  
    511     "compute specific enthalpy as a function of pressure and temperature"  
     548  end specificEnthalpy_dT; 
     549   
     550  redeclare function specificEnthalpy_pT  
     551    "Computes specific enthalpy as a function of pressure and temperature"  
     552    extends Modelica.Icons.Function; 
     553    input AbsolutePressure p "Pressure"; 
     554    input Temperature T "Temperature"; 
     555    input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; 
     556    output SpecificEnthalpy h "specific enthalpy"; 
    512557  algorithm  
    513558    h := IF97_Utilities.h_pT(p, T); 
    514   end h_pT; 
    515    
     559  end specificEnthalpy_pT; 
     560/*   
    516561  redeclare function extends specificEnthalpy_pTX  
    517562    "Compute specific enthalpy from pressure, temperature and mass fraction"  
     
    519564    h := h_pT(p, T); 
    520565  end specificEnthalpy_pTX; 
    521    
    522   redeclare function extends rho_pT  
    523     "compute density as a function of pressure and temperature"  
     566*/ 
     567  redeclare function density_pT  
     568    "Computes density as a function of pressure and temperature"  
     569    extends Modelica.Icons.Function; 
     570    input AbsolutePressure p "Pressure"; 
     571    input Temperature T "Temperature"; 
     572    input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; 
     573    output Density d "Density"; 
    524574  algorithm  
    525575    d := IF97_Utilities.rho_pT(p, T); 
    526   end rho_pT; 
     576  end density_pT; 
    527577   
    528578  redeclare function extends setDewState  
     
    578628  end specificEntropy; 
    579629   
    580   redeclare function extends heatCapacity_cp  
     630  redeclare function extends specificHeatCapacityCp  
    581631    "specific heat capacity at constant pressure of water"  
    582632     
     
    593643      cp := IF97_Utilities.cp_ph(state.p, state.h, state.phase); 
    594644    end if; 
    595   end heatCapacity_cp; 
    596    
    597   redeclare function extends heatCapacity_cv  
     645  end specificHeatCapacityCp; 
     646   
     647  redeclare function extends specificHeatCapacityCv  
    598648    "specific heat capacity at constant volume of water"  
    599649  algorithm  
     
    605655      cv := IF97_Utilities.cv_ph(state.p, state.h, state.phase); 
    606656    end if; 
    607   end heatCapacity_cv; 
     657  end specificHeatCapacityCv; 
    608658   
    609659  redeclare function extends isentropicExponent "Return isentropic exponent"  
     
    660710      refState), 0); 
    661711  end isentropicEnthalpy; 
    662    
     712/*   
    663713  redeclare function extends specificEnthalpy_psX "compute h(p,s)"  
    664714  algorithm  
    665715    h := IF97_Utilities.isentropicEnthalpy(p, s, 0); 
    666716  end specificEnthalpy_psX; 
     717*/ 
     718  redeclare function specificEnthalpy_ps  
     719    "Computes specific enthalpy as a function of pressure and specific entropy"  
     720    extends Modelica.Icons.Function; 
     721    input AbsolutePressure p "Pressure"; 
     722    input SpecificEntropy s "Specific entropy"; 
     723    input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; 
     724    output SpecificEnthalpy h "specific enthalpy"; 
     725  algorithm  
     726    h := IF97_Utilities.isentropicEnthalpy(p, s, 0); 
     727  end specificEnthalpy_ps; 
    667728   
    668729  redeclare function extends density_derh_p  
     
    760821   
    761822end WaterIF97_base; 
     823 
    762824 
    763825partial package WaterIF97_fixedregion  
     
    911973  end BaseProperties; 
    912974   
    913   redeclare function extends rho_ph  
    914     "compute density as a function of pressure and specific enthalpy"  
     975  redeclare function density_ph  
     976    "Computes density as a function of pressure and specific enthalpy"  
     977    extends Modelica.Icons.Function; 
     978    input AbsolutePressure p "Pressure"; 
     979    input SpecificEnthalpy h "Specific enthalpy"; 
     980    input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; 
    915981    input Integer region=0  
    916982      "if 0, region is unknown, otherwise known and this input"; 
     983    output Density d "Density"; 
    917984  algorithm  
    918985    d := IF97_Utilities.rho_ph(p, h, phase, region); 
    919   end rho_ph; 
    920    
    921   redeclare function extends T_ph  
    922     "compute temperature as a function of pressure and specific enthalpy"  
     986  end density_ph; 
     987   
     988  redeclare function temperature_ph  
     989    "Computes temperature as a function of pressure and specific enthalpy"  
     990    extends Modelica.Icons.Function; 
     991    input AbsolutePressure p "Pressure"; 
     992    input SpecificEnthalpy h "Specific enthalpy"; 
     993    input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; 
    923994    input Integer region=0  
    924995      "if 0, region is unknown, otherwise known and this input"; 
     996    output Temperature T "Temperature"; 
    925997  algorithm  
    926998    T := IF97_Utilities.T_ph(p, h, phase, region); 
    927   end T_ph; 
    928    
    929   redeclare function extends p_dT  
    930     "compute pressure as a function of density and temperature"  
     999  end temperature_ph; 
     1000   
     1001  redeclare function pressure_dT  
     1002    "Computes pressure as a function of density and temperature"  
     1003    extends Modelica.Icons.Function; 
     1004    input Density d "Density"; 
     1005    input Temperature T "Temperature"; 
     1006    input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; 
    9311007    input Integer region=0  
    9321008      "if 0, region is unknown, otherwise known and this input"; 
     1009    output AbsolutePressure p "Pressure"; 
    9331010  algorithm  
    9341011    p := IF97_Utilities.p_dT(d, T, phase, region); 
    935   end p_dT; 
    936    
    937   redeclare function extends h_dT  
    938     "compute specific enthalpy as a function of density and temperature"  
     1012  end pressure_dT; 
     1013   
     1014  redeclare function specificEnthalpy_dT  
     1015    "Computes specific enthalpy as a function of density and temperature"  
     1016    extends Modelica.Icons.Function; 
     1017    input Density d "Density"; 
     1018    input Temperature T "Temperature"; 
     1019    input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; 
    9391020    input Integer region=0  
    9401021      "if 0, region is unknown, otherwise known and this input"; 
     1022    output SpecificEnthalpy h "specific enthalpy"; 
    9411023  algorithm  
    9421024    h := IF97_Utilities.h_dT(d, T, phase, region); 
    943   end h_dT; 
    944    
    945   redeclare function extends h_pT  
    946     "compute specific enthalpy as a function of pressure and temperature"  
     1025  end specificEnthalpy_dT; 
     1026   
     1027  redeclare function specificEnthalpy_pT  
     1028    "Computes specific enthalpy as a function of pressure and temperature"  
     1029    extends Modelica.Icons.Function; 
     1030    input AbsolutePressure p "Pressure"; 
     1031    input Temperature T "Temperature"; 
     1032    input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; 
    9471033    input Integer region=0  
    9481034      "if 0, region is unknown, otherwise known and this input"; 
     1035    output SpecificEnthalpy h "specific enthalpy"; 
    9491036  algorithm  
    9501037    h := IF97_Utilities.h_pT(p, T, region); 
    951   end h_pT; 
    952    
    953   redeclare function extends rho_pT  
    954     "compute density as a function of pressure and temperature"  
     1038  end specificEnthalpy_pT; 
     1039   
     1040  redeclare function density_pT  
     1041    "Computes density as a function of pressure and temperature"  
     1042    extends Modelica.Icons.Function; 
     1043    input AbsolutePressure p "Pressure"; 
     1044    input Temperature T "Temperature"; 
     1045    input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; 
    9551046    input Integer region=0  
    9561047      "if 0, region is unknown, otherwise known and this input"; 
     1048    output Density d "Density"; 
    9571049  algorithm  
    9581050    d := IF97_Utilities.rho_pT(p, T, region); 
    959   end rho_pT; 
     1051  end density_pT; 
    9601052   
    9611053  redeclare function extends setDewState  
     
    10091101  end specificEntropy; 
    10101102   
    1011   redeclare function extends heatCapacity_cp  
     1103  redeclare function extends specificHeatCapacityCp  
    10121104    "specific heat capacity at constant pressure of water"  
    10131105  algorithm  
     
    10191111      cp := IF97_Utilities.cp_ph(state.p, state.h, Region); 
    10201112    end if; 
    1021   end heatCapacity_cp; 
    1022    
    1023   redeclare function extends heatCapacity_cv  
     1113  end specificHeatCapacityCp; 
     1114   
     1115  redeclare function extends specificHeatCapacityCv  
    10241116    "specific heat capacity at constant volume of water"  
    10251117  algorithm  
     
    10311123      cv := IF97_Utilities.cv_ph(state.p, state.h, state.phase, Region); 
    10321124    end if; 
    1033   end heatCapacity_cv; 
     1125  end specificHeatCapacityCv; 
    10341126   
    10351127  redeclare function extends isentropicExponent "Return isentropic exponent"  
     
    11851277   
    11861278end WaterIF97_fixedregion; 
     1279 
    11871280 
    11881281package WaterIF97_R1ph "region 1 (liquid) water according to IF97 standard"  
     
    11991292end WaterIF97_R1ph; 
    12001293 
     1294 
    12011295package WaterIF97_R2ph "region 2 (steam) water according to IF97 standard"  
    12021296  extends WaterIF97_fixedregion( 
     
    12121306end WaterIF97_R2ph; 
    12131307 
     1308 
    12141309package WaterIF97_R3ph "region 3 water according to IF97 standard"  
    12151310  extends WaterIF97_fixedregion( 
     
    12251320end WaterIF97_R3ph; 
    12261321 
     1322 
    12271323package WaterIF97_R4ph "region 4 water according to IF97 standard"  
    12281324  extends WaterIF97_fixedregion( 
     
    12381334end WaterIF97_R4ph; 
    12391335 
     1336 
    12401337package WaterIF97_R5ph "region 5 water according to IF97 standard"  
    12411338  extends WaterIF97_fixedregion( 
     
    12511348end WaterIF97_R5ph; 
    12521349 
     1350 
    12531351package WaterIF97_R1pT "region 1 (liquid) water according to IF97 standard"  
    12541352  extends WaterIF97_fixedregion( 
     
    12641362end WaterIF97_R1pT; 
    12651363 
     1364 
    12661365package WaterIF97_R2pT "region 2 (steam) water according to IF97 standard"  
    12671366  extends WaterIF97_fixedregion( 
  • Modelica/trunk/Media/package.mo

    r350 r351  
    43734373    extends PartialMedium; 
    43744374    // the following are parallel to the cape-open names 
    4375      
    4376     replaceable partial function rho_ph  
    4377       "compute density as a function of pressure and specific enthalpy"  
    4378       extends Modelica.Icons.Function; 
    4379       input AbsolutePressure p "pressure"; 
    4380       input SpecificEnthalpy h "specific enthalpy"; 
    4381       input Integer phase =  0  
    4382         "phase of the fluid: 1 for 1-phase, 2 for two-phase, 0 for not known, e.g. interactive use"; 
    4383       output Density d "density"; 
    4384     end rho_ph; 
    4385      
    4386     replaceable partial function T_ph  
    4387       "compute temperature as a function of pressure and specific enthalpy"  
    4388       extends Modelica.Icons.Function; 
    4389       input AbsolutePressure p "pressure"; 
    4390       input SpecificEnthalpy h "specific enthalpy"; 
    4391       input Integer phase =  0  
    4392         "phase of the fluid: 1 for 1-phase, 2 for two-phase, 0 for not known, e.g. interactive use"; 
    4393       output Temperature T "temperature"; 
    4394     end T_ph; 
    4395      
    4396     replaceable partial function rho_pT  
    4397       "compute density as a function of pressure and temperature"  
    4398       extends Modelica.Icons.Function; 
    4399       input AbsolutePressure p "pressure"; 
    4400       input Temperature T "temperature"; 
    4401       output Density d "density"; 
    4402     end rho_pT; 
    4403      
    4404     replaceable partial function h_pT  
    4405       "compute specific enthalpy as a function of pressure and temperature"  
    4406       extends Modelica.Icons.Function; 
    4407       input AbsolutePressure p "pressure"; 
    4408       input Temperature T "temperature"; 
     4375  /* 
     4376  replaceable partial function rho_ph  
     4377    "compute density as a function of pressure and specific enthalpy"  
     4378    extends Modelica.Icons.Function; 
     4379    input AbsolutePressure p "pressure"; 
     4380    input SpecificEnthalpy h "specific enthalpy"; 
     4381    input Integer phase =  0  
     4382      "phase of the fluid: 1 for 1-phase, 2 for two-phase, 0 for not known, e.g. interactive use"; 
     4383    output Density d "density"; 
     4384  end rho_ph; 
     4385   
     4386  replaceable partial function T_ph  
     4387    "compute temperature as a function of pressure and specific enthalpy"  
     4388    extends Modelica.Icons.Function; 
     4389    input AbsolutePressure p "pressure"; 
     4390    input SpecificEnthalpy h "specific enthalpy"; 
     4391    input Integer phase =  0  
     4392      "phase of the fluid: 1 for 1-phase, 2 for two-phase, 0 for not known, e.g. interactive use"; 
     4393    output Temperature T "temperature"; 
     4394  end T_ph; 
     4395   
     4396  replaceable partial function rho_pT  
     4397    "compute density as a function of pressure and temperature"  
     4398    extends Modelica.Icons.Function; 
     4399    input AbsolutePressure p "pressure"; 
     4400    input Temperature T "temperature"; 
     4401    output Density d "density"; 
     4402  end rho_pT; 
     4403   
     4404  replaceable partial function h_pT  
     4405    "compute specific enthalpy as a function of pressure and temperature"  
     4406    extends Modelica.Icons.Function; 
     4407    input AbsolutePressure p "pressure"; 
     4408    input Temperature T "temperature"; 
     4409    output SpecificEnthalpy h "specific enthalpy"; 
     4410  end h_pT; 
     4411   
     4412  replaceable partial function p_dT  
     4413    "compute pressure as a function of density and temperature"  
     4414    extends Modelica.Icons.Function; 
     4415    input Density d "density"; 
     4416    input Temperature T "temperature"; 
     4417    input Integer phase =  0  
     4418      "phase of the fluid: 1 for 1-phase, 2 for two-phase, 0 for not known, e.g. interactive use"; 
     4419    output AbsolutePressure p "pressure"; 
     4420  end p_dT; 
     4421   
     4422  replaceable partial function h_dT  
     4423    "compute specific enthalpy as a function of density and temperature"  
     4424    extends Modelica.Icons.Function; 
     4425    input Density d "density"; 
     4426    input Temperature T "temperature"; 
     4427    input Integer phase =  0  
     4428      "phase of the fluid: 1 for 1-phase, 2 for two-phase, 0 for not known, e.g. interactive use"; 
     4429    output SpecificEnthalpy h "specific enthalpy"; 
     4430  end h_dT; 
     4431*/ 
     4432    replaceable function density_ph  
     4433      "Computes density as a function of pressure and specific enthalpy"  
     4434      extends Modelica.Icons.Function; 
     4435      input AbsolutePressure p "Pressure"; 
     4436      input SpecificEnthalpy h "Specific enthalpy"; 
     4437      output Density d "Density"; 
     4438    algorithm  
     4439      d := density_phX(p, h, fill(0,0)); 
     4440    end density_ph; 
     4441     
     4442    replaceable function temperature_ph  
     4443      "Computes temperature as a function of pressure and specific enthalpy"  
     4444      extends Modelica.Icons.Function; 
     4445      input AbsolutePressure p "Pressure"; 
     4446      input SpecificEnthalpy h "Specific enthalpy"; 
     4447      output Temperature T "Temperature"; 
     4448    algorithm  
     4449      T := temperature_phX(p, h, fill(0,0)); 
     4450    end temperature_ph; 
     4451     
     4452    replaceable function pressure_dT  
     4453      "Computes pressure as a function of density and temperature"  
     4454      extends Modelica.Icons.Function; 
     4455      input Density d "Density"; 
     4456      input Temperature T "Temperature"; 
     4457      output AbsolutePressure p "Pressure"; 
     4458    algorithm  
     4459      p := pressure(setState_pTX(d, T, fill(0,0))); 
     4460    end pressure_dT; 
     4461     
     4462    replaceable function specificEnthalpy_dT  
     4463      "Computes specific enthalpy as a function of density and temperature"  
     4464      extends Modelica.Icons.Function; 
     4465      input Density d "Density"; 
     4466      input Temperature T "Temperature"; 
    44094467      output SpecificEnthalpy h "specific enthalpy"; 
    4410     end h_pT; 
    4411      
    4412     replaceable partial function p_dT  
    4413       "compute pressure as a function of density and temperature"  
    4414       extends Modelica.Icons.Function; 
    4415       input Density d "density"; 
    4416       input Temperature T "temperature"; 
    4417       input Integer phase =  0  
    4418         "phase of the fluid: 1 for 1-phase, 2 for two-phase, 0 for not known, e.g. interactive use"; 
    4419       output AbsolutePressure p "pressure"; 
    4420     end p_dT; 
    4421      
    4422     replaceable partial function h_dT  
    4423       "compute specific enthalpy as a function of density and temperature"  
    4424       extends Modelica.Icons.Function; 
    4425       input Density d "density"; 
    4426       input Temperature T "temperature"; 
    4427       input Integer phase =  0  
    4428         "phase of the fluid: 1 for 1-phase, 2 for two-phase, 0 for not known, e.g. interactive use"; 
     4468    algorithm  
     4469      h := specificEnthalpy(setState_pTX(d, T, fill(0,0))); 
     4470    end specificEnthalpy_dT; 
     4471     
     4472    replaceable function specificEnthalpy_ps  
     4473      "Computes specific enthalpy as a function of pressure and specific entropy"  
     4474      extends Modelica.Icons.Function; 
     4475      input AbsolutePressure p "Pressure"; 
     4476      input SpecificEntropy s "Specific entropy"; 
    44294477      output SpecificEnthalpy h "specific enthalpy"; 
    4430     end h_dT; 
    4431      
     4478    algorithm  
     4479      h := specificEnthalpy_psX(p,s,fill(0,0)); 
     4480    end specificEnthalpy_ps; 
     4481     
     4482    replaceable function temperature_ps  
     4483      "Computes temperature as a function of pressure and specific entropy"  
     4484      extends Modelica.Icons.Function; 
     4485      input AbsolutePressure p "Pressure"; 
     4486      input SpecificEntropy s "Specific entropy"; 
     4487      output Temperature T "Temperature"; 
     4488    algorithm  
     4489      T := temperature_psX(p,s,fill(0,0)); 
     4490    end temperature_ps; 
     4491     
     4492    replaceable function specificEnthalpy_pT  
     4493      "Computes specific enthalpy as a function of pressure and temperature"  
     4494      extends Modelica.Icons.Function; 
     4495      input AbsolutePressure p "Pressure"; 
     4496      input Temperature T "Temperature"; 
     4497      output SpecificEnthalpy h "specific enthalpy"; 
     4498    algorithm  
     4499      h := specificEnthalpy_pTX(p, T, fill(0,0)); 
     4500    end specificEnthalpy_pT; 
     4501     
     4502    replaceable function density_pT  
     4503      "Computes density as a function of pressure and temperature"  
     4504      extends Modelica.Icons.Function; 
     4505      input AbsolutePressure p "Pressure"; 
     4506      input Temperature T "Temperature"; 
     4507      output Density d "Density"; 
     4508    algorithm  
     4509      d := density(setState_pTX(p, T, fill(0,0))); 
     4510    end density_pT; 
    44324511  end PartialPureSubstance; 
    44334512   
     
    48764955        h := specificEnthalpy(setState_psX(p,s,X,phase)); 
    48774956      end specificEnthalpy_psX; 
     4957     
     4958  // alias functions for simplified access 
     4959  // note that there is a Dymola error which does not allow writing 
     4960  // replaceable function density_ph = density_phX(p,h,fill(0,0)) 
     4961     
     4962    redeclare replaceable function density_ph  
     4963      "Computes density as a function of pressure and specific enthalpy"  
     4964      extends Modelica.Icons.Function; 
     4965      input AbsolutePressure p "Pressure"; 
     4966      input SpecificEnthalpy h "Specific enthalpy"; 
     4967      input FixedPhase phase=0  
     4968        "2 for two-phase, 1 for one-phase, 0 if not known"; 
     4969      output Density d "Density"; 
     4970    algorithm  
     4971      d := density_phX(p, h, fill(0,0), phase); 
     4972    end density_ph; 
     4973     
     4974    redeclare replaceable function temperature_ph  
     4975      "Computes temperature as a function of pressure and specific enthalpy"  
     4976      extends Modelica.Icons.Function; 
     4977      input AbsolutePressure p "Pressure"; 
     4978      input SpecificEnthalpy h "Specific enthalpy"; 
     4979      input FixedPhase phase=0