Thermodynamics
ClimateMachine.Thermodynamics — ModuleThermodynamicsMoist thermodynamic functions, e.g., for air pressure (atmosphere equation of state), latent heats of phase transitions, saturation vapor pressures, and saturation specific humidities.
AbstractParameterSet's
Many functions defined in this module rely on CLIMAParameters.jl. CLIMAParameters.jl defines several functions (e.g., many planet parameters). For example, to compute the mole-mass ratio:
using CLIMAParameters.Planet: molmass_ratio
using CLIMAParameters: AbstractEarthParameterSet
struct EarthParameterSet <: AbstractEarthParameterSet end
param_set = EarthParameterSet()
_molmass_ratio = molmass_ratio(param_set)Because these parameters are widely used throughout this module, param_set is an argument for many Thermodynamics functions.
Thermodynamic State Constructors
ClimateMachine.Thermodynamics.PhasePartition — TypePhasePartitionRepresents the mass fractions of the moist air mixture.
Constructors
PhasePartition(q_tot::Real[, q_liq::Real[, q_ice::Real]])
PhasePartition(ts::ThermodynamicState)See also PhasePartition_equil
Fields
tottotal specific humidity
liqliquid water specific humidity (default:
0)iceice specific humidity (default:
0)
ClimateMachine.Thermodynamics.PhasePartition_equil — FunctionPhasePartition_equil(param_set, T, ρ, q_tot, phase_type)Partition the phases in equilibrium, returning a PhasePartition object using the liquid_fraction function where
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperatureρ(moist-)air densityq_tottotal specific humidityphase_typea thermodynamic state type
The residual q.tot - q.liq - q.ice is the vapor specific humidity.
ClimateMachine.Thermodynamics.ThermodynamicState — TypeThermodynamicState{FT}A thermodynamic state, which can be initialized for various thermodynamic formulations (via its sub-types). All ThermodynamicState's have access to functions to compute all other thermodynamic properties.
ClimateMachine.Thermodynamics.PhaseDry — TypePhaseDry{FT} <: ThermodynamicStateA dry thermodynamic state (q_tot = 0).
Constructors
PhaseDry(param_set, e_int, ρ)Fields
param_setparameter set, used to dispatch planet parameter function calls
e_intinternal energy
ρdensity of dry air
ClimateMachine.Thermodynamics.PhaseDry_given_pT — FunctionPhaseDry_given_pT(param_set, p, T)Constructs a PhaseDry thermodynamic state from:
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsppressureTtemperature
ClimateMachine.Thermodynamics.PhaseDry_given_ρT — FunctionPhaseDry_given_ρT(param_set, ρ, T)Constructs a PhaseDry thermodynamic state from:
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsρdensityTtemperature
ClimateMachine.Thermodynamics.PhaseEquil — TypePhaseEquil{FT} <: ThermodynamicStateA thermodynamic state assuming thermodynamic equilibrium (therefore, saturation adjustment may be needed).
Constructors
PhaseEquil(param_set, e_int, ρ, q_tot)Fields
param_setparameter set, used to dispatch planet parameter function calls
e_intinternal energy
ρdensity of air (potentially moist)
q_tottotal specific humidity
Ttemperature: computed via
saturation_adjustment
ClimateMachine.Thermodynamics.PhaseNonEquil — TypePhaseNonEquil{FT} <: ThermodynamicState
A thermodynamic state assuming thermodynamic non-equilibrium (therefore, temperature can be computed directly).
Constructors
PhaseNonEquil(param_set, e_int, q::PhasePartition, ρ)Fields
param_setparameter set, used to dispatch planet parameter function calls
e_intinternal energy
ρdensity of air (potentially moist)
qphase partition
ClimateMachine.Thermodynamics.TemperatureSHumEquil — FunctionTemperatureSHumEquil(param_set, T, ρ, q_tot)Constructs a PhaseEquil thermodynamic state from temperature.
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperatureρdensityq_tottotal specific humidity
ClimateMachine.Thermodynamics.TemperatureSHumNonEquil — FunctionTemperatureSHumNonEquil(param_set, T, ρ, q_pt)Constructs a PhaseNonEquil thermodynamic state from:
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperatureρ(moist-)air densityq_ptphase partition
ClimateMachine.Thermodynamics.TemperatureSHumEquil_given_pressure — FunctionTemperatureSHumEquil_given_pressure(param_set, T, p, q_tot)Constructs a PhaseEquil thermodynamic state from temperature.
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperatureppressureq_tottotal specific humidity
ClimateMachine.Thermodynamics.LiquidIcePotTempSHumEquil — FunctionLiquidIcePotTempSHumEquil(param_set, θ_liq_ice, ρ, q_tot)Constructs a PhaseEquil thermodynamic state from:
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsθ_liq_iceliquid-ice potential temperatureρ(moist-)air densityq_tottotal specific humiditytemperature_toltemperature tolerance for saturation adjustmentmaxitermaximum iterations for saturation adjustment
ClimateMachine.Thermodynamics.LiquidIcePotTempSHumNonEquil — FunctionLiquidIcePotTempSHumNonEquil(param_set, θ_liq_ice, ρ, q_pt)Constructs a PhaseNonEquil thermodynamic state from:
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsθ_liq_iceliquid-ice potential temperatureρ(moist-)air densityq_ptphase partition
and, optionally
potential_temperature_tolpotential temperature for non-linear equation solvemaxitermaximum iterations for non-linear equation solve
ClimateMachine.Thermodynamics.LiquidIcePotTempSHumNonEquil_given_pressure — FunctionLiquidIcePotTempSHumNonEquil_given_pressure(param_set, θ_liq_ice, p, q_pt)Constructs a PhaseNonEquil thermodynamic state from:
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsθ_liq_iceliquid-ice potential temperatureppressureq_ptphase partition
ClimateMachine.Thermodynamics.LiquidIcePotTempSHumEquil_given_pressure — FunctionLiquidIcePotTempSHumEquil_given_pressure(param_set, θ_liq_ice, p, q_tot)Constructs a PhaseEquil thermodynamic state from:
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsθ_liq_iceliquid-ice potential temperatureppressureq_tottotal specific humiditytemperature_toltemperature tolerance for saturation adjustmentmaxitermaximum iterations for saturation adjustment
Thermodynamic state methods
ClimateMachine.Thermodynamics.air_density — Functionair_density(param_set, T, p[, q::PhasePartition])The (moist-)air density from the equation of state (ideal gas law) where
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTair temperatureppressure
and, optionally,
qPhasePartition. Without this argument, the results are for dry air.
air_density(ts::ThermodynamicState)The (moist-)air density, given a thermodynamic state ts.
ClimateMachine.Thermodynamics.air_pressure — Functionair_pressure(param_set, T, ρ[, q::PhasePartition])The air pressure from the equation of state (ideal gas law) where
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTair temperatureρ(moist-)air density
and, optionally,
qPhasePartition. Without this argument, the results are for dry air.
air_pressure(ts::ThermodynamicState)The air pressure from the equation of state (ideal gas law), given a thermodynamic state ts.
air_pressure(param_set, T::FT, T∞::FT, p∞::FT, ::DryAdiabaticProcess)The air pressure for an isentropic process, where
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperatureT∞ambient temperaturep∞ambient pressure
ClimateMachine.Thermodynamics.air_pressure_given_θ — Functionair_pressure_given_θ(param_set, θ::FT, Φ::FT, ::DryAdiabaticProcess)The air pressure for an isentropic process, where
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsθpotential temperatureΦgravitational potential
ClimateMachine.Thermodynamics.air_temperature — Functionair_temperature(param_set, e_int, q::PhasePartition)The air temperature, where
param_setanAbstractParameterSet, see theThermodynamicsfor more detailse_intinternal energy per unit mass
and, optionally,
qPhasePartition. Without this argument, the results are for dry air.
air_temperature(ts::ThermodynamicState)The air temperature, given a thermodynamic state ts.
air_temperature(param_set, p::FT, θ::FT, Φ::FT, ::DryAdiabaticProcess)The air temperature for an isentropic process, where
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsppressureθpotential temperature
ClimateMachine.Thermodynamics.air_temperature_from_ideal_gas_law — Functionair_temperature_from_ideal_gas_law(param_set, p, ρ, q::PhasePartition)The air temperature, where
param_setanAbstractParameterSet, see theThermodynamicsfor more detailspair pressureρair density
and, optionally,
qPhasePartition. Without this argument, the results are for dry air.
ClimateMachine.Thermodynamics.air_temperature_from_liquid_ice_pottemp — Functionair_temperature_from_liquid_ice_pottemp(param_set, θ_liq_ice, ρ, q::PhasePartition)The temperature given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsθ_liq_iceliquid-ice potential temperatureρ(moist-)air density
and, optionally,
qPhasePartition. Without this argument, the results are for dry air.
ClimateMachine.Thermodynamics.air_temperature_from_liquid_ice_pottemp_given_pressure — Functionair_temperature_from_liquid_ice_pottemp_given_pressure(
param_set,
θ_liq_ice,
p[, q::PhasePartition]
)The air temperature where
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsθ_liq_iceliquid-ice potential temperatureppressure
and, optionally,
qPhasePartition. Without this argument, the results are for dry air.
ClimateMachine.Thermodynamics.air_temperature_from_liquid_ice_pottemp_non_linear — Functionair_temperature_from_liquid_ice_pottemp_non_linear(param_set, θ_liq_ice, ρ, q::PhasePartition)Computes temperature T given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsθ_liq_iceliquid-ice potential temperatureρ(moist-)air densitytolabsolute tolerance for non-linear equation iterations. Can be one of:SolutionTolerance()to stop when|x_2 - x_1| < tolResidualTolerance()to stop when|f(x)| < tol
maxitermaximum iterations for non-linear equation solve
and, optionally,
qPhasePartition. Without this argument, the results are for dry air,
by finding the root of T - air_temperature_from_liquid_ice_pottemp_given_pressure(param_set, θ_liq_ice, air_pressure(param_set, T, ρ, q), q) = 0
ClimateMachine.Thermodynamics.condensate — Functioncondensate(q::PhasePartition{FT})
condensate(ts::ThermodynamicState)Condensate of the phase partition.
ClimateMachine.Thermodynamics.cp_m — Functioncp_m(param_set, [q::PhasePartition])The isobaric specific heat capacity of moist air given
param_setanAbstractParameterSet, see theThermodynamicsfor more details
and, optionally
qPhasePartition. Without this argument, the results are for dry air.
cp_m(ts::ThermodynamicState)The isobaric specific heat capacity of moist air, given a thermodynamic state ts.
ClimateMachine.Thermodynamics.cv_m — Functioncv_m(param_set, [q::PhasePartition])The isochoric specific heat capacity of moist air given
param_setanAbstractParameterSet, see theThermodynamicsfor more details
and, optionally
qPhasePartition. Without this argument, the results are for dry air.
cv_m(ts::ThermodynamicState)The isochoric specific heat capacity of moist air, given a thermodynamic state ts.
ClimateMachine.Thermodynamics.dry_pottemp — Functiondry_pottemp(param_set, T, ρ[, q::PhasePartition])The dry potential temperature where
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperatureρ(moist-)air density
and, optionally,
qPhasePartition. Without this argument, the results are for dry air.
dry_pottemp(ts::ThermodynamicState)The dry potential temperature, given a thermodynamic state ts.
ClimateMachine.Thermodynamics.dry_pottemp_given_pressure — Functiondry_pottemp_given_pressure(param_set, T, p[, q::PhasePartition])The dry potential temperature where
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperatureppressure
and, optionally,
qPhasePartition. Without this argument, the results are for dry air.
ClimateMachine.Thermodynamics.exner — Functionexner(param_set, T, ρ[, q::PhasePartition)])The Exner function where
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperatureρ(moist-)air density
and, optionally,
qPhasePartition. Without this argument, the results are for dry air.
exner(ts::ThermodynamicState)The Exner function, given a thermodynamic state ts.
ClimateMachine.Thermodynamics.exner_given_pressure — Functionexner_given_pressure(param_set, p[, q::PhasePartition])The Exner function where
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsppressure
and, optionally,
qPhasePartition. Without this argument, the results are for dry air.
ClimateMachine.Thermodynamics.gas_constant_air — Functiongas_constant_air(param_set, [q::PhasePartition])The specific gas constant of moist air given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsqPhasePartition. Without this argument, the results are for dry air.
gas_constant_air(ts::ThermodynamicState)The specific gas constant of moist air given a thermodynamic state ts.
ClimateMachine.Thermodynamics.gas_constants — Function(R_m, cp_m, cv_m, γ_m) = gas_constants(param_set, [q::PhasePartition])Wrapper to compute all gas constants at once, where optionally,
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsqPhasePartition. Without this argument, the results are for dry air.
The function returns a tuple of
R_mgas_constant_aircp_mcp_mcv_mcv_mγ_m = cp_m/cv_m
(R_m, cp_m, cv_m, γ_m) = gas_constants(ts::ThermodynamicState)Wrapper to compute all gas constants at once, given a thermodynamic state ts.
The function returns a tuple of
R_mgas_constant_aircp_mcp_mcv_mcv_mγ_m = cp_m/cv_m
ClimateMachine.Thermodynamics.has_condensate — Functionhas_condensate(q::PhasePartition{FT})
has_condensate(ts::ThermodynamicState)Bool indicating if condensate exists in the phase partition
ClimateMachine.Thermodynamics.Ice — TypeIce <: PhaseAn ice phase, to dispatch over saturation_vapor_pressure and q_vap_saturation_generic.
ClimateMachine.Thermodynamics.ice_specific_humidity — Functionice_specific_humidity(ts::ThermodynamicState)
ice_specific_humidity(q::PhasePartition)Ice specific humidity given
tsa thermodynamic state
or
qaPhasePartition
ClimateMachine.Thermodynamics.internal_energy — Functioninternal_energy(param_set, T[, q::PhasePartition])The internal energy per unit mass, given a thermodynamic state ts or
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperature
and, optionally,
qPhasePartition. Without this argument, the results are for dry air.
internal_energy(ts::ThermodynamicState)The internal energy per unit mass, given a thermodynamic state ts.
internal_energy(ρ::FT, ρe::FT, ρu::AbstractVector{FT}, e_pot::FT)The internal energy per unit mass, given
ρ(moist-)air densityρetotal energy per unit volumeρumomentum vectore_potpotential energy (e.g., gravitational) per unit mass
ClimateMachine.Thermodynamics.internal_energy_sat — Functioninternal_energy_sat(param_set, T, ρ, q_tot, phase_type)The internal energy per unit mass in thermodynamic equilibrium at saturation where
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperatureρ(moist-)air densityq_tottotal specific humidityphase_typea thermodynamic state type
internal_energy_sat(ts::ThermodynamicState)The internal energy per unit mass in thermodynamic equilibrium at saturation, given a thermodynamic state ts.
ClimateMachine.Thermodynamics.latent_heat_fusion — Functionlatent_heat_fusion(param_set, T::FT) where {FT<:Real}The specific latent heat of fusion where
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperature
latent_heat_fusion(ts::ThermodynamicState)The specific latent heat of fusion given a thermodynamic state ts.
ClimateMachine.Thermodynamics.latent_heat_liq_ice — Functionlatent_heat_liq_ice(param_set, q::PhasePartition{FT})Effective latent heat of condensate (weighted sum of liquid and ice), with specific latent heat evaluated at reference temperature T_0 given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsqPhasePartition. Without this argument, the results are for dry air.
ClimateMachine.Thermodynamics.latent_heat_sublim — Functionlatent_heat_sublim(param_set, T::FT) where {FT<:Real}The specific latent heat of sublimation where
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperature
latent_heat_sublim(ts::ThermodynamicState)The specific latent heat of sublimation given a thermodynamic state ts.
ClimateMachine.Thermodynamics.latent_heat_vapor — Functionlatent_heat_vapor(param_set, T::FT) where {FT<:Real}The specific latent heat of vaporization where
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperature
latent_heat_vapor(ts::ThermodynamicState)The specific latent heat of vaporization given a thermodynamic state ts.
ClimateMachine.Thermodynamics.Liquid — TypeLiquid <: PhaseA liquid phase, to dispatch over saturation_vapor_pressure and q_vap_saturation_generic.
ClimateMachine.Thermodynamics.liquid_fraction — Functionliquid_fraction(param_set, T, phase_type[, q])The fraction of condensate that is liquid where
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsphase_typea thermodynamic state type
PhaseNonEquil behavior
If q.liq or q.ice are nonzero, the liquid fraction is computed from them.
ThermodynamicState
Otherwise, phase equilibrium is assumed so that the fraction of liquid is a function that is 1 above T_freeze and goes to zero below T_freeze.
liquid_fraction(ts::ThermodynamicState)The fraction of condensate that is liquid given a thermodynamic state ts.
ClimateMachine.Thermodynamics.liquid_ice_pottemp — Functionliquid_ice_pottemp(param_set, T, ρ, q::PhasePartition)The liquid-ice potential temperature where
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperatureρ(moist-)air density
and, optionally,
qPhasePartition. Without this argument, the results are for dry air.
liquid_ice_pottemp(ts::ThermodynamicState)The liquid-ice potential temperature, given a thermodynamic state ts.
ClimateMachine.Thermodynamics.liquid_ice_pottemp_given_pressure — Functionliquid_ice_pottemp_given_pressure(param_set, T, p, q::PhasePartition)The liquid-ice potential temperature where
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperatureppressure
and, optionally,
qPhasePartition. Without this argument, the results are for dry air.
ClimateMachine.Thermodynamics.liquid_ice_pottemp_sat — Functionliquid_ice_pottemp_sat(param_set, T, ρ, phase_type[, q::PhasePartition])The saturated liquid ice potential temperature where
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperatureρ(moist-)air densityphase_typea thermodynamic state type
and, optionally,
qPhasePartition. Without this argument, the results are for dry air.
liquid_ice_pottemp_sat(param_set, T, ρ, phase_type, q_tot)The saturated liquid ice potential temperature where
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperatureρ(moist-)air densityphase_typea thermodynamic state typeq_tottotal specific humidity
liquid_ice_pottemp_sat(ts::ThermodynamicState)The liquid potential temperature given a thermodynamic state ts.
ClimateMachine.Thermodynamics.liquid_specific_humidity — Functionliquid_specific_humidity(ts::ThermodynamicState)
liquid_specific_humidity(q::PhasePartition)Liquid specific humidity given
tsa thermodynamic state
or
qaPhasePartition
ClimateMachine.Thermodynamics.moist_static_energy — Functionmoist_static_energy(ts, e_pot)Moist static energy, given
tsa thermodynamic statee_potpotential energy (e.g., gravitational) per unit mass
ClimateMachine.Thermodynamics.q_vap_saturation — Functionq_vap_saturation(param_set, T, ρ, phase_type[, q::PhasePartition])Compute the saturation specific humidity, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperatureρ(moist-)air densityphase_typea thermodynamic state type
and, optionally,
If the PhasePartition q is given, the saturation specific humidity is that of a mixture of liquid and ice, computed in a thermodynamically consistent way from the weighted sum of the latent heats of the respective phase transitions (Pressel et al., JAMES, 2015). That is, the saturation vapor pressure and from it the saturation specific humidity are computed from a weighted mean of the latent heats of vaporization and sublimation, with the weights given by the fractions of condensates q.liq/(q.liq + q.ice) and q.ice/(q.liq + q.ice) that are liquid and ice, respectively.
If the PhasePartition q is not given, or has zero liquid and ice specific humidities, the saturation specific humidity is that over a mixture of liquid and ice, with the fraction of liquid given by temperature dependent liquid_fraction(param_set, T, phase_type) and the fraction of ice by the complement 1 - liquid_fraction(param_set, T, phase_type).
q_vap_saturation(ts::ThermodynamicState)Compute the saturation specific humidity, given a thermodynamic state ts.
ClimateMachine.Thermodynamics.q_vap_saturation_liquid — Functionq_vap_saturation_liquid(ts::ThermodynamicState)Compute the saturation specific humidity over liquid, given a thermodynamic state ts.
ClimateMachine.Thermodynamics.q_vap_saturation_ice — Functionq_vap_saturation_ice(ts::ThermodynamicState)Compute the saturation specific humidity over ice, given a thermodynamic state ts.
ClimateMachine.Thermodynamics.q_vap_saturation_generic — Functionq_vap_saturation_generic(param_set, T, ρ[, phase=Liquid()])Compute the saturation specific humidity over a plane surface of condensate, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperatureρ(moist-)air density
and, optionally,
Liquid()indicating condensate is liquidIce()indicating condensate is ice
ClimateMachine.Thermodynamics.relative_humidity — Functionrelative_humidity(param_set, T, p, phase_type, q::PhasePartition)The relative humidity, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsppressurephase_typea thermodynamic state type
and, optionally,
qPhasePartition. Without this argument, the results are for dry air.
relative_humidity(ts::ThermodynamicState)The relative humidity, given a thermodynamic state ts.
ClimateMachine.Thermodynamics.saturated — Functionsaturated(ts::ThermodynamicState)Boolean indicating if thermodynamic state is saturated.
ClimateMachine.Thermodynamics.saturation_adjustment — Functionsaturation_adjustment(
param_set,
e_int,
ρ,
q_tot,
phase_type,
maxiter,
temperature_tol
)Compute the temperature that is consistent with
param_setanAbstractParameterSet, see theThermodynamicsfor more detailse_intinternal energyρ(moist-)air densityq_tottotal specific humidityphase_typea thermodynamic state typemaxitermaximum iterations for non-linear equation solvetemperature_toltemperature tolerance
by finding the root of
e_int - internal_energy_sat(param_set, T, ρ, q_tot, phase_type) = 0
using Newtons method with analytic gradients.
See also saturation_adjustment.
ClimateMachine.Thermodynamics.saturation_excess — Functionsaturation_excess(param_set, T, ρ, phase_type, q::PhasePartition)The saturation excess in equilibrium where
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperatureρ(moist-)air densityphase_typea thermodynamic state typeqPhasePartition
The saturation excess is the difference between the total specific humidity q.tot and the saturation specific humidity in equilibrium, and it is defined to be nonzero only if this difference is positive.
saturation_excess(ts::ThermodynamicState)Compute the saturation excess in equilibrium, given a thermodynamic state ts.
ClimateMachine.Thermodynamics.saturation_vapor_pressure — Functionsaturation_vapor_pressure(param_set, T, Liquid())Return the saturation vapor pressure over a plane liquid surface given
Ttemperatureparam_setanAbstractParameterSet, see theThermodynamicsfor more detailssaturation_vapor_pressure(param_set, T, Ice())
Return the saturation vapor pressure over a plane ice surface given
Ttemperatureparam_setanAbstractParameterSet, see theThermodynamicsfor more detailssaturation_vapor_pressure(param_set, T, LH_0, Δcp)
Compute the saturation vapor pressure over a plane surface by integration of the Clausius-Clapeyron relation.
The Clausius-Clapeyron relation
`dlog(p_v_sat)/dT = [LH_0 + Δcp * (T-T_0)]/(R_v*T^2)`is integrated from the triple point temperature T_triple, using Kirchhoff's relation
`L = LH_0 + Δcp * (T - T_0)`for the specific latent heat L with constant isobaric specific heats of the phases. The linear dependence of the specific latent heat on temperature T allows analytic integration of the Clausius-Clapeyron relation to obtain the saturation vapor pressure p_v_sat as a function of the triple point pressure press_triple.
ClimateMachine.Thermodynamics.soundspeed_air — Functionsoundspeed_air(param_set, T[, q::PhasePartition])The speed of sound in unstratified air, where
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperature
and, optionally,
qPhasePartition. Without this argument, the results are for dry air.
soundspeed_air(ts::ThermodynamicState)The speed of sound in unstratified air given a thermodynamic state ts.
ClimateMachine.Thermodynamics.specific_enthalpy — Functionspecific_enthalpy(e_int, R_m, T)Specific enthalpy, given
e_intinternal specific energyR_mgas_constant_airTair temperature
specific_enthalpy(ts)Specific enthalpy, given a thermodynamic state ts.
ClimateMachine.Thermodynamics.specific_volume — Functionspecific_volume(ts::ThermodynamicState)The (moist-)air specific volume, given a thermodynamic state ts.
ClimateMachine.Thermodynamics.supersaturation — Functionsupersaturation(param_set, q, ρ, T, Liquid())
supersaturation(param_set, q, ρ, T, Ice())param_set- abstract set with earth parametersq- phase partitionρ- air density,T- air temperatureLiquid(),Ice()- liquid or ice phase to dispatch over.
Returns supersaturation (qv/qv_sat -1) over water or ice.
ClimateMachine.Thermodynamics.temperature_and_humidity_from_virtual_temperature — Functiontemperature_and_humidity_from_virtual_temperature(param_set, T_virt, ρ, RH)The air temperature and q_tot where
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsT_virtvirtual temperatureρair densityRHrelative humidityphase_typea thermodynamic state type
ClimateMachine.Thermodynamics.total_energy — Functiontotal_energy(param_set, e_kin, e_pot, T[, q::PhasePartition])The total energy per unit mass, given
param_setanAbstractParameterSet, see theThermodynamicsfor more detailse_kinkinetic energy per unit masse_potpotential energy per unit massTtemperature
and, optionally,
qPhasePartition. Without this argument, the results are for dry air.
total_energy(e_kin, e_pot, ts::ThermodynamicState)The total energy per unit mass given a thermodynamic state ts.
ClimateMachine.Thermodynamics.total_specific_enthalpy — Functiontotal_specific_enthalpy(e_tot, R_m, T)Total specific enthalpy, given
e_tottotal specific energyR_mgas_constant_airTair temperature
total_specific_enthalpy(ts)Total specific enthalpy, given
e_tottotal specific energytsa thermodynamic state
ClimateMachine.Thermodynamics.total_specific_humidity — Functiontotal_specific_humidity(ts::ThermodynamicState)
total_specific_humidity(param_set, T, p, relative_humidity)Total specific humidity given
tsa thermodynamic state
or
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperatureppressurerelative_humidityrelative humidity (can exceed 1 when there is super saturation/condensate)
ClimateMachine.Thermodynamics.vapor_specific_humidity — Functionvapor_specific_humidity(q::PhasePartition{FT})The vapor specific humidity, given a PhasePartition q.
ClimateMachine.Thermodynamics.virtual_pottemp — Functionvirtual_pottemp(param_set, T, ρ[, q::PhasePartition])The virtual potential temperature where
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperatureρ(moist-)air density
and, optionally,
qPhasePartition. Without this argument, the results are for dry air.
virtual_pottemp(ts::ThermodynamicState)The virtual potential temperature, given a thermodynamic state ts.
ClimateMachine.Thermodynamics.virtual_temperature — Functionvirtual_temperature(param_set, T, ρ[, q::PhasePartition])The virtual temperature where
param_setanAbstractParameterSet, see theThermodynamicsfor more detailsTtemperatureρ(moist-)air density
and, optionally,
qPhasePartition. Without this argument, the results are for dry air.
virtual_temperature(ts::ThermodynamicState)The virtual temperature, given a thermodynamic state ts.
Dispatch types
ClimateMachine.Thermodynamics.DryAdiabaticProcess — TypeDryAdiabaticProcessFor dispatching to isentropic formulas