Gas

Use the Gas class to calculate gas phase properties.

class chemics.Gas(formula, temperature, pressure=101325, cas_number=None)[source]

Gas properties class.

Parameters:
  • formula (str) – Molecular formula of the gas.

  • temperature (float) – Temperature of the gas in kelvin (K).

  • pressure (float, optional) – Pressure of the gas in pascal (Pa). Default value is 101,325 Pa for standard atmosphere.

  • cas_number (str, optional) – CAS (Chemical Abstracts Service) number of the gas, may be required for some species.

Variables:
  • formula (str) – Molecular formula of the gas.

  • temperature (float) – Temperature of the gas in kelvin (K).

  • pressure (float) – Pressure of the gas in pascal (Pa).

  • cas_number (str, optional) – CAS (Chemical Abstracts Service) number of the gas, may be required for some species.

  • molecular_weight (float) – Molecular weight of the gas in g/mol.

density()[source]

Gas density.

Calculate gas density using the molecular weight, pressure, and temperature of the gas.

Returns:

rho (float) – Density of the gas in kg/m3.

Examples

>>> gas = cm.Gas('N2', 773)
>>> gas.density()
0.4416...
heat_capacity()[source]

Gas heat capacity.

Calculate gas heat capacity as a function of temperature using Yaws’ coefficients [1]. The CAS (Chemical Abstracts Service) number may be required for some species.

\[C_p = A + B\,T + C\,T^2 + D\,T^3 + E\,T^4 + F\,T^5 + G\,T^6\]
Raises:
  • ValueError – If provided CAS number is not found.

  • ValueError – If multiple substances found for given formula.

  • ValueError – If gas chemical formula not found.

  • ValueError – If given temperataure is out of range for calculation.

Returns:

cp (float) – Heat capacity of the gas in J/(mol⋅K).

Examples

>>> gas = cm.Gas('CBrClF2', 700)
>>> gas.heat_capacity()
97.4982...
>>> gas = cm.Gas('C5H10O2', 850, cas_number='75-98-9')
>>> gas.heat_capacity()
268.4920...
>>> gas = cm.Gas('NO2', 900)
>>> gas.heat_capacity()
51.0686...

References

thermal_conductivity()[source]

Gas thermal conductivity.

Calculate gas thermal conductivity as a function of temperature using Yaws’ coefficients [2]. The CAS (Chemical Abstracts Service) number may be required for some species.

Raises:
  • ValueError – If provided CAS number is not found.

  • ValueError – If multiple substances found for given formula.

  • ValueError – If gas chemical formula not found.

  • ValueError – If given temperataure is out of range for calculation.

Returns:

k (float) – Thermal conductivity of the gas in W/(m⋅K).

Examples

>>> gas = cm.Gas('N2', 773)
>>> gas.thermal_conductivity()
0.0535...
>>> gas = cm.Gas('C18H38O', 920, cas_number='593-32-8')
>>> gas.thermal_conductivity()
0.0417...

References

viscosity(method='yaws')[source]

Gas viscosity.

Calculate gas viscosity as a function of temperature using Ludwig’s coefficients [3] or Yaws’ coefficients [4]. The CAS (Chemical Abstracts Service) number may be required for some species.

The Ludwig coefficients are used with the following correlation

\[\mu = A + B\,T + C\,T^2\]

The Yaws coefficients are used with the following correlation

\[\mu = A + B\,T + C\,T^2 + D\,T^3\]
Parameters:

method (str, optional) – Method for determining coefficients, choose yaws or ludwig. Default method is yaws.

Raises:
  • ValueError – If provided CAS number is not found.

  • ValueError – If multiple substances found for given formula.

  • ValueError – If gas chemical formula not found.

  • ValueError – If given temperataure is out of range for calculation.

Returns:

mu (float) – Gas viscosity in microPoise (μP).

Examples

>>> gas = cm.Gas('CH4', 810)
>>> gas.viscosity(method='yaws')
234.21...
>>> gas = cm.Gas('C2Cl2F4', 900, cas_number='374-07-2')
>>> gas.viscosity()
314.90...
>>> gas = cm.Gas('H2', 404)
>>> gas.viscosity()
113.18...
>>> gas = cm.Gas('NH3', 850)
>>> gas.viscosity(method='ludwig')
300.84...
>>> gas = cm.Gas('C2H4O', 920, cas_number='75-07-0')
>>> gas.viscosity(method='ludwig')
242.46...

References