Medium model of a mixture of ideal gases based on NASA source
This model calculates the medium properties for single component ideal gases.
Sources for model and literature:
Original Data: Computer program for calculation of complex chemical
equilibrium compositions and applications. Part 1: Analysis
Document ID: 19950013764 N (95N20180) File Series: NASA Technical Reports
Report Number: NASA-RP-1311 E-8017 NAS 1.61:1311
Authors: Gordon, Sanford (NASA Lewis Research Center)
Mcbride, Bonnie J. (NASA Lewis Research Center)
Published: Oct 01, 1994.
Known limits of validity:
The data is valid for
temperatures between 200 K and 6000 K. A few of the data sets for
monatomic gases have a discontinuous 1st derivative at 1000 K, but
this never caused problems so far.
This model has been copied from the ThermoFluid library. It has been developed by Hubertus Tummescheit.
Extends from Modelica.Media.Interfaces.PartialMixtureMedium (Base class for pure substances of several chemical substances).
Name | Description |
---|---|
ThermodynamicState | Thermodynamic state variables |
data | Data records of ideal gas substances |
excludeEnthalpyOfFormation=true | If true, enthalpy of formation Hf is not included in specific enthalpy h |
referenceChoice=ReferenceEnthalpy.ZeroAt0K | Choice of reference enthalpy |
h_offset=0.0 | User defined offset for reference enthalpy, if referenceChoice = UserDefined |
MMX=data[:].MM | Molar masses of components |
methodForThermalConductivity=1 | |
BaseProperties | Base properties (p, d, T, h, u, R, MM, X, and Xi of NASA mixture gas |
setState_pTX | Return thermodynamic state as function of p, T and composition X |
setState_phX | Return thermodynamic state as function of p, h and composition X |
setState_psX | Return thermodynamic state as function of p, s and composition X |
setState_dTX | Return thermodynamic state as function of d, T and composition X |
setSmoothState | Return thermodynamic state so that it smoothly approximates: if x > 0 then state_a else state_b |
pressure | Return pressure of ideal gas |
temperature | Return temperature of ideal gas |
density | Return density of ideal gas |
specificEnthalpy | Return specific enthalpy |
specificInternalEnergy | Return specific internal energy |
specificEntropy | Return specific entropy |
specificGibbsEnergy | Return specific Gibbs energy |
specificHelmholtzEnergy | Return specific Helmholtz energy |
h_TX | Return specific enthalpy |
h_TX_der | Return specific enthalpy derivative |
gasConstant | Return gasConstant |
specificHeatCapacityCp | Return specific heat capacity at constant pressure |
specificHeatCapacityCv | Return specific heat capacity at constant volume from temperature and gas data |
MixEntropy | Return mixing entropy of ideal gases / R |
s_TX | Return temperature dependent part of the entropy, expects full entropy vector |
isentropicExponent | Return isentropic exponent |
velocityOfSound | Return velocity of sound |
isentropicEnthalpyApproximation | Approximate method of calculating h_is from upstream properties and downstream pressure |
isentropicEnthalpy | Return isentropic enthalpy |
gasMixtureViscosity | Return viscosities of gas mixtures at low pressures (Wilke method) |
dynamicViscosity | Return mixture dynamic viscosity |
mixtureViscosityChung | Return the viscosity of gas mixtures without access to component viscosities (Chung, et. al. rules) |
lowPressureThermalConductivity | Return thermal conductivities of low-pressure gas mixtures (Mason and Saxena Modification) |
thermalConductivity | Return thermal conductivity for low pressure gas mixtures |
isobaricExpansionCoefficient | Return isobaric expansion coefficient beta |
isothermalCompressibility | Return isothermal compressibility factor |
density_derp_T | Return density derivative by pressure at constant temperature |
density_derT_p | Return density derivative by temperature at constant pressure |
density_derX | Return density derivative by mass fraction |
molarMass | Return molar mass of mixture |
T_hX | Return temperature from specific enthalpy and mass fraction |
T_psX | Return temperature from pressure, specific entropy and mass fraction |
Inherited | |
fluidConstants | Constant data for the fluid |
moleToMassFractions | Return mass fractions X from mole fractions |
massToMoleFractions | Return mole fractions from mass fractions X |
ThermoStates=Modelica.Media.Interfaces.Choices.IndependentVariables.pTX | Enumeration type for independent variables |
mediumName="unusablePartialMedium" | Name of the medium |
substanceNames=data[:].name | Names of the mixture substances. Set substanceNames={mediumName} if only one substance. |
extraPropertiesNames=fill("", 0) | Names of the additional (extra) transported properties. Set extraPropertiesNames=fill("",0) if unused |
singleState=false | = true, if u and d are not a function of pressure |
reducedX=false | = true if medium contains the equation sum(X) = 1.0; set reducedX=true if only one substance (see docu for details) |
fixedX=false | = true if medium contains the equation X = reference_X |
reference_p=101325 | Reference pressure of Medium: default 1 atmosphere |
reference_T=298.15 | Reference temperature of Medium: default 25 deg Celsius |
reference_X=fill(1/nX, nX) | Default mass fractions of medium |
p_default=101325 | Default value for pressure of medium (for initialization) |
T_default=Modelica.SIunits.Conversions.from_degC(20) | Default value for temperature of medium (for initialization) |
h_default=specificEnthalpy_pTX(p_default, T_default, X_default) | Default value for specific enthalpy of medium (for initialization) |
X_default=reference_X | Default value for mass fractions of medium (for initialization) |
C_default=fill(0, nC) | Default value for trace substances of medium (for initialization) |
nS=size(substanceNames, 1) | Number of substances |
nX=nS | Number of mass fractions |
nXi=if fixedX then 0 else if reducedX then nS - 1 else nS | Number of structurally independent mass fractions (see docu for details) |
nC=size(extraPropertiesNames, 1) | Number of extra (outside of standard mass-balance) transported properties |
C_nominal=1.0e-6*ones(nC) | Default for the nominal values for the extra properties |
FluidConstants | Critical, triple, molecular and other standard data of fluid |
prandtlNumber | Return the Prandtl number |
heatCapacity_cp | Alias for deprecated name |
heatCapacity_cv | Alias for deprecated name |
beta | Alias for isobaricExpansionCoefficient for user convenience |
kappa | Alias of isothermalCompressibility for user convenience |
density_derp_h | Return density derivative w.r.t. pressure at const specific enthalpy |
density_derh_p | Return density derivative w.r.t. specific enthalpy at constant pressure |
specificEnthalpy_pTX | Return specific enthalpy from p, T, and X or Xi |
specificEntropy_pTX | Return specific enthalpy from p, T, and X or Xi |
density_pTX | Return density from p, T, and X or Xi |
temperature_phX | Return temperature from p, h, and X or Xi |
density_phX | Return density from p, h, and X or Xi |
temperature_psX | Return temperature from p,s, and X or Xi |
density_psX | Return density from p, s, and X or Xi |
specificEnthalpy_psX | Return specific enthalpy from p, s, and X or Xi |
MassFlowRate | Type for mass flow rate with medium specific attributes |
AbsolutePressure | Type for absolute pressure with medium specific attributes |
Density | Type for density with medium specific attributes |
DynamicViscosity | Type for dynamic viscosity with medium specific attributes |
EnthalpyFlowRate | Type for enthalpy flow rate with medium specific attributes |
MassFraction | Type for mass fraction with medium specific attributes |
MoleFraction | Type for mole fraction with medium specific attributes |
MolarMass | Type for molar mass with medium specific attributes |
MolarVolume | Type for molar volume with medium specific attributes |
IsentropicExponent | Type for isentropic exponent with medium specific attributes |
SpecificEnergy | Type for specific energy with medium specific attributes |
SpecificInternalEnergy | Type for specific internal energy with medium specific attributes |
SpecificEnthalpy | Type for specific enthalpy with medium specific attributes |
SpecificEntropy | Type for specific entropy with medium specific attributes |
SpecificHeatCapacity | Type for specific heat capacity with medium specific attributes |
SurfaceTension | Type for surface tension with medium specific attributes |
Temperature | Type for temperature with medium specific attributes |
ThermalConductivity | Type for thermal conductivity with medium specific attributes |
PrandtlNumber | Type for Prandtl number with medium specific attributes |
VelocityOfSound | Type for velocity of sound with medium specific attributes |
ExtraProperty | Type for unspecified, mass-specific property transported by flow |
CumulativeExtraProperty | Type for conserved integral of unspecified, mass specific property |
ExtraPropertyFlowRate | Type for flow rate of unspecified, mass-specific property |
IsobaricExpansionCoefficient | Type for isobaric expansion coefficient with medium specific attributes |
DipoleMoment | Type for dipole moment with medium specific attributes |
DerDensityByPressure | Type for partial derivative of density with respect to pressure with medium specific attributes |
DerDensityByEnthalpy | Type for partial derivative of density with respect to enthalpy with medium specific attributes |
DerEnthalpyByPressure | Type for partial derivative of enthalpy with respect to pressure with medium specific attributes |
DerDensityByTemperature | Type for partial derivative of density with respect to temperature with medium specific attributes |
DerTemperatureByPressure | Type for partial derivative of temperature with respect to pressure with medium specific attributes |
SaturationProperties | Saturation properties of two phase medium |
FluidLimits | Validity limits for fluid model |
FixedPhase | Phase of the fluid: 1 for 1-phase, 2 for two-phase, 0 for not known, e.g., interactive use |
Basic | The most basic version of a record used in several degrees of detail |
IdealGas | The ideal gas version of a record used in several degrees of detail |
TwoPhase | The two phase fluid version of a record used in several degrees of detail |
Thermodynamic state variables
Extends from (Thermodynamic state variables).
Base properties (p, d, T, h, u, R, MM, X, and Xi of NASA mixture gas
Extends from (Base properties (p, d, T, h, u, R, MM and, if applicable, X and Xi) of a medium).
Name | Description |
---|---|
standardOrderComponents | If true, and reducedX = true, the last element of X will be computed from the other ones |
Advanced | |
preferredMediumStates | = true if StateSelect.prefer shall be used for the independent property variables of the medium |
Return thermodynamic state as function of p, T and composition X
Extends from Modelica.Icons.Function (Icon for functions).
Name | Description |
---|---|
p | Pressure [Pa] |
T | Temperature [K] |
X[:] | Mass fractions [kg/kg] |
Name | Description |
---|---|
state |
Return thermodynamic state as function of p, h and composition X
Extends from Modelica.Icons.Function (Icon for functions).
Name | Description |
---|---|
p | Pressure [Pa] |
h | Specific enthalpy [J/kg] |
X[:] | Mass fractions [kg/kg] |
Name | Description |
---|---|
state |
Return thermodynamic state as function of p, s and composition X
Extends from Modelica.Icons.Function (Icon for functions).
Name | Description |
---|---|
p | Pressure [Pa] |
s | Specific entropy [J/(kg.K)] |
X[:] | Mass fractions [kg/kg] |
Name | Description |
---|---|
state |
Return thermodynamic state as function of d, T and composition X
Extends from Modelica.Icons.Function (Icon for functions).
Name | Description |
---|---|
d | Density [kg/m3] |
T | Temperature [K] |
X[:] | Mass fractions [kg/kg] |
Name | Description |
---|---|
state |
Return thermodynamic state so that it smoothly approximates: if x > 0 then state_a else state_b
Extends from (Return thermodynamic state so that it smoothly approximates: if x > 0 then state_a else state_b).
Name | Description |
---|---|
x | m_flow or dp |
state_a | Thermodynamic state if x > 0 |
state_b | Thermodynamic state if x < 0 |
x_small | Smooth transition in the region -x_small < x < x_small |
Name | Description |
---|---|
state | Smooth thermodynamic state for all x (continuous and differentiable) |
Return pressure of ideal gas
Extends from (Return pressure).
Name | Description |
---|---|
state | Thermodynamic state record |
Name | Description |
---|---|
p | Pressure [Pa] |
Return temperature of ideal gas
Extends from (Return temperature).
Name | Description |
---|---|
state | Thermodynamic state record |
Name | Description |
---|---|
T | Temperature [K] |
Return density of ideal gas
Extends from (Return density).
Name | Description |
---|---|
state | Thermodynamic state record |
Name | Description |
---|---|
d | Density [kg/m3] |
Return specific enthalpy
Extends from Modelica.Icons.Function (Icon for functions), (Return specific enthalpy).
Name | Description |
---|---|
state | Thermodynamic state record |
Name | Description |
---|---|
h | Specific enthalpy [J/kg] |
Return specific internal energy
Extends from Modelica.Icons.Function (Icon for functions), (Return specific internal energy).
Name | Description |
---|---|
state | Thermodynamic state record |
Name | Description |
---|---|
u | Specific internal energy [J/kg] |
Return specific entropy
Extends from (Return specific entropy).
Name | Description |
---|---|
state | Thermodynamic state record |
Name | Description |
---|---|
s | Specific entropy [J/(kg.K)] |
Return specific Gibbs energy
Extends from Modelica.Icons.Function (Icon for functions), (Return specific Gibbs energy).
Name | Description |
---|---|
state | Thermodynamic state record |
Name | Description |
---|---|
g | Specific Gibbs energy [J/kg] |
Return specific Helmholtz energy
Extends from Modelica.Icons.Function (Icon for functions), (Return specific Helmholtz energy).
Name | Description |
---|---|
state | Thermodynamic state record |
Name | Description |
---|---|
f | Specific Helmholtz energy [J/kg] |
Return specific enthalpy
Extends from Modelica.Icons.Function (Icon for functions).
Name | Description |
---|---|
T | Temperature [K] |
X[nX] | Independent Mass fractions of gas mixture [kg/kg] |
exclEnthForm | If true, enthalpy of formation Hf is not included in specific enthalpy h |
refChoice | Choice of reference enthalpy |
h_off | User defined offset for reference enthalpy, if referenceChoice = UserDefined [J/kg] |
Name | Description |
---|---|
h | Specific enthalpy at temperature T [J/kg] |
Return specific enthalpy derivative
Extends from Modelica.Icons.Function (Icon for functions).
Name | Description |
---|---|
T | Temperature [K] |
X[nX] | Independent Mass fractions of gas mixture [kg/kg] |
exclEnthForm | If true, enthalpy of formation Hf is not included in specific enthalpy h |
refChoice | Choice of reference enthalpy |
h_off | User defined offset for reference enthalpy, if referenceChoice = UserDefined [J/kg] |
dT | Temperature derivative |
dX[nX] | Independent mass fraction derivative |
Name | Description |
---|---|
h_der | Specific enthalpy at temperature T |
Return gasConstant
Extends from (Return the gas constant of the mixture (also for liquids)).
Name | Description |
---|---|
state | Thermodynamic state |
Name | Description |
---|---|
R | Mixture gas constant [J/(kg.K)] |
Return specific heat capacity at constant pressure
Extends from (Return specific heat capacity at constant pressure).
Name | Description |
---|---|
state | Thermodynamic state record |
Name | Description |
---|---|
cp | Specific heat capacity at constant pressure [J/(kg.K)] |
Return specific heat capacity at constant volume from temperature and gas data
Extends from (Return specific heat capacity at constant volume).
Name | Description |
---|---|
state | Thermodynamic state record |
Name | Description |
---|---|
cv | Specific heat capacity at constant volume [J/(kg.K)] |
Return mixing entropy of ideal gases / R
Extends from Modelica.Icons.Function (Icon for functions).
Name | Description |
---|---|
x[:] | Mole fraction of mixture [1] |
Name | Description |
---|---|
smix | Mixing entropy contribution, divided by gas constant |
Return temperature dependent part of the entropy, expects full entropy vector
Extends from Modelica.Icons.Function (Icon for functions).
Name | Description |
---|---|
T | Temperature [K] |
X[nX] | Mass fraction [kg/kg] |
Name | Description |
---|---|
s | Specific entropy [J/(kg.K)] |
Return isentropic exponent
Extends from (Return isentropic exponent).
Name | Description |
---|---|
state | Thermodynamic state record |
Name | Description |
---|---|
gamma | Isentropic exponent [1] |
Return velocity of sound
Extends from Modelica.Icons.Function (Icon for functions), (Return velocity of sound).
Name | Description |
---|---|
state | Thermodynamic state record |
Name | Description |
---|---|
a | Velocity of sound [m/s] |
Approximate method of calculating h_is from upstream properties and downstream pressure
Extends from Modelica.Icons.Function (Icon for functions).
Name | Description |
---|---|
p2 | Downstream pressure [Pa] |
state | Thermodynamic state at upstream location |
Name | Description |
---|---|
h_is | Isentropic enthalpy [J/kg] |
Return isentropic enthalpy
Extends from (Return isentropic enthalpy).
Name | Description |
---|---|
p_downstream | Downstream pressure [Pa] |
refState | Reference state for entropy |
exact | Flag whether exact or approximate version should be used |
Name | Description |
---|---|
h_is | Isentropic enthalpy [J/kg] |
Return viscosities of gas mixtures at low pressures (Wilke method)
Simplification of the kinetic theory (Chapman and Enskog theory)
approach neglecting the second-order effects.
This equation has been extensively tested (Amdur and Mason, 1958;
Bromley and Wilke, 1951; Cheung, 1958; Dahler, 1959; Gandhi and Saxena,
1964; Ranz and Brodowsky, 1962; Saxena and Gambhir, 1963a; Strunk, et
al., 1964; Vanderslice, et al. 1962; Wright and Gray, 1962). In most
cases, only nonpolar mixtures were compared, and very good results
obtained. For some systems containing hydrogen as one component, less
satisfactory agreement was noted. Wilke's method predicted mixture
viscosities that were larger than experimental for the H2-N2 system,
but for H2-NH3, it underestimated the viscosities.
Gururaja, et al. (1967) found that this method also overpredicted in
the H2-O2 case but was quite accurate for the H2-CO2 system.
Wilke's approximation has proved reliable even for polar-polar gas
mixtures of aliphatic alcohols (Reid and Belenyessy, 1960). The
principal reservation appears to lie in those cases where Mi>>Mj
and etai>>etaj.
Extends from Modelica.Icons.Function (Icon for functions).
Name | Description |
---|---|
yi[:] | Mole fractions [mol/mol] |
M[size(yi, 1)] | Mole masses [kg/mol] |
eta[size(yi, 1)] | Pure component viscosities [Pa.s] |
Name | Description |
---|---|
etam | Viscosity of the mixture [Pa.s] |
Return mixture dynamic viscosity
Extends from (Return dynamic viscosity).
Name | Description |
---|---|
state | Thermodynamic state record |
Name | Description |
---|---|
eta | Dynamic viscosity [Pa.s] |
Return the viscosity of gas mixtures without access to component viscosities (Chung, et. al. rules)
Equation to estimate the viscosity of gas mixtures at low pressures.
It is a simplification of an extension of the rigorous kinetic theory
of Chapman and Enskog to determine the viscosity of multicomponent
mixtures, at low pressures and with a factor to correct for molecule
shape and polarity.
The input argument Kappa is a special correction for highly polar substances such as
alcohols and acids.
Values of kappa for a few such materials:
Compound |
Kappa |
Compound |
Kappa |
Methanol |
0.215 |
n-Pentanol |
0.122 |
Ethanol |
0.175 |
n-Hexanol |
0.114 |
n-Propanol |
0.143 |
n-Heptanol |
0.109 |
i-Propanol |
0.143 |
Acetic Acid |
0.0916 |
n-Butanol |
0.132 |
Water |
0.076 |
i-Butanol |
0.132 |
Chung, et al. (1984) suggest that for other alcohols not shown in the
table:
kappa = 0.0682 + 4.704*[(number of -OH
groups)]/[molecular weight]
S.I. units relation for the
debyes:
1 debye = 3.162e-25 (J.m^3)^(1/2)
[1] THE PROPERTIES OF GASES AND LIQUIDS, Fifth Edition,
Bruce E. Poling, John M.
Prausnitz, John P. O'Connell.
[2] Chung, T.-H., M. Ajlan, L. L. Lee, and K. E. Starling: Ind. Eng.
Chem. Res., 27: 671 (1988).
[3] Chung, T.-H., L. L. Lee, and K. E. Starling; Ing. Eng. Chem.
Fundam., 23: 3 ()1984).
Extends from Modelica.Icons.Function (Icon for functions).
Name | Description |
---|---|
T | Temperature [K] |
Tc[nX] | Critical temperatures [K] |
Vcrit[nX] | Critical volumes (m3/mol) [m3/mol] |
w[nX] | Acentric factors |
mu[nX] | Dipole moments (debyes) |
MolecularWeights[nX] | Molecular weights (kg/mol) [kg/mol] |
y[nX] | Molar Fractions [mol/mol] |
kappa[nX] | Association Factors |
Name | Description |
---|---|
etaMixture | Mixture viscosity (Pa.s) [Pa.s] |
Return thermal conductivities of low-pressure gas mixtures (Mason and Saxena Modification)
This function applies the Masson and Saxena modification of the Wassiljewa Equation for the thermal conductivity for gas mixtures of n elements at low pressure.
For nonpolar gas mixtures errors will generally be less than 3 to 4%. For mixtures of nonpolar-polar and polar-polar gases, errors greater than 5 to 8% may be expected. For mixtures in which the sizes and polarities of the constituent molecules are not greatly different, the thermal conductivity can be estimated satisfactorily by a mole fraction average of the pure component conductivities.
Extends from Modelica.Icons.Function (Icon for functions).
Name | Description |
---|---|
y[:] | Mole fraction of the components in the gas mixture [mol/mol] |
T | Temperature [K] |
Tc[size(y, 1)] | Critical temperatures [K] |
Pc[size(y, 1)] | Critical pressures [Pa] |
M[size(y, 1)] | Molecular weights [kg/mol] |
lambda[size(y, 1)] | Thermal conductivities of the pure gases [W/(m.K)] |
Name | Description |
---|---|
lambdam | Thermal conductivity of the gas mixture [W/(m.K)] |
Return thermal conductivity for low pressure gas mixtures
Extends from (Return thermal conductivity).
Name | Description |
---|---|
state | Thermodynamic state record |
method | Method to compute single component thermal conductivity |
Name | Description |
---|---|
lambda | Thermal conductivity [W/(m.K)] |
Return isobaric expansion coefficient beta
Extends from (Return overall the isobaric expansion coefficient beta).
Name | Description |
---|---|
state | Thermodynamic state record |
Name | Description |
---|---|
beta | Isobaric expansion coefficient [1/K] |
Return isothermal compressibility factor
Extends from (Return overall the isothermal compressibility factor).
Name | Description |
---|---|
state | Thermodynamic state record |
Name | Description |
---|---|
kappa | Isothermal compressibility [1/Pa] |
Return density derivative by pressure at constant temperature
Extends from (Return density derivative w.r.t. pressure at const temperature).
Name | Description |
---|---|
state | Thermodynamic state record |
Name | Description |
---|---|
ddpT | Density derivative w.r.t. pressure [s2/m2] |
Return density derivative by temperature at constant pressure
Extends from (Return density derivative w.r.t. temperature at constant pressure).
Name | Description |
---|---|
state | Thermodynamic state record |
Name | Description |
---|---|
ddTp | Density derivative w.r.t. temperature [kg/(m3.K)] |
Return density derivative by mass fraction
Extends from Modelica.Icons.Function (Icon for functions).
Name | Description |
---|---|
state | Thermodynamic state record |
Name | Description |
---|---|
dddX[nX] | Derivative of density w.r.t. mass fraction [kg/m3] |
Return molar mass of mixture
Extends from (Return the molar mass of the medium).
Name | Description |
---|---|
state | Thermodynamic state record |
Name | Description |
---|---|
MM | Mixture molar mass [kg/mol] |
Return temperature from specific enthalpy and mass fraction
Extends from Modelica.Icons.Function (Icon for functions).
Name | Description |
---|---|
h | Specific enthalpy [J/kg] |
X[nX] | Mass fractions of composition [kg/kg] |
exclEnthForm | If true, enthalpy of formation Hf is not included in specific enthalpy h |
refChoice | Choice of reference enthalpy |
h_off | User defined offset for reference enthalpy, if referenceChoice = UserDefined [J/kg] |
Name | Description |
---|---|
T | Temperature [K] |
Return temperature from pressure, specific entropy and mass fraction
Extends from Modelica.Icons.Function (Icon for functions).
Name | Description |
---|---|
p | Pressure [Pa] |
s | Specific entropy [J/(kg.K)] |
X[nX] | Mass fractions of composition [kg/kg] |
Name | Description |
---|---|
T | Temperature [K] |