Thermodynamics
- AnelasticThermodynamics
model
atmospheric_dynamics
clark1977
Anelastic thermodynamics equation (the first law of thermodynamics) with Smagorinsky turbulent heat flux, from Clark (1977), 'A Small-Scale Dynamic Model Using a Terrain-Following Coordinate Transformation'. Given the base-state air density rho_bar, the eddy heat diffusivity K_H, and the potential-temperature gradients, the component computes the three turbulent heat-flux components H1, H2, H3 = rho_bar*K_H*grad(theta) (Eq. 2.19), the heat-flux divergence term div_H = -div(H), and the residual of the anelastic thermodynamic equation rho_bar*dtheta/dt = -div(H) (Eq. 2.14) — which vanishes for an energy-conserving solution. Five purely-algebraic equations, no time integration. Migrated from AtmosphericDynamics.jl@816cc391 src/clark1977.jl:426 (`AnelasticThermodynamics` @component).
- AtmosphericThermodynamics
model
atmospheric_dynamics
sp_ch1
Atmospheric thermodynamic profile for an isothermal atmosphere: given altitude and temperature it computes the scale height H = R*T/(M_air*g) (Eq. 1.4), the atmospheric pressure p = p_0*exp(-z/H) from the barometric formula (Eq. 1.5), the air density rho = M_air*p/(R*T) from the ideal gas law (Eq. 1.2), and the total molar concentration c_total = p/(R*T) (Eq. 1.7). Migrated from AtmosphericDynamics.jl@816cc391 src/seinfeld_pandis_ch1.jl:479 (`AtmosphericThermodynamics` @component). Implements Seinfeld & Pandis (2006) Chapter 1 Equations 1.2, 1.4, 1.5, 1.7. Despite the upstream docstring describing it as 'combining' equations from other components, the Julia @component is a flat model — it re-derives the four equations directly via `System(eqs, t; name)` with no MTK subsystems — so it is migrated here as a flat algebraic model (not subsystem-composed), mirroring the structurally identical sibling pressure_profile.esm. Parameterized as observed-only: altitude z and temperature T are inputs (parameters in standalone form, with R, M_air, g, p_0 as further parameter inputs carrying their upstream @constant values), and H, p, rho, c_total are the four algebraic outputs. The upstream `5.9 AtmosphericThermodynamics Compilation` test compiles the component with `inputs = [at_nns.T]`, confirming T is an input.
- BinaryMolality
model
aerosol
isorropia
Binary aqueous molality of an inorganic salt as a function of relative humidity, using the 5th-order polynomial fit from Table 7 of Fountoukis and Nenes (2007). The polynomial m_aw(RH) = (k_0 + k_1*RH + k_2*RH^2 + k_3*RH^3 + k_4*RH^4 + k_5*RH^5) * m_one is used in Equation 16 of ISORROPIA II to compute the ZSR water content contribution from each salt. Multiple BinaryMolality instances (one per salt) are composed into the Aqueous component. Migrated from Aerosol.jl src/isorropia/aqueous.jl BinaryMolality (esm-406).
- CloudDynamics
model
aerosol
cloud_physics
Adiabatic cooling and cloud-base thermodynamics — Seinfeld & Pandis (2006), Ch. 17. Computes five purely-algebraic quantities that characterize when and where a lifted air parcel reaches its lifting condensation level (LCL): the dry adiabatic lapse rate Γ_d, the saturation vapor pressure p_sat (Magnus formula), the saturation mixing ratio w_vs, the dew-point temperature T_d (Eq. 17.43), and the LCL height h_LCL (Eq. 17.49). Migrated from Aerosol.jl CloudDynamics.
- CloudKelvinEffect
model
aerosol
cloud_physics
Kelvin effect on the equilibrium vapor pressure over a curved cloud droplet surface — Seinfeld & Pandis (2006), Ch. 17. Computes the Kelvin length parameter A_K = 4 σ_w M_w / (R T ρ_w) and the Kelvin saturation ratio S_K = exp(A_K / D_p), the factor by which surface curvature enhances equilibrium vapor pressure over a small droplet relative to a flat surface. Used as the curvature term in the Köhler equation (Eq. 17.27). Migrated from Aerosol.jl CloudKelvinEffect.
- CloudPhysics
model
aerosol
cloud_physics
Composed cloud microphysics model (Seinfeld & Pandis 2006, Ch. 17). Flat composition of CloudDynamics (adiabatic thermodynamics, LCL height), IcePhysics (freezing point depression, ice nuclei), RainFormation (collision-coalescence, raindrop spectra), and AerosolScavenging (scavenging ratios and coefficient). Shared physical constants M_w and R unify CloudDynamics and IcePhysics. Ice particle diameter (D_p_ice) and collector drop diameter (D_p_rain) are kept as independent parameters. Migrated from Aerosol.jl src/cloud_physics.jl:735 (esm-c8z).
- CloudWaterProperties
model
aerosol
cloud_physics
Thermodynamic properties of water and aqueous solutions for cloud-physics calculations: temperature offset, specific heat of liquid water, latent heats of vaporization and melting, surface tension, and saturation vapor pressure over water and ice. Based on Seinfeld & Pandis (2006), Chapter 17, Equations 17.1–17.6 and Table 17.2. Migrated from Aerosol.jl src/cloud_physics.jl:15.
- DRHTemperature
model
aerosol
sp_ch10
Temperature-dependent deliquescence relative humidity (DRH) of a crystalline inorganic salt — Seinfeld & Pandis (2006), Atmospheric Chemistry and Physics, 2nd ed., Chapter 10, Equation 10.72. DRH is the relative humidity at which a crystalline salt spontaneously absorbs water and forms a saturated aqueous solution; it shifts away from its 298 K reference value with temperature according to the salt's enthalpy of solution and its solubility-vs-temperature polynomial. Migrated from Aerosol.jl DRHTemperature at the upstream default parameterization salt = :NH4NO3.
- EqConst
model
aerosol
isorropia
Equilibrium constant parameterized by Equation 5 of Fountoukis and Nenes (2007): log K(T) = log K(T0) + H_coeff*(T0/T - 1) + C_coeff*(1 + ln(T0/T) - T0/T), where T0 = 298.15 K. Migrated from Aerosol.jl@c8c640bb src/isorropia/equilibria.jl:5 (`EqConst` @component). Parameters logK0, H_coeff, and C_coeff are reaction-specific values from Table 2 of Fountoukis and Nenes (2007). T is an input (driven by parent EquilibriumConstants in the coupled system); logK_eq is an algebraically observed output.
- EquilibriumConstants
model
aerosol
isorropia
Aggregated equilibrium constants for ISORROPIA II. Composes 27 EqConst sub-components (r1...r27) from Table 2 of Fountoukis and Nenes (2007). Each ri.logK_eq(T) = logK0_i + H_i*(T0/T-1) + C_i*(1+ln(T0/T)-T0/T). A single T is broadcast to all subsystems via coupling equations. Migrated from Aerosol.jl@c8c640bb src/isorropia/equilibria.jl:22 (esm-y4v).
- IdealGasLaw
model
atmospheric_dynamics
sp_ch1
Ideal gas law for atmospheric air density: rho = M_air * p / (R * T). Migrated from AtmosphericDynamics.jl@816cc391 src/seinfeld_pandis_ch1.jl:68 (`IdealGasLaw` @component). Implements Seinfeld & Pandis Ch 1 Eq 1.2. Parameterized as observed-only: T and p are inputs (parameters in standalone form), rho is the algebraic output. Upstream the Julia @component declares T and p as @variables for composition into a parent system; for standalone serialization (3 unknowns vs 1 equation otherwise), they are declared as parameters here, mirroring the WaterEquilibrium serialization pattern.
- KelvinEffect
model
aerosol
sp_ch10
Kelvin effect on the equilibrium vapor pressure over a curved droplet surface — Seinfeld & Pandis (2006), Atmospheric Chemistry and Physics, 2nd ed., Chapter 10. Computes the Kelvin saturation ratio S = p_A/p°_A (Eq. 10.86), the factor by which surface curvature enhances the equilibrium vapor pressure of a small droplet relative to a flat surface: S = exp(2 σ M / (R T ρ_l R_p)). The enhancement is significant for nanometre-scale droplets and decays toward unity as the droplet radius grows. Migrated from Aerosol.jl KelvinEffect.
- KohlerTheory
model
aerosol
cloud_physics
Köhler theory for cloud condensation nucleus (CCN) activation — Seinfeld & Pandis (2006), Atmospheric Chemistry and Physics, 2nd ed., §17.3–17.4. Computes the equilibrium saturation ratio S_eq over a solution droplet of diameter D_p (Köhler equation, Eq. 17.50), the critical activation diameter D_pc, and the critical supersaturation sc. S_eq combines the Kelvin curvature enhancement (coefficient A = 4 M_w σ / (R T ρ_w)) and the Raoult solute suppression (coefficient B = 6 n_s M_w / (π ρ_w)); at D_p = D_pc the Köhler curve reaches its maximum and the droplet activates spontaneously. Migrated from Aerosol.jl src/cloud_physics.jl:232.
- NH4NO3Equilibrium
model
aerosol
sp_ch10
ModelingToolkit implementation of ammonium nitrate (NH4NO3) gas-aerosol equilibrium from Seinfeld & Pandis (2006), Atmospheric Chemistry and Physics, 2nd ed., Chapter 10, Section 10.4.3. NH4NO3 is a semi-volatile aerosol species whose gas-particle partitioning depends strongly on temperature and relative humidity. The component evaluates three temperature- and humidity-dependent quantities: the natural log of the solid-phase dissociation constant ln(Kp) for NH3(g) + HNO3(g) <-> NH4NO3(s) (Eq. 10.91), the deliquescence relative humidity DRH of NH4NO3 (Eq. 10.88), and a phase indicator that is 1 when the ambient RH exceeds the DRH (aqueous aerosol) and 0 otherwise (solid aerosol). Migrated from Aerosol.jl NH4NO3Equilibrium. Purely algebraic: no differential states, three observed outputs and an empty equations array.
- Solid
model
aerosol
isorropia
A solid-phase aerosol species placeholder in the ISORROPIA II inorganic thermodynamic equilibrium model. Holds the molarity of a single solid salt in air. In isolation the concentration is conserved (D(M)/dt = 0); source and sink terms are added through the coupling mechanism when Solid instances are composed into the full Isorropia system. Reference: Fountoukis and Nenes (2007), ISORROPIA II.
- Solids
model
aerosol
isorropia
Aggregate container for the 19 solid-phase salt species in the ISORROPIA II inorganic thermodynamic equilibrium model. Composes 19 named Solid instances — one per solid salt that can form in the K⁺-Ca²⁺-Mg²⁺-NH₄⁺-Na⁺-SO₄²⁻-NO₃⁻-Cl⁻-H₂O system — into a single subsystem bundle. Each Solid carries a single state variable M(t) [mol/m³] representing the molarity of that salt in air; in isolation M is conserved (D(M)/dt = 0). Source/sink terms are injected through the coupling mechanism when Solids is composed into the parent Isorropia system. Reference: Fountoukis and Nenes (2007), ISORROPIA II.
- TotalMolarConcentration
model
atmospheric_dynamics
sp_ch1
Total molar concentration of air from the ideal gas law: c_total = N/V = p / (R * T) (Seinfeld & Pandis Eq. 1.7). Migrated from AtmosphericDynamics.jl@816cc391 src/seinfeld_pandis_ch1.jl:244 (`TotalMolarConcentration` @component). Algebraic (observed-only): T and p are input parameters; c_total is the algebraic output fixed by one explicit equation. Upstream the Julia @component declares T and p as @variables for composition into a parent system; for standalone serialization (3 unknowns vs 1 equation otherwise), they are declared as parameters here, mirroring the sibling ideal_gas.esm / sat_vapor_pressure.esm pattern.
- WSM6Saturation
model
atmospheric_dynamics
wsm6
Thermodynamic state of a column as the WSM6 microphysics scheme evaluates it once per sub-time step (phys/physics_mmm/mp_wsm6.F90, the inlined fpvs block and the cpmcal/xlcal statement functions of mp_wsm6_run): saturation vapor pressure and mixing ratio over water and over ice from the integrated Clausius-Clapeyron relation with temperature-linear latent heats (lib/wrf_thermo.esm saturation_vapor_pressure_fpvs), the relative humidities, the latent heat of vaporization and the moist heat capacity. Layer index `lev` (WRF k, layer 1 at the surface); all fields are pointwise functions of the layer state, so no grid geometry is needed. The ice formula is used only below the triple point, above it the ice saturation equals the water saturation (the Fortran branch). The vapor pressure is capped at es_cap p and the saturation mixing ratio and relative humidity are floored at qmin, exactly as the kernel does. This model is a separate component from the process rates (warm_rain.esm) because WSM6 computes it from the temperature and vapor at the START of the sub-step and does not update it after sedimentation, melting and freezing have changed the temperature (EqWeFiC FORTRAN_BUGS.md note N4); the process-rate components therefore take qsat, rh and xl as inputs so that a consumer can bind either this model's outputs or, to reproduce the kernel, its start-of-step values. Consumer-supplied inputs: the column fields T (temperature), qv (vapor mixing ratio) and p (pressure) are REWRITE-TARGET ops `input_<name>` (esm-spec 4.2 open tier) that the consumer lowers -- in the inline tests through a per-test `expression_template_imports` library (tests/<id>_inputs.esm, extracted from kernel dumps of the instrumented WRF fork ctessum-claude/WRF, commit e42a269 (v4.8.0-2-ge42a269e)) because esm-spec 6.6 `parameter_overrides` admit scalars only. EqWeFiC, cited here for FORTRAN_BUGS.md and couplings/, is https://github.com/EarthSciML/EqWeFiC, where these components were developed and are coupled into a WRF column.
- ZSRWaterContent
model
aerosol
sp_ch10
ZSR (Zdanovskii-Stokes-Robinson) mixing rule for aerosol liquid water content — Seinfeld & Pandis (2006), Atmospheric Chemistry and Physics, 2nd ed., Chapter 10. Computes the total aerosol liquid water content W of a multicomponent inorganic-salt solution as the sum over species of the water each salt holds in its own binary solution at the ambient water activity (Eq. 10.98), with the water activity set equal to the relative humidity for an equilibrium aerosol (Eq. 10.63). Migrated from Aerosol.jl ZSRWaterContent at the upstream default parameterization n_species = 3.