Changeset 1016
- Timestamp:
- 01/29/2008 10:17:56 AM (12 months ago)
- Location:
- Modelica/trunk/Modelica/Media
- Files:
-
- 4 modified
-
IdealGases/Common/package.mo (modified) (2 diffs)
-
Incompressible.mo (modified) (3 diffs)
-
Water/package.mo (modified) (8 diffs)
-
package.mo (modified) (21 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Modelica/trunk/Modelica/Media/IdealGases/Common/package.mo
r914 r1016 154 154 mediumName=data.name, 155 155 substanceNames={data.name}, 156 final reducedX=true,157 156 singleState=false, 158 157 Temperature(min=200, max=6000, start=500, nominal=500), … … 230 229 200 K <= T <= 6000 K required from medium model \"" + mediumName + "\". 231 230 "); 232 X = reference_X;233 231 MM = data.MM; 234 232 R = data.R; -
Modelica/trunk/Modelica/Media/Incompressible.mo
r887 r1016 39 39 extends Modelica.Media.Interfaces.PartialMedium( 40 40 final reducedX=true, 41 final fixedX = true, 41 42 mediumName="tableMedium", 42 43 redeclare record ThermodynamicState=Common.BaseProps_Tpoly, … … 130 131 131 132 redeclare model extends BaseProperties( 133 final standardOrderComponents=true, 132 134 p_bar=Cv.to_bar(p), 133 135 T_degC(start = T_start-273.15)=Cv.to_degC(T), … … 184 186 state.p = p; 185 187 MM = MM_const; 186 X = reference_X;187 188 end BaseProperties; 188 189 -
Modelica/trunk/Modelica/Media/Water/package.mo
r998 r1016 255 255 fluidConstants = simpleWaterConstants); 256 256 257 annotation (Icon(coordinateSystem(preserveAspectRatio= true, extent={{-100,257 annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, 258 258 -100},{100,100}}), graphics={Text( 259 259 extent={{-90,88},{90,18}}, … … 267 267 fillPattern=FillPattern.Solid, 268 268 textString="water")}), 269 Diagram(coordinateSystem(preserveAspectRatio= true,269 Diagram(coordinateSystem(preserveAspectRatio=false, 270 270 extent={{-100,-100},{100,100}}), 271 271 graphics), … … 333 333 "Water: Steam properties as defined by IAPWS/IF97 standard" 334 334 335 annotation (Icon(coordinateSystem(preserveAspectRatio= true, extent={{-100,335 annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, 336 336 -100},{100,100}}), graphics={Text( 337 337 extent={{-94,84},{94,40}}, … … 393 393 mediumName="WaterIF97", 394 394 substanceNames={"water"}, 395 final reducedX=true,396 395 singleState=false, 397 396 SpecificEnthalpy(start=1.0e5, nominal=5.0e5), … … 426 425 "saturation temperature and pressure"; 427 426 equation 428 X = reference_X;429 427 MM = fluidConstants[1].molarMass; 430 428 if smoothModel then … … 904 902 "Water: Steam properties as defined by IAPWS/IF97 standard" 905 903 906 annotation (Icon(coordinateSystem(preserveAspectRatio= true, extent={{-100,904 annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, 907 905 -100},{100,100}}), graphics={Text( 908 906 extent={{-94,84},{94,40}}, … … 966 964 substanceNames={"water"}, 967 965 singleState=false, 968 final reducedX=true,969 966 SpecificEnthalpy(start=1.0e5, nominal=5.0e5), 970 967 Density(start=150, nominal=500), … … 999 996 "saturation temperature and pressure"; 1000 997 equation 1001 X = reference_X;1002 998 MM = fluidConstants[1].molarMass; 1003 999 if smoothModel then -
Modelica/trunk/Modelica/Media/package.mo
r998 r1016 3271 3271 annotation (Placement(transformation(extent={{ 3272 3272 -80,0},{-60,20}}, rotation=0))); 3273 annotation (Diagram(coordinateSystem(preserveAspectRatio= true, extent=3274 {{-100,-100},{100,100}}),3273 annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100, 3274 -100},{100,100}}), 3275 3275 graphics), 3276 3276 Documentation(info="<html> … … 3847 3847 final singleState=false, 3848 3848 final reducedX = true, 3849 final fixedX = true, 3849 3850 Temperature(min=273, max=450, start=323)); 3850 3851 … … 3859 3860 on a thermal variable (temperature or enthalpy). Otherwise, set it 3860 3861 to false. 3861 For a single-substance medium, just set reducedX to true, and there's3862 For a single-substance medium, just set reducedX and fixedX to true, and there's 3862 3863 no need to bother about medium compositions at all. Otherwise, set 3863 3864 final reducedX = true if the medium model has nS-1 independent mass 3864 3865 fraction, or reducedX = false if the medium model has nS independent 3865 3866 mass fractions (nS = number of substances). 3867 If a mixture has a fixed composition set fixedX=true, otherwise false. 3868 The modifiers for reducedX and fixedX should normally be final 3869 since the other equations are based on these values. 3870 3866 3871 It is also possible to redeclare the min, max, and start attributes of 3867 3872 Medium types, defined in the base class Interfaces.PartialMedium … … 3889 3894 */ 3890 3895 3891 redeclare model extends BaseProperties "Base properties of medium" 3896 redeclare model extends BaseProperties(final standardOrderComponents=true) 3897 "Base properties of medium" 3892 3898 3893 3899 annotation (Documentation(info="<html></html>")); … … 3900 3906 state.p = p; 3901 3907 state.T = T; 3902 X = reference_X;3903 3908 annotation (Documentation(revisions="<html> 3904 3909 … … 4030 4035 constant Integer nX = nS "Number of mass fractions" 4031 4036 annotation(Evaluate=true); 4032 constant Integer nXi=if fixedX then 0 else if reducedX or nS == 1then nS - 1 else nS4037 constant Integer nXi=if fixedX then 0 else if reducedX then nS - 1 else nS 4033 4038 "Number of structurally independent mass fractions (see docu for details)" 4034 4039 annotation(Evaluate=true); … … 4104 4109 if standardOrderComponents then 4105 4110 Xi = X[1:nXi]; 4106 if nX > 1 then 4111 4107 4112 if fixedX then 4108 4113 X = reference_X; … … 4116 4121 + substanceNames[i] + "\nof medium " + mediumName + " is not in the range 0..1"); 4117 4122 end for; 4118 end if; 4123 4119 4124 end if; 4120 4125 … … 4697 4702 partial package PartialPureSubstance 4698 4703 "base class for pure substances of one chemical substance" 4699 extends PartialMedium ;4700 4701 replaceable function setState_pT "Return thermodynamic state from p and T"4704 extends PartialMedium(final reducedX = true, final fixedX=true); 4705 4706 replaceable function setState_pT "Return thermodynamic state from p and T" 4702 4707 extends Modelica.Icons.Function; 4703 4708 input AbsolutePressure p "Pressure"; 4704 4709 input Temperature T "Temperature"; 4705 4710 output ThermodynamicState state "thermodynamic state record"; 4706 algorithm4711 algorithm 4707 4712 state := setState_pTX(p,T,fill(0,0)); 4708 end setState_pT;4713 end setState_pT; 4709 4714 4710 4715 replaceable function setState_ph "Return thermodynamic state from p and h" … … 4818 4823 d := density(setState_pTX(p, T, fill(0,0))); 4819 4824 end density_pT; 4825 4826 redeclare replaceable partial model extends BaseProperties( 4827 final standardOrderComponents=true) 4828 end BaseProperties; 4820 4829 end PartialPureSubstance; 4821 4830 … … 4864 4873 MM = MM_const; 4865 4874 R = 8.3144/MM; 4866 X = reference_X;4867 4875 end BaseProperties; 4868 4876 … … 5869 5877 "Medium model with linear dependency of u, h from temperature. All other quantities, especially density, are constant." 5870 5878 5871 extends Interfaces.PartialPureSubstance(final singleState=true,final 5872 reducedX = true); 5879 extends Interfaces.PartialPureSubstance(final singleState=true); 5873 5880 5874 5881 import SI = Modelica.SIunits; … … 5911 5918 state.T = T; 5912 5919 state.p = p; 5913 X = reference_X;5914 5920 annotation (Documentation(info="<HTML> 5915 5921 <p> … … 5972 5978 5973 5979 redeclare function extends dynamicViscosity "Return dynamic viscosity" 5980 5974 5981 annotation(Documentation(info="<html></html>")); 5975 5982 algorithm … … 5979 5986 redeclare function extends thermalConductivity 5980 5987 "Return thermal conductivity" 5988 5981 5989 annotation (Documentation(info="<html></html>")); 5982 5990 algorithm … … 5986 5994 redeclare function extends specificHeatCapacityCp 5987 5995 "Return specific heat capacity at constant pressure" 5996 5988 5997 annotation(Documentation(info="<html></html>")); 5989 5998 algorithm … … 5993 6002 redeclare function extends specificHeatCapacityCv 5994 6003 "Return specific heat capacity at constant volume" 6004 5995 6005 annotation(Documentation(info="<html></html>")); 5996 6006 algorithm … … 5999 6009 6000 6010 redeclare function extends isentropicExponent "Return isentropic exponent" 6011 6001 6012 annotation(Documentation(info="<html></html>")); 6002 6013 algorithm … … 6005 6016 6006 6017 redeclare function extends velocityOfSound "Return velocity of sound " 6018 6007 6019 annotation(Documentation(info="<html></html>")); 6008 6020 algorithm … … 6050 6062 "Medium model of Ideal gas with constant cp and cv. All other quantities, e.g. transport properties, are constant." 6051 6063 6052 extends Interfaces.PartialPureSubstance(final singleState=false,final 6053 reducedX = true); 6064 extends Interfaces.PartialPureSubstance(final singleState=false); 6054 6065 6055 6066 import SI = Modelica.SIunits; … … 6091 6102 state.T = T; 6092 6103 state.p = p; 6093 X = reference_X;6094 6104 annotation (Documentation(info="<HTML> 6095 6105 <p>
