density

typhon.physics.density(p, T, R=287.0570048852906)[source]

Calculates gas density by ideal gas law.

\[\rho = \frac{p}{R \cdot T}\]
Parameters:
  • p (float or ndarray) – Pressure [Pa.]

  • T (float or ndarray) – Temperature [K]. If type of T and p is ndarray, size must match p.

  • R (float) – Gas constant [J K^-1 kg^-1]. Default is gas constant for dry air.

Returns:

Density [kg/m**3].

Return type:

float or ndarray

See also

typhon.constants

Module containing universal gas constant as well as gas constants for dry air and water vapor.

Examples

>>> density(1013e2, 300)
1.1763056653021122