Physical constants

Warning

This page is a work in progress. If you have any questions or notice any errors, please raise an issue.

Overview

PhysicalConstants collects fundamental physical constants used throughout Terrarium's process implementations. All constants are stored as fields of a single struct so that they are passed explicitly through the call graph — avoiding global state and keeping the code fully differentiable with Enzyme.jl. The struct is parametrically typed so that constants are automatically promoted to the model's numeric precision NF.

Terrarium.PhysicalConstantsType
struct PhysicalConstants{NF}

A collection of general physical constants that do not (usually) need to be varied in parameter calibration.

Properties:

  • ρw: Density of water in kg/m^3

  • ρi: Density of ice in kg/m^3

  • ρₐ: Density of air at standard pressure and 0°C in kg/m^3

  • cₐ: Specific heat capacity of dry air at standard pressure and 0°C in J/(m^3*K)

  • Lsl: Sepcific latent heat of fusion of water in J/kg

  • Llg: Specific latent heat of vaporization of water in J/kg

  • Lsg: Specific latent heat of sublimation of water in J/kg

  • g: Gravitational constant in m/s^2

  • Tref: Reference temperature (0°C in Kelvin)

  • σ: Stefan-Boltzmann constant in J/(sm^2K^4)

  • κ: von Kármán constant

  • ε: Ratio of molecular weight of water vapor to dry air

  • Rₐ: Specific gas constant of air in J/(kg*K)

  • C_mass: Atomic mass of carbon [gC/mol]

source

Default values follow standard references. Individual constants can be overridden at construction to support unit-testing or sensitivity studies.

FieldSymbolDefaultUnitsDescription
ρw$\rho_w$1000.0kg/m³Density of liquid water
ρi$\rho_i$916.2kg/m³Density of ice
ρₐ$\rho_a$1.293kg/m³Density of dry air at 0°C, 1 atm
cₐ$c_a$1005.7J/(kg·K)Specific heat of dry air
Lsl$L_{sl}$3.34×10⁵J/kgLatent heat of fusion
Llg$L_{lv}$2.257×10⁶J/kgLatent heat of vaporization
Lsg$L_{sg}$2.834×10⁶J/kgLatent heat of sublimation
g$g$9.80665m/s²Gravitational acceleration
Tref$T_{\text{ref}}$273.15KReference temperature (0°C)
σ$\sigma$5.6704×10⁻⁸W/(m²·K⁴)Stefan-Boltzmann constant
κ$\kappa$0.4von Kármán constant
ε$\varepsilon$0.622Ratio of molecular weights $M_v / M_d$
Rₐ$R_a$287.058J/(kg·K)Specific gas constant of dry air
C_mass12.0gC/molMolar mass of carbon

Methods

Terrarium.stefan_boltzmannFunction
stefan_boltzmann(c::PhysicalConstants, T, ϵ)

Stefan-Boltzmann law $M = \epsilon \sigma T^4$ where T is the surface temperature in Kelvin and ϵ is the emissivity.

source
Terrarium.compute_vpdFunction
compute_vpd(c, pres, q_air, T)

Computes the vapor pressure deficit over a surface at temperature T from the given surface pressure pres and specific humidity of air q_air.

source
compute_vpd(
    i,
    j,
    grid,
    fields,
    atmos::Terrarium.AbstractAtmosphere,
    c::PhysicalConstants
) -> Any
compute_vpd(
    i,
    j,
    grid,
    fields,
    atmos::Terrarium.AbstractAtmosphere,
    c::PhysicalConstants,
    Ts
) -> Any

Computes the vapor pressure deficit over a surface at temperature Ts from the current atmospheric fields.

source