Show
Ignore:
Timestamp:
02/21/2006 10:47:41 AM (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

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • 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  
     4980        "2 for two-phase, 1 for one-phase, 0 if not known"; 
     4981      output Temperature T "Temperature"; 
     4982    algorithm  
     4983      T := temperature_phX(p, h, fill(0,0),phase); 
     4984    end temperature_ph; 
     4985     
     4986    redeclare replaceable function pressure_dT  
     4987      "Computes pressure as a function of density and temperature"  
     4988      extends Modelica.Icons.Function; 
     4989      input Density d "Density"; 
     4990      input Temperature T "Temperature"; 
     4991      input FixedPhase phase=0  
     4992        "2 for two-phase, 1 for one-phase, 0 if not known"; 
     4993      output AbsolutePressure p "Pressure"; 
     4994    algorithm  
     4995      p := pressure(setState_pTX(d, T, fill(0,0),phase)); 
     4996    end pressure_dT; 
     4997     
     4998    redeclare replaceable function specificEnthalpy_dT  
     4999      "Computes specific enthalpy as a function of density and temperature"  
     5000      extends Modelica.Icons.Function; 
     5001      input Density d "Density"; 
     5002      input Temperature T "Temperature"; 
     5003      input FixedPhase phase=0  
     5004        "2 for two-phase, 1 for one-phase, 0 if not known"; 
     5005      output SpecificEnthalpy h "specific enthalpy"; 
     5006    algorithm  
     5007      h := specificEnthalpy(setState_pTX(d, T, fill(0,0),phase)); 
     5008    end specificEnthalpy_dT; 
     5009     
     5010    redeclare replaceable function specificEnthalpy_ps  
     5011      "Computes specific enthalpy as a function of pressure and specific entropy"  
     5012      extends Modelica.Icons.Function; 
     5013      input AbsolutePressure p "Pressure"; 
     5014      input SpecificEntropy s "Specific entropy"; 
     5015      input FixedPhase phase=0  
     5016        "2 for two-phase, 1 for one-phase, 0 if not known"; 
     5017      output SpecificEnthalpy h "specific enthalpy"; 
     5018    algorithm  
     5019      h := specificEnthalpy_psX(p,s,fill(0,0)); 
     5020    end specificEnthalpy_ps; 
     5021     
     5022    redeclare replaceable function temperature_ps  
     5023      "Computes temperature as a function of pressure and specific entropy"  
     5024      extends Modelica.Icons.Function; 
     5025      input AbsolutePressure p "Pressure"; 
     5026      input SpecificEntropy s "Specific entropy"; 
     5027      input FixedPhase phase=0  
     5028        "2 for two-phase, 1 for one-phase, 0 if not known"; 
     5029      output Temperature T "Temperature"; 
     5030    algorithm  
     5031      T := temperature_psX(p,s,fill(0,0),phase); 
     5032    end temperature_ps; 
     5033     
     5034    redeclare replaceable function specificEnthalpy_pT  
     5035      "Computes specific enthalpy as a function of pressure and temperature"  
     5036      extends Modelica.Icons.Function; 
     5037      input AbsolutePressure p "Pressure"; 
     5038      input Temperature T "Temperature"; 
     5039      input FixedPhase phase=0  
     5040        "2 for two-phase, 1 for one-phase, 0 if not known"; 
     5041      output SpecificEnthalpy h "specific enthalpy"; 
     5042    algorithm  
     5043      h := specificEnthalpy_pTX(p, T, fill(0,0),phase); 
     5044    end specificEnthalpy_pT; 
     5045     
     5046    redeclare replaceable function density_pT  
     5047      "Computes density as a function of pressure and temperature"  
     5048      extends Modelica.Icons.Function; 
     5049      input AbsolutePressure p "Pressure"; 
     5050      input Temperature T "Temperature"; 
     5051      input FixedPhase phase=0  
     5052        "2 for two-phase, 1 for one-phase, 0 if not known"; 
     5053      output Density d "Density"; 
     5054    algorithm  
     5055      d := density(setState_pTX(p, T, fill(0,0),phase)); 
     5056    end density_pT; 
    48785057  end PartialTwoPhaseMedium; 
    48795058   
     
    49675146      h := cp_const*(T-T0); 
    49685147    end specificEnthalpy_pTX; 
    4969      
    49705148     
    49715149    redeclare function temperature_phX