optmat.gas.transport#

The dilute gases’ transport properties: viscosity, heat capacity, molar mass.

OEP 1, sections 4.3 and 6.5. For each gas a TransportModel gives

  • the dilute-gas shear viscosity eta(T), Pa s: the zero-density limit, a function of temperature alone, as kinetic theory and Wilke’s rule assume;

  • the ideal-gas molar isobaric heat capacity c_p0(T), J/(mol K): the temperature derivative of the ideal-gas part of the gas’s equation of state, not a value at a finite pressure; for the noble gases (5/2) R;

  • the molar mass M, kg/mol, the one the equation of state uses.

The source of each gas’s viscosity and heat capacity is curated in data/gas/transport.toml, with its temperatures and its stated uncertainty:

  • CoolProp’s correlation, evaluated at 1e-6 mol/m^3, where it implements a curated paper (He, Ar, H2, N2, O2, CH4, CO2, SF6; each reproduces its paper’s printed dilute form to below 1e-9; CH4’s states no uncertainty, provisional);

  • Huber’s dilute Chapman-Enskog form with his Lennard-Jones parameters and F_c (Ne, Kr, Xe, N2O; huber_2018), the models of the NIST WebBook’s tables, which serve as the check;

  • Assael, Mixafendi and Wakeham’s correlation for D2 (assael_1987): their hydrogen correlation (assael_1986, Eqs. 1 and 3) with the D2 mass, times the D2 paper’s quantum factor 1 - exp(-f T*^(1/3)) (its Eq. 7), which reproduces its Table 2, the check, within the table’s rounding (TC-765, TC-839).

c_p0 keeps the CODATA convention of optmat.gas.eos: the equation’s dimensionless c_p0 / R times CODATA’s R, so the noble gases give (5/2) R exactly whatever gas constant their equation was published with.

mixture_viscosity() is Wilke’s rule (wilke_1950), a kinetic-theory approximation: 0.97 % on average for his binary mixtures, 1.9 % for multicomponent ones. The ideal mixture’s heat capacity is sum_i x_i c_p0,i. What combines these for a flow problem (a sound speed, a mean free path) stays in the caller.

Module Attributes

EVALUATION_VERSION

The version of this module's evaluation code, in every transport model's identity; raised whenever the code changes its output (OEP 1, section 4.8).

QUANTITIES

The temperature-dependent quantities of a TransportModel.

TRANSPORT_GASES

The thirteen gases with a curated transport model.

Functions

heat_capacity(gas, temperature)

Return a gas's ideal-gas molar isobaric heat capacity.

mixture_viscosity(mixture, temperature)

Return a gas mixture's dilute viscosity by Wilke's rule.

molar_mass(gas)

Return a gas's molar mass, the one its equation of state uses.

transport_model(gas)

Return a gas's transport model.

viscosity(gas, temperature)

Return a gas's dilute-gas shear viscosity.

Classes

TransportModel(material, viscosity_form, ...)

A gas's dilute viscosity, ideal-gas heat capacity and molar mass.

optmat.gas.transport.EVALUATION_VERSION: Final = 1#

The version of this module’s evaluation code, in every transport model’s identity; raised whenever the code changes its output (OEP 1, section 4.8).

optmat.gas.transport.QUANTITIES: Final = ('viscosity', 'heat_capacity')#

The temperature-dependent quantities of a TransportModel.

optmat.gas.transport.TRANSPORT_GASES: Final[tuple[str, ...]] = ('He', 'Ne', 'Ar', 'Kr', 'Xe', 'H2', 'D2', 'N2', 'O2', 'CH4', 'SF6', 'N2O', 'CO2')#

The thirteen gases with a curated transport model.

class optmat.gas.transport.TransportModel(material, viscosity_form, viscosity_source, viscosity_parameters, viscosity_range, viscosity_uncertainty, heat_capacity_source, heat_capacity_range, equation_of_state, molar_mass, *, status='user', status_reason='', modified=(), base='')[source]#

Bases: Identified

A gas’s dilute viscosity, ideal-gas heat capacity and molar mass.

Attributes:
materialstr

The gas.

viscosity_formstr

"coolprop", "chapman_enskog" or "assael".

viscosity_sourcestr

The source record of the viscosity, or "" where none is in hand.

viscosity_parametersMapping

What the form evaluates: CoolProp’s fluid and correlation key; Huber’s constants; or Assael et al.’s constants, the molar mass (kg/mol) and the source of the collision integral (collision_source).

viscosity_rangetuple of float

The viscosity’s temperatures, K.

viscosity_uncertaintystr

Its stated uncertainty, as the source states it.

heat_capacity_sourcestr

The source record of the ideal-gas part, or "" where none is in hand.

heat_capacity_rangetuple of float

The heat capacity’s temperatures, K: the equation of state’s, or less where CoolProp’s ideal part meets its source over less (O2).

equation_of_stateEquationOfState

The gas’s equation of state, whose ideal part gives c_p0 and whose temperatures bound it; its digest enters this model’s.

molar_massfloat

kg/mol, the equation of state’s.

statusstr

validated, or provisional where status_reason says why.

EVALUATES_THROUGH: ClassVar[tuple[str, ...]] = ('optmat.gas.transport',)#
EVALUATION_VERSION: ClassVar[int] = 1#
IDENTITY_KIND: ClassVar[str] = 'transport'#
equation_of_state: EquationOfState#
heat_capacity(temperature)[source]#

Return the ideal-gas molar isobaric heat capacity.

Parameters:
temperaturearray_like or float

K, within temperature_range() ("heat_capacity").

Returns:
numpy.ndarray

J/(mol K), the shape of temperature: the equation’s c_p0 / R times CODATA’s R.

Raises:
StateError

Outside the range.

Examples

>>> f"{float(transport_model('Ar').heat_capacity(294.0)):.6f}"
'20.786157'
heat_capacity_range: tuple[float, float]#
heat_capacity_source: str#
material: str#
molar_mass: float#
temperature_range(quantity)[source]#

Return the temperatures a quantity is defined over.

Parameters:
quantitystr

One of QUANTITIES.

Returns:
tuple of float
Raises:
OptmatError

For an unknown quantity.

Examples

>>> transport_model("CO2").temperature_range("viscosity")
(200.0, 2000.0)
viscosity(temperature)[source]#

Return the dilute-gas shear viscosity.

Parameters:
temperaturearray_like or float

K, within temperature_range() ("viscosity").

Returns:
numpy.ndarray

Pa s, the shape of temperature.

Raises:
StateError

Outside the range.

Examples

>>> f"{float(transport_model('N2').viscosity(294.0)):.5e}"
'1.75991e-05'
viscosity_form: str#
viscosity_parameters: Mapping[str, Any]#
viscosity_range: tuple[float, float]#
viscosity_source: str#
viscosity_uncertainty: str#
optmat.gas.transport.heat_capacity(gas, temperature)[source]#

Return a gas’s ideal-gas molar isobaric heat capacity.

Parameters:
gasGas or str

One of TRANSPORT_GASES.

temperaturearray_like or float
Returns:
numpy.ndarray

J/(mol K); TransportModel.heat_capacity().

Examples

>>> f"{float(heat_capacity('N2', 294.0)):.4f}"
'29.1232'
optmat.gas.transport.mixture_viscosity(mixture, temperature)[source]#

Return a gas mixture’s dilute viscosity by Wilke’s rule.

eta = sum_i x_i eta_i / sum_j x_j Phi_ij with Phi_ij = [1 + (eta_i/eta_j)^(1/2) (M_j/M_i)^(1/4)]^2 / [8 (1 + M_i/M_j)]^(1/2) (Wilke 1950, Eqs. 13-14; average error 0.97 % for his binaries, 1.9 % for multicomponent mixtures).

Parameters:
mixturestr or Mapping

A named composition, or gases to mole fractions summing to one.

temperaturearray_like or float

K, within every constituent’s viscosity range.

Returns:
numpy.ndarray

Pa s, the shape of temperature.

Examples

>>> f"{float(mixture_viscosity({'He': 0.5, 'Ar': 0.5}, 294.0)):.4e}"
'2.3335e-05'
optmat.gas.transport.molar_mass(gas)[source]#

Return a gas’s molar mass, the one its equation of state uses.

Parameters:
gasGas or str

One of TRANSPORT_GASES.

Returns:
float

The molar mass, kg/mol.

Examples

>>> molar_mass("Ar")
0.039948
optmat.gas.transport.transport_model(gas)[source]#

Return a gas’s transport model.

Parameters:
gasGas or str

One of TRANSPORT_GASES.

Returns:
TransportModel

Its viscosity, heat capacity and molar mass, with its identity.

Raises:
OptmatError

For a gas without one (O3, CO).

Examples

>>> transport_model("Xe").viscosity_source
'huber_2018'
optmat.gas.transport.viscosity(gas, temperature)[source]#

Return a gas’s dilute-gas shear viscosity.

Parameters:
gasGas or str

One of TRANSPORT_GASES.

temperaturearray_like or float
Returns:
numpy.ndarray

Pa s; TransportModel.viscosity().

Examples

>>> f"{float(viscosity('He', 294.0)):.5e}"
'1.96527e-05'