Cloud Physics

Overview

This module implements the cloud microphysics equations from Chapter 17 of Seinfeld & Pandis (2006), covering thermodynamic properties of water, the Kelvin (curvature) effect, Köhler theory for cloud droplet activation, diffusional growth of cloud droplets, adiabatic cooling and cloud formation dynamics, ice nucleation, rain formation, and aerosol scavenging by cloud droplets.

Reference: Seinfeld, J.H. and Pandis, S.N. (2006). Atmospheric Chemistry and Physics: From Air Pollution to Climate Change, 2nd Edition, John Wiley & Sons, Inc. Chapter 17: Cloud Physics.

Aerosol.CloudWaterProperties — Function
CloudWaterProperties(; name=:CloudWaterProperties)

Thermodynamic properties of water and water solutions for cloud physics calculations, including specific heat, latent heats, surface tension, and saturation vapor pressure.

Based on Chapter 17 of Seinfeld & Pandis (2006) "Atmospheric Chemistry and Physics: From Air Pollution to Climate Change", 2nd Edition, John Wiley & Sons.

Equations 17.1-17.6, Table 17.2.

source
Aerosol.CloudKelvinEffect — Function
CloudKelvinEffect(; name=:CloudKelvinEffect)

Kelvin (curvature) effect on vapor pressure over curved cloud droplet surfaces. The vapor pressure over a curved surface is enhanced relative to a flat surface due to surface energy effects.

Based on Equations 17.9 and 17.28 from Seinfeld & Pandis (2006) Chapter 17.

Equations

  • Eq. 17.9: pw(Dp)/p° = exp(4Mw σw / (R T ρw Dp))
  • Eq. 17.28: A = 4Mw σw / (R T ρ_w) ≈ 0.66/T µm (for T in K)
source
Aerosol.KohlerTheory — Function
KohlerTheory(; name=:KohlerTheory)

Köhler theory for equilibrium vapor pressure over solution droplets, combining the Kelvin (curvature) effect and Raoult (solute) effect.

Includes standard Köhler equation, critical diameter and supersaturation, and extension for partially insoluble particles.

Based on Equations 17.26-17.40 from Seinfeld & Pandis (2006).

Key Equations

  • Eq. 17.27: ln(pw(Dp)/p°) = A/Dp - B/Dp³
  • Eq. 17.28: A = 4Mw σw / (R T ρ_w)
  • Eq. 17.29: B = 6ns Mw / (π ρ_w)
  • Eq. 17.30: D_pc = √(3B/A) (critical diameter)
  • Eq. 17.32: ln(S_c) = √(4A³/27B) (critical saturation)
  • Eq. 17.33: ns = νπds³ρs / (6Ms) (moles of solute)
  • Eq. 17.38-17.40: Extensions for insoluble material
source
Aerosol.DropletGrowth — Function
DropletGrowth(; name=:DropletGrowth)

Diffusional growth rate of cloud droplets by condensation of water vapor. Accounts for the thermal gradient between droplet surface and environment, gas-phase diffusion, and modified diffusivity for kinetic effects.

Based on Equations 17.60-17.72 from Seinfeld & Pandis (2006).

Key Equations

  • Eq. 17.61: Dv = 0.211(pref/p)(T/273)^1.94 cm²/s (water vapor diffusivity)
  • Eq. 17.62: D'v = Dv / [1 + 2Dv/(αc Dp)√(2πMw/RT)] (kinetic correction)
  • Eq. 17.70: Dp dDp/dt = [Sv,∞ - Seq] / [ρw RT/(4p° D'v Mw) + ΔHv ρw/(4k'a T)(ΔHv Mw/(TR) - 1)]
  • Eq. 17.71: k_a = 10⁻³(4.39 + 0.071T) J/(m·s·K) (thermal conductivity)
  • Eq. 17.72: k'_a correction for kinetic effects
source
Aerosol.CloudDynamics — Function
CloudDynamics(; name=:CloudDynamics)

Adiabatic cooling, cloud formation, and supersaturation dynamics. Includes dry adiabatic lapse rate, lifting condensation level (LCL), dew point temperature, and saturation mixing ratio.

Based on Equations 17.43-17.49 from Seinfeld & Pandis (2006).

Key Equations

  • Eq. 17.43: Td ≈ T0 + (RT0²/ΔHv M_w)ln(RH) (dew point temperature)
  • Eq. 17.44: Γd = g/cp ≈ 9.76 K/km (dry adiabatic lapse rate)
  • Eq. 17.46: wv = Mw pw / (Ma p_a) (water vapor mixing ratio)
  • Eq. 17.49: hLCL = (T0 - T_L)/Γ (lifting condensation level)
source
Aerosol.IcePhysics — Function
IcePhysics(; name=:IcePhysics)

Ice nucleation and ice-water equilibrium thermodynamics. Includes freezing point depression for solutions, Kelvin equation for ice particles, and empirical ice nuclei concentration.

Based on Equations 17.100-17.103 from Seinfeld & Pandis (2006) "Atmospheric Chemistry and Physics: From Air Pollution to Climate Change", 2nd Edition, Chapter 17.

Key Equations

  • Eq. 17.100: T0 - Te = (RT0 Te/ΔHm)(-ln aw) (freezing point from water activity)
  • Eq. 17.101: ΔTf = (RT0² Mw)/(1000 ΔHm) m ≈ 1.86 K·kg/mol × m (freezing point depression)
  • Eq. 17.102: pi = psat,i exp(4Mw σia / (R T ρi Dp)) (Kelvin effect for ice)
  • Eq. 17.103: IN(L⁻¹) = exp[0.6(253-T)] (ice nuclei concentration)
source
Aerosol.RainFormation — Function
RainFormation(; name=:RainFormation)

Rain formation by collision and coalescence processes, plus raindrop size distributions.

Based on Equations 17.104-17.108 from Seinfeld & Pandis (2006).

Key Equations

  • Eq. 17.104: E = y²/(Dp + dp)² (collision efficiency)
  • Eq. 17.105: Ec = (Dp/(Dp + dp))² (coalescence efficiency, for D_p > 400 µm)
  • Eq. 17.106: dm/dt = (π/4)Et(Dp + dp)²wL(vD - vd) (continuous accretion)
  • Eq. 17.107: F(Dp) = 1 - exp[-(Dp/(1.3p_0^0.232 mm))^2.25] (Best CDF)
  • Eq. 17.108: n(Dp) = n0 exp(-ψD_p) (Marshall-Palmer distribution)
source
Aerosol.AerosolScavenging — Function
AerosolScavenging(; name=:AerosolScavenging)

Aerosol scavenging by cloud droplets, including mass and number scavenging ratios and scavenging coefficients.

Based on Equations 17.84-17.92 from Seinfeld & Pandis (2006).

Key Equations

  • Eq. 17.84: Fi = (C{i,0} - C{i,int})/C{i,0} (mass scavenging ratio)
  • Eq. 17.85: FN = (N0 - Nint)/N0 (number scavenging ratio)
  • Eq. 17.91: Λ(Dp,t) = ∫K(Dp,x)n_d(x,t)dx (scavenging coefficient)
  • Eq. 17.92: Λ(Dp) = Nd K(D_p, 10µm) (monodisperse approximation)
source
Aerosol.CloudPhysics — Function
CloudPhysics(; name=:CloudPhysics)

Complete cloud physics system composing all subsystems: water properties, Kelvin effect, Köhler theory, droplet growth, cloud dynamics, ice physics, rain formation, and aerosol scavenging.

Based on Chapter 17 of Seinfeld & Pandis (2006) "Atmospheric Chemistry and Physics: From Air Pollution to Climate Change", 2nd Edition, John Wiley & Sons.

source

Reference Tables

The following tables from Seinfeld & Pandis (2006) Chapter 17 provide key physical constants used in this implementation.

Table 17.1: Properties of Water

PropertyPhase/TemperatureSymbolValue
Specific heat at constant pressureVaporĉ_pv1952 J kg⁻¹ K⁻¹
Specific heat at constant pressureLiquid (0°C)ĉ_pw4218 J kg⁻¹ K⁻¹
Specific heat at constant volumeVaporĉ_vw1463 J kg⁻¹ K⁻¹
Latent heat of evaporation0°CΔH_v2.5 kJ g⁻¹
Latent heat of evaporation100°CΔH_v2.25 kJ g⁻¹
Latent heat of fusion0°CΔH_m0.33 kJ g⁻¹
Surface tensionWater/air (20°C)σ_w00.073 J m⁻²

Table 17.2: Saturation Vapor Pressure Polynomial Coefficients

The saturation vapor pressure over a flat surface is given by:

p°(mbar) = a₀ + a₁T + a₂T² + a₃T³ + a₄T⁴ + a₅T⁵ + a₆T⁶ (T is in °C)

CoefficientWater (−50 to +50°C)Ice (−50 to 0°C)
a₀6.1077999616.109177956
a₁4.436518521×10⁻¹5.034698970×10⁻¹
a₂1.428945805×10⁻²1.886013408×10⁻²
a₃2.650648471×10⁻⁴4.176223716×10⁻⁴
a₄3.031240396×10⁻⁶5.824720280×10⁻⁶
a₅2.034080948×10⁻⁸4.838803174×10⁻⁸
a₆6.136820929×10⁻¹¹1.838826904×10⁻¹⁰

Source: Lowe and Ficke (1974)

Table 17.3: Updraft Velocities and Maximum Supersaturations for Clouds and Fogs

Cloud TypeUpdraft Velocity (m s⁻¹)Maximum Supersaturation (%)Reference
Continental cumulus~1–170.25–0.7Pruppacher and Klett (1997)
Maritime cumulus~1–2.50.3–0.8Pruppacher and Klett (1997); Mason (1971)
Stratiform~0–1~0.05Pruppacher and Klett (1997)
Fog—~0.1Pandis and Seinfeld (1989)

Table 17.4: Empirical Parameters for CCN Concentration

The CCN concentration can be approximated by: CCN(s) = c·sᵏ

where CCN(s) is in particles cm⁻³ and s is supersaturation in percent.

c (cm⁻³)kLocation
1250.3Maritime (Australia)
53–1050.5–0.6Maui (Hawaii)
1000.5Atlantic, Pacific Oceans
1900.8Pacific
2501.3–1.4North Atlantic
145–3700.4–0.9North Atlantic
100–1000—Arctic
1400.4Cape Grim (Australia)
2500.5North Atlantic
25–1280.4–0.6North Pacific
27–1111.0North Pacific
4000.3Polluted North Pacific
1000.4Equatorial Pacific
6000.5Continental
20000.4Continental (Australia)
35000.9Continental (Buffalo, NY)

Source: Hegg and Hobbs (1992)

Implementation

The cloud physics system is composed of eight subsystems, each implemented as a ModelingToolkit @component function. They can be used individually or composed together via the CloudPhysics parent system.

State Variables

using DataFrames, ModelingToolkit, Symbolics, DynamicQuantities
using Aerosol

sys = CloudPhysics()
vars = unknowns(sys)
DataFrame(
    :Name => [string(Symbolics.tosymbol(v, escape = false)) for v in vars],
    :Units => [string(dimension(ModelingToolkit.get_unit(v))) for v in vars],
    :Description => [ModelingToolkit.getdescription(v) for v in vars]
)
43×3 DataFrame
RowNameUnitsDescription
StringStringString
1water₊T_CKTemperature difference from 273.15 K
2water₊c_pwm² s⁻² K⁻¹Specific heat of liquid water
3water₊ΔH_vm² s⁻²Latent heat of vaporization
4water₊ΔH_mm² s⁻²Latent heat of melting
5water₊σ_w0kg s⁻²Surface tension of pure water
6water₊p_sat_waterm⁻¹ kg s⁻²Saturation vapor pressure over water
7water₊p_sat_icem⁻¹ kg s⁻²Saturation vapor pressure over ice
8kelvin₊A_kelvinmKelvin parameter A (Eq. 17.28)
9kelvin₊kelvin_ratioKelvin ratio p_w(D_p)/p° (Eq. 17.9, dimensionless)
10kohler₊AmKelvin parameter
11kohler₊n_smolMoles of solute
12kohler₊Bm³Solute parameter
13kohler₊d_umDiameter of insoluble core
14kohler₊ln_SLog of saturation ratio (dimensionless)
15kohler₊SSaturation ratio (dimensionless)
16kohler₊D_pcmCritical droplet diameter
17kohler₊ln_S_cLog of critical saturation (dimensionless)
18kohler₊S_cCritical saturation ratio (dimensionless)
19growth₊D_vm² s⁻¹Diffusivity of water vapor in air
20growth₊D_v_primem² s⁻¹Modified diffusivity of water vapor
21growth₊k_am kg s⁻³ K⁻¹Thermal conductivity of air
22growth₊ρ_airm⁻³ kgAir density from ideal gas law (Eq. 17.72)
23growth₊k_a_primem kg s⁻³ K⁻¹Modified thermal conductivity of air
24growth₊p_satm⁻¹ kg s⁻²Saturation vapor pressure
25growth₊ΔH_vm² s⁻²Latent heat of vaporization
26growth₊S_eqEquilibrium saturation ratio over droplet (dimensionless)
27growth₊dDp_dtm s⁻¹Droplet diameter growth rate
28cloud₊Γ_dm⁻¹ KDry adiabatic lapse rate
29cloud₊p_satm⁻¹ kg s⁻²Saturation vapor pressure at T_0
30cloud₊w_vsSaturation mixing ratio (dimensionless)
31cloud₊T_dKDew point temperature
32cloud₊h_LCLmLifting condensation level height
33ice₊ΔT_fKFreezing point depression
34ice₊T_eKEquilibrium freezing temperature
35ice₊kelvin_iceKelvin factor for ice (dimensionless)
36ice₊INm⁻³Ice nuclei concentration
37rain₊E_tCollection efficiency (Eq. 17.106, dimensionless)
38rain₊dm_dtkg s⁻¹Mass accretion rate (Eq. 17.106)
39rain₊F_distBest raindrop CDF (Eq. 17.107, dimensionless)
40rain₊n_MPm⁻⁴Marshall-Palmer number density (Eq. 17.108)
41scav₊F_massMass scavenging ratio (dimensionless)
42scav₊F_numberNumber scavenging ratio (dimensionless)
43scav₊Λs⁻¹Scavenging coefficient

Parameters

params = parameters(sys)
DataFrame(
    :Name => [string(Symbolics.tosymbol(p, escape = false)) for p in params],
    :Units => [string(dimension(ModelingToolkit.get_unit(p))) for p in params],
    :Description => [ModelingToolkit.getdescription(p) for p in params]
)
130×3 DataFrame
RowNameUnitsDescription
StringStringString
1water₊T_refKReference temperature (0°C)
2water₊TKTemperature
3water₊cpw_basem² s⁻² K⁻¹Base specific heat of water (Eq. 17.2)
4water₊T_cpw_refKReference T for c_pw correlation (Eq. 17.2)
5water₊T_unitKUnit temperature for nondimensionalization
6water₊cpw_c2m² s⁻² K⁻¹Quadratic coefficient for c_pw (Eq. 17.2: 1.3e-5 J/(g*K) * 1000)
7water₊cpw_c4m² s⁻² K⁻¹Quartic coefficient for c_pw (Eq. 17.2: 1.6e-8 J/(g*K) * 1000)
8water₊Hv_refm² s⁻²Latent heat reference value (Eq. 17.3: 2.5 kJ/g = 2.5e6 J/kg)
9water₊Hv_exp_constExponent constant for latent heat (Eq. 17.3, dimensionless)
10water₊Hv_exp_coeffK⁻¹Exponent coefficient for latent heat (Eq. 17.3)
11water₊Hm_basem² s⁻²Base latent heat of melting (Eq. 17.4: 333.5 J/g = 333500 J/kg)
12water₊Hm_c1m² s⁻²Linear coeff. for latent heat of melting (Eq. 17.4: 2.03 J/g = 2030 J/kg)
13water₊Hm_c2m² s⁻²Quadratic coeff. for latent heat of melting (Eq. 17.4: -0.0105 J/g = -10.5 J/kg)
14water₊sigma_basekg s⁻²Base surface tension (Eq. 17.5)
15water₊sigma_coeffkg s⁻² K⁻¹Surface tension temperature coefficient (Eq. 17.5)
16water₊a4_wm⁻¹ kg s⁻²Water sat. vap. press. coeff. a4 (Table 17.2)
17water₊a5_wm⁻¹ kg s⁻²Water sat. vap. press. coeff. a5 (Table 17.2)
18water₊a1_wm⁻¹ kg s⁻²Water sat. vap. press. coeff. a1 (Table 17.2)
19water₊a0_wm⁻¹ kg s⁻²Water sat. vap. press. coeff. a0 (Table 17.2)
20water₊a3_wm⁻¹ kg s⁻²Water sat. vap. press. coeff. a3 (Table 17.2)
21water₊a6_wm⁻¹ kg s⁻²Water sat. vap. press. coeff. a6 (Table 17.2)
22water₊a2_wm⁻¹ kg s⁻²Water sat. vap. press. coeff. a2 (Table 17.2)
23water₊a6_im⁻¹ kg s⁻²Ice sat. vap. press. coeff. a6 (Table 17.2)
24water₊a5_im⁻¹ kg s⁻²Ice sat. vap. press. coeff. a5 (Table 17.2)
25water₊a1_im⁻¹ kg s⁻²Ice sat. vap. press. coeff. a1 (Table 17.2)
26water₊a2_im⁻¹ kg s⁻²Ice sat. vap. press. coeff. a2 (Table 17.2)
27water₊a0_im⁻¹ kg s⁻²Ice sat. vap. press. coeff. a0 (Table 17.2)
28water₊a3_im⁻¹ kg s⁻²Ice sat. vap. press. coeff. a3 (Table 17.2)
29water₊a4_im⁻¹ kg s⁻²Ice sat. vap. press. coeff. a4 (Table 17.2)
30kelvin₊σ_wkg s⁻²Surface tension of water (Table 17.1)
31kelvin₊M_wkg mol⁻¹Molecular weight of water
32kelvin₊TKTemperature
33kelvin₊Rm² kg s⁻² K⁻¹ mol⁻¹Universal gas constant
34kelvin₊ρ_wm⁻³ kgDensity of liquid water at 25°C
35kelvin₊D_pmDroplet diameter
36kohler₊σ_wkg s⁻²Surface tension of water
37kohler₊M_wkg mol⁻¹Molecular weight of water
38kohler₊TKTemperature
39kohler₊Rm² kg s⁻² K⁻¹ mol⁻¹Universal gas constant
40kohler₊ρ_wm⁻³ kgDensity of liquid water
41kohler₊d_smDry particle diameter
42kohler₊π_valPi (dimensionless)
43kohler₊ν_sVan't Hoff factor (number of ions) (dimensionless)
44kohler₊ε_mMass fraction of soluble material (dimensionless)
45kohler₊M_skg mol⁻¹Molecular weight of solute
46kohler₊ρ_um⁻³ kgDensity of insoluble material
47kohler₊ρ_sm⁻³ kgDensity of solute
48kohler₊dim_epsSmall dimensionless value for numerical stability (dimensionless)
49kohler₊vol_epsm³Small volume for numerical stability
50kohler₊D_pmWet droplet diameter
51growth₊TKTemperature
52growth₊T_Dv_refKReference temperature for D_v
53growth₊p_refm⁻¹ kg s⁻²Reference pressure (1 atm)
54growth₊Dv_refm² s⁻¹Reference diffusivity at 273 K, 1 atm
55growth₊p_am⁻¹ kg s⁻²Atmospheric pressure
56growth₊oneUnit value (dimensionless)
57growth₊π_valPi (dimensionless)
58growth₊M_wkg mol⁻¹Molecular weight of water
59growth₊Rm² kg s⁻² K⁻¹ mol⁻¹Universal gas constant
60growth₊D_pmDroplet diameter
61growth₊α_cMass accommodation coefficient (dimensionless)
62growth₊ka_c0m kg s⁻³ K⁻¹Thermal conductivity constant
63growth₊ka_c1m kg s⁻³ K⁻²Thermal conductivity slope
64growth₊M_akg mol⁻¹Molecular weight of air
65growth₊α_TThermal accommodation coefficient (dimensionless)
66growth₊c_p_airm² s⁻² K⁻¹Specific heat of air
67growth₊T_magnus_offsetKMagnus temperature offset
68growth₊magnus_aMagnus coefficient a (dimensionless)
69growth₊magnus_bKMagnus coefficient b
70growth₊p_sat_refm⁻¹ kg s⁻²Reference saturation pressure
71growth₊Hv_ref_kgm² s⁻²Reference latent heat of vaporization
72growth₊T_Hv_refKReference temperature for latent heat
73growth₊Hv_exp_constExponent constant (dimensionless)
74growth₊Hv_exp_coeffK⁻¹Exponent coefficient
75growth₊n_smolMoles of solute in droplet
76growth₊vol_epsm³Small volume for numerical stability
77growth₊d_umInsoluble core diameter
78growth₊ρ_wm⁻³ kgDensity of liquid water
79growth₊σ_wkg s⁻²Surface tension of water
80growth₊S_vEnvironmental saturation ratio (dimensionless)
81cloud₊gm s⁻²Gravitational acceleration
82cloud₊c_p_airm² s⁻² K⁻¹Specific heat of air at constant pressure
83cloud₊T_magnus_offsetKMagnus temperature offset
84cloud₊T_0KInitial temperature
85cloud₊magnus_aMagnus coefficient a (dimensionless)
86cloud₊magnus_bKMagnus coefficient b
87cloud₊p_sat_refm⁻¹ kg s⁻²Reference saturation pressure
88cloud₊M_wkg mol⁻¹Molecular weight of water
89cloud₊M_akg mol⁻¹Molecular weight of air
90cloud₊p_am⁻¹ kg s⁻²Atmospheric pressure
91cloud₊Rm² kg s⁻² K⁻¹ mol⁻¹Universal gas constant
92cloud₊RHRelative humidity (dimensionless)
93cloud₊ΔH_vm² s⁻²Latent heat of vaporization
94ice₊K_fkg K mol⁻¹Cryoscopic constant of water
95ice₊molalitykg⁻¹ molSolution molality
96ice₊T_freezeKFreezing point of pure water
97ice₊Rm² kg s⁻² K⁻¹ mol⁻¹Universal gas constant
98ice₊a_wWater activity (dimensionless)
99ice₊dim_epsSmall dimensionless value for numerical stability (dimensionless)
100ice₊ΔH_m_massm² s⁻²Latent heat of fusion of water
101ice₊M_wkg mol⁻¹Molecular weight of water
102ice₊σ_iakg s⁻²Ice-air surface tension
103ice₊TKTemperature
104ice₊ρ_im⁻³ kgDensity of ice
105ice₊D_pmIce particle diameter
106ice₊IN_refm⁻³Ice nuclei concentration reference (per L -> per m^3)
107ice₊IN_coeffK⁻¹Ice nuclei exponential coefficient
108ice₊T_IN_refKReference temperature for IN parameterization
109rain₊E_collCollision efficiency (Eq. 17.104, dimensionless)
110rain₊E_coalCoalescence efficiency (Eq. 17.105, dimensionless)
111rain₊D_pmCollector drop diameter
112rain₊d_pmCollected droplet diameter
113rain₊π_valPi (dimensionless)
114rain₊w_LLiquid water mass mixing ratio (kg water / kg air) (dimensionless)
115rain₊ρ_am⁻³ kgAir density
116rain₊v_Dm s⁻¹Fall velocity of collector drop
117rain₊v_dm s⁻¹Fall velocity of collected droplet
118rain₊p_0m s⁻¹Rainfall intensity (Eq. 17.107)
119rain₊p0_unitm s⁻¹Unit rainfall intensity for nondimensionalization
120rain₊F_diam_refmBest distribution diameter scale (Eq. 17.107: 1.3 mm)
121rain₊F_expBest distribution exponent (Eq. 17.107, dimensionless)
122rain₊oneUnity (dimensionless)
123rain₊n_0m⁻⁴Marshall-Palmer intercept parameter (Eq. 17.108: 8000 m^-3 mm^-1)
124rain₊ψm⁻¹Marshall-Palmer slope parameter (Eq. 17.108)
125scav₊C_intm⁻³Interstitial aerosol mass concentration
126scav₊C_0m⁻³Initial aerosol mass concentration
127scav₊N_intm⁻³Interstitial aerosol number concentration
128scav₊N_0m⁻³Initial aerosol number concentration
129scav₊K_collm³ s⁻¹Collision coefficient
130scav₊N_dm⁻³Cloud droplet number concentration

Equations

eqs = equations(sys)
43-element Vector{Symbolics.Equation}:
 water₊T_C(t) ~ water₊T - water₊T_ref
 water₊c_pw(t) ~ water₊cpw_base + water₊cpw_c2*(((water₊T - water₊T_cpw_ref) / water₊T_unit)^2) + water₊cpw_c4*(((water₊T - water₊T_cpw_ref) / water₊T_unit)^4)
 water₊ΔH_v(t) ~ ((water₊T_ref / water₊T)^(water₊Hv_exp_const + water₊Hv_exp_coeff*water₊T))*water₊Hv_ref
 water₊ΔH_m(t) ~ water₊Hm_base + (water₊Hm_c1*water₊T_C(t)) / water₊T_unit + water₊Hm_c2*((water₊T_C(t) / water₊T_unit)^2)
 water₊σ_w0(t) ~ water₊sigma_base - water₊T_C(t)*water₊sigma_coeff
 water₊p_sat_water(t) ~ water₊a0_w + (water₊T_C(t)*water₊a1_w) / water₊T_unit + water₊a2_w*((water₊T_C(t) / water₊T_unit)^2) + water₊a3_w*((water₊T_C(t) / water₊T_unit)^3) + water₊a4_w*((water₊T_C(t) / water₊T_unit)^4) + water₊a5_w*((water₊T_C(t) / water₊T_unit)^5) + water₊a6_w*((water₊T_C(t) / water₊T_unit)^6)
 water₊p_sat_ice(t) ~ water₊a0_i + (water₊T_C(t)*water₊a1_i) / water₊T_unit + water₊a2_i*((water₊T_C(t) / water₊T_unit)^2) + water₊a3_i*((water₊T_C(t) / water₊T_unit)^3) + water₊a4_i*((water₊T_C(t) / water₊T_unit)^4) + water₊a5_i*((water₊T_C(t) / water₊T_unit)^5) + water₊a6_i*((water₊T_C(t) / water₊T_unit)^6)
 kelvin₊A_kelvin(t) ~ (4kelvin₊M_w*kelvin₊σ_w) / (kelvin₊R*kelvin₊T*kelvin₊ρ_w)
 kelvin₊kelvin_ratio(t) ~ exp(kelvin₊A_kelvin(t) / kelvin₊D_p)
 kohler₊A(t) ~ (4kohler₊M_w*kohler₊σ_w) / (kohler₊R*kohler₊T*kohler₊ρ_w)
 ⋮
 ice₊kelvin_ice(t) ~ exp((4ice₊M_w*ice₊σ_ia) / (ice₊D_p*ice₊R*ice₊T*ice₊ρ_i))
 ice₊IN(t) ~ exp(ice₊IN_coeff*(-ice₊T + ice₊T_IN_ref))*ice₊IN_ref
 rain₊E_t(t) ~ rain₊E_coal*rain₊E_coll
 rain₊dm_dt(t) ~ (1//4)*abs(rain₊v_D - rain₊v_d)*((rain₊D_p + rain₊d_p)^2)*rain₊E_t(t)*rain₊w_L*rain₊π_val*rain₊ρ_a
 rain₊F_dist(t) ~ -exp(-((rain₊D_p / (rain₊F_diam_ref*((rain₊p_0 / rain₊p0_unit)^0.232)))^rain₊F_exp)) + rain₊one
 rain₊n_MP(t) ~ exp(-rain₊D_p*rain₊ψ)*rain₊n_0
 scav₊F_mass(t) ~ (scav₊C_0 - scav₊C_int) / scav₊C_0
 scav₊F_number(t) ~ (scav₊N_0 - scav₊N_int) / scav₊N_0
 scav₊Λ(t) ~ scav₊K_coll*scav₊N_d

Analysis

Figure 17.1: Saturation Concentration of Water Vapor vs Temperature

The saturation concentration of water vapor over a flat water surface increases approximately exponentially with temperature. This figure shows the concentration calculated from the saturation vapor pressure (Table 17.2 polynomial) using the ideal gas law: c = p·M_w / (R·T).

using Plots, NonlinearSolve

wp = CloudWaterProperties()
wp_sys = mtkcompile(wp)

M_w = 0.018015  # kg/mol, molecular weight of water
R = 8.314       # J/(mol·K), universal gas constant

T_range = 263.15:1.0:303.15  # -10°C to 30°C (matching Fig. 17.1 range)
c_sat_vals = Float64[]

for T_val in T_range
    prob = NonlinearProblem(wp_sys, Dict(wp_sys.T => T_val))
    sol = solve(prob)
    p_sat = sol[wp_sys.p_sat_water]  # Pa
    # Convert pressure to concentration: c = p·M_w / (R·T) in kg/m³, then to g/m³
    c_sat = p_sat * M_w / (R * T_val) * 1000  # g/m³
    push!(c_sat_vals, c_sat)
end

plot(T_range .- 273.15, c_sat_vals,
    xlabel = "Temperature (°C)", ylabel = "Water Vapor Concentration (g m⁻³)",
    label = "Water (Table 17.2 polynomial)",
    linewidth = 2, legend = :topleft,
    title = "Fig. 17.1: Saturation Concentration of Water Vapor")
Example block output

Figure 17.2: Kelvin Effect

The vapor pressure over a curved droplet surface is enhanced relative to a flat surface, with the enhancement increasing as droplet diameter decreases (Eq. 17.9).

ke = CloudKelvinEffect()
ke_sys = mtkcompile(ke)

D_p_range = 10.0 .^ range(log10(1e-8), log10(1e-5), length = 100)  # 10 nm to 10 µm
kelvin_vals = Float64[]

for D_val in D_p_range
    prob = NonlinearProblem(ke_sys, Dict(ke_sys.D_p => D_val, ke_sys.T => 293.15))
    sol = solve(prob)
    push!(kelvin_vals, sol[ke_sys.kelvin_ratio])
end

plot(D_p_range * 1e6, kelvin_vals,
    xlabel = "Droplet Diameter (µm)", ylabel = "p_w(D_p) / p°",
    xscale = :log10, label = "T = 293.15 K",
    linewidth = 2, title = "Fig. 17.2: Kelvin Effect",
    legend = :topright)
hline!([1.0], linestyle = :dash, color = :gray, label = "Flat surface")
Example block output

Figure 17.5: Köhler Curves

Köhler curves show the equilibrium saturation ratio as a function of wet droplet diameter for different dry particle sizes and solute compositions. The curves exhibit a maximum (critical supersaturation) beyond which droplets activate and grow without bound.

kt = KohlerTheory()
kt_sys = mtkcompile(kt)

D_wet_range = 10.0 .^ range(log10(1e-8), log10(5e-5), length = 200)

function kohler_curve(kt_sys, d_dry, M_s, rho_s, nu_s)
    S_vals = Float64[]
    for D_w in D_wet_range
        prob = NonlinearProblem(kt_sys,
            Dict(
                kt_sys.D_p => D_w, kt_sys.d_s => d_dry,
                kt_sys.M_s => M_s, kt_sys.ρ_s => rho_s,
                kt_sys.ν_s => nu_s, kt_sys.T => 293.15, kt_sys.ε_m => 1.0
            ))
        sol = solve(prob)
        push!(S_vals, sol[kt_sys.S])
    end
    return S_vals
end

# NaCl: M_s = 0.05844, rho = 2165, nu = 2
# (NH4)2SO4: M_s = 0.13214, rho = 1770, nu = 3
plot(title = "Fig. 17.5: Köhler Curves", xlabel = "Wet Diameter (µm)",
    ylabel = "Saturation Ratio S", legend = :topright, ylims = (0.990, 1.015))

for (d_dry, style) in [(0.05e-6, :solid), (0.1e-6, :dash), (0.5e-6, :dot)]
    d_label = round(d_dry * 1e6, digits = 2)
    S_nacl = kohler_curve(kt_sys, d_dry, 0.05844, 2165.0, 2.0)
    plot!(D_wet_range * 1e6, S_nacl, label = "NaCl d_s=$(d_label) µm",
        linestyle = style, linewidth = 2, color = :blue, xscale = :log10)
    S_as = kohler_curve(kt_sys, d_dry, 0.13214, 1770.0, 3.0)
    plot!(D_wet_range * 1e6, S_as, label = "(NH₄)₂SO₄ d_s=$(d_label) µm",
        linestyle = style, linewidth = 2, color = :red, xscale = :log10)
end
hline!([1.0], linestyle = :dash, color = :gray, label = "S = 1")
plot!()
Example block output

Figure 17.6: Critical Supersaturation vs Dry Diameter

Critical supersaturation decreases with increasing dry particle diameter, following a power-law relationship (Eq. 17.34).

d_dry_range = 10.0 .^ range(log10(1e-8), log10(1e-6), length = 50)

function critical_ss(kt_sys, d_dry_range, M_s, rho_s, nu_s)
    sc_vals = Float64[]
    for d_d in d_dry_range
        prob = NonlinearProblem(kt_sys,
            Dict(
                kt_sys.d_s => d_d, kt_sys.M_s => M_s, kt_sys.ρ_s => rho_s,
                kt_sys.ν_s => nu_s, kt_sys.T => 293.15, kt_sys.ε_m => 1.0
            ))
        sol = solve(prob)
        push!(sc_vals, (sol[kt_sys.S_c] - 1) * 100)  # Convert to percent
    end
    return sc_vals
end

sc_nacl = critical_ss(kt_sys, d_dry_range, 0.05844, 2165.0, 2.0)
sc_as = critical_ss(kt_sys, d_dry_range, 0.13214, 1770.0, 3.0)

plot(d_dry_range * 1e6, sc_nacl, label = "NaCl", linewidth = 2, color = :blue,
    xlabel = "Dry Diameter (µm)", ylabel = "Critical Supersaturation (%)",
    xscale = :log10, yscale = :log10, title = "Fig. 17.6: Critical Supersaturation",
    legend = :topright)
plot!(d_dry_range * 1e6, sc_as, label = "(NH₄)₂SO₄", linewidth = 2, color = :red)
Example block output

Figure 17.7: Effect of Dissociation on Köhler Curves

Köhler curves for (NH₄)₂SO₄ particles showing the effect of complete dissociation (ν=3) versus no dissociation (ν=1). Dissociation lowers the critical saturation ratio and decreases the critical diameter.

D_wet_range_17_7 = 10.0 .^ range(log10(1e-8), log10(2e-5), length = 200)

function kohler_curve_nu(kt_sys, d_dry, nu_s)
    S_vals = Float64[]
    for D_w in D_wet_range_17_7
        prob = NonlinearProblem(kt_sys,
            Dict(
                kt_sys.D_p => D_w, kt_sys.d_s => d_dry,
                kt_sys.M_s => 0.13214, kt_sys.ρ_s => 1770.0,
                kt_sys.ν_s => nu_s, kt_sys.T => 293.15, kt_sys.ε_m => 1.0
            ))
        sol = solve(prob)
        push!(S_vals, sol[kt_sys.S])
    end
    return S_vals
end

plot(title = "Fig. 17.7: Köhler Curves - Dissociation Effect",
    xlabel = "Wet Radius (µm)", ylabel = "Saturation Ratio S",
    legend = :topright, ylims = (0.998, 1.012))

for d_dry in [0.02e-6, 0.04e-6, 0.1e-6]
    d_label = round(d_dry * 1e6 * 1000, digits = 0)  # in nm
    S_complete = kohler_curve_nu(kt_sys, d_dry, 3.0)
    S_none = kohler_curve_nu(kt_sys, d_dry, 1.0)
    plot!(
        D_wet_range_17_7 * 1e6 / 2, S_complete, label = "Complete diss., r=$(d_label/2) nm",
        linestyle = :dash, linewidth = 2, xscale = :log10)
    plot!(D_wet_range_17_7 * 1e6 / 2, S_none, label = "No diss., r=$(d_label/2) nm",
        linestyle = :solid, linewidth = 2, xscale = :log10)
end
hline!([1.0], linestyle = :dot, color = :gray, label = "S = 1")
plot!()
Example block output

Figure 17.8: Köhler Curves with Insoluble Material

Köhler curves for particles containing (NH₄)₂SO₄ and insoluble material, showing how decreasing soluble mass fraction (ε_m) increases the supersaturation required for activation (Eqs. 17.35-17.40).

D_wet_range_17_8 = 10.0 .^ range(log10(1e-7), log10(1e-4), length = 200)

function kohler_curve_eps(kt_sys, d_dry, eps_m)
    S_vals = Float64[]
    for D_w in D_wet_range_17_8
        prob = NonlinearProblem(kt_sys,
            Dict(
                kt_sys.D_p => D_w, kt_sys.d_s => d_dry,
                kt_sys.M_s => 0.13214, kt_sys.ρ_s => 1770.0,
                kt_sys.ν_s => 3.0, kt_sys.T => 293.15, kt_sys.ε_m => eps_m,
                kt_sys.ρ_u => 2000.0
            ))
        sol = solve(prob)
        push!(S_vals, (sol[kt_sys.S] - 1) * 100)  # Convert to supersaturation %
    end
    return S_vals
end

plot(title = "Fig. 17.8: Köhler Curves with Insoluble Material",
    xlabel = "Wet Diameter (µm)", ylabel = "Supersaturation (%)",
    legend = :topright, xscale = :log10, ylims = (-0.3, 0.4))

d_dry = 0.1e-6  # 0.1 µm dry diameter
for (eps_m, color) in [(1.0, :black), (0.6, :blue), (0.4, :green), (0.2, :red)]
    S_vals = kohler_curve_eps(kt_sys, d_dry, eps_m)
    plot!(D_wet_range_17_8 * 1e6, S_vals,
        label = "ε_m = $eps_m", linewidth = 2, color = color)
end
hline!([0.0], linestyle = :dash, color = :gray, label = "S = 1 (0% SS)")
plot!()
Example block output

Figure 17.9: Effect of Insoluble Material on Critical Supersaturation

Particles with less soluble material require higher supersaturation to activate (Eqs. 17.35-17.40).

epsilon_vals = [1.0, 0.5, 0.1, 0.01]

plot(title = "Fig. 17.9: Insoluble Material Effect",
    xlabel = "Dry Diameter (µm)", ylabel = "Critical Supersaturation (%)",
    xscale = :log10, yscale = :log10, legend = :topright)

for eps_m in epsilon_vals
    sc_vals = Float64[]
    for d_d in d_dry_range
        prob = NonlinearProblem(kt_sys,
            Dict(
                kt_sys.d_s => d_d, kt_sys.M_s => 0.13214, kt_sys.ρ_s => 1770.0,
                kt_sys.ν_s => 3.0, kt_sys.T => 293.15, kt_sys.ε_m => eps_m,
                kt_sys.ρ_u => 2000.0
            ))
        sol = solve(prob)
        push!(sc_vals, (sol[kt_sys.S_c] - 1) * 100)
    end
    plot!(d_dry_range * 1e6, sc_vals, label = "ε_m = $eps_m", linewidth = 2)
end
plot!()
Example block output

Figure 17.10: Dew Point Temperature

Dew point temperature as a function of ambient temperature for different relative humidities (Eq. 17.43).

cd = CloudDynamics()
cd_sys = mtkcompile(cd)

T0_range = 273.15:2.0:313.15  # 0°C to 40°C
RH_vals = [0.2, 0.4, 0.6, 0.8, 1.0]

plot(title = "Fig. 17.10: Dew Point Temperature",
    xlabel = "Temperature (°C)", ylabel = "Dew Point Temperature (°C)",
    legend = :bottomright)

for rh in RH_vals
    Td_vals = Float64[]
    for T0 in T0_range
        prob = NonlinearProblem(cd_sys, Dict(cd_sys.T_0 => T0, cd_sys.RH => rh))
        sol = solve(prob)
        push!(Td_vals, sol[cd_sys.T_d] - 273.15)
    end
    plot!(T0_range .- 273.15, Td_vals, label = "RH = $rh", linewidth = 2)
end
plot!()
Example block output

Figure 17.11: Lifting Condensation Level

Height of the lifting condensation level (LCL) as a function of surface temperature and relative humidity (Eq. 17.49).

plot(title = "Fig. 17.11: Lifting Condensation Level",
    xlabel = "Surface Temperature (°C)", ylabel = "LCL Height (m)",
    legend = :topleft)

for rh in [0.2, 0.4, 0.6, 0.8]
    h_vals = Float64[]
    for T0 in T0_range
        prob = NonlinearProblem(cd_sys, Dict(cd_sys.T_0 => T0, cd_sys.RH => rh))
        sol = solve(prob)
        push!(h_vals, sol[cd_sys.h_LCL])
    end
    plot!(T0_range .- 273.15, h_vals, label = "RH = $rh", linewidth = 2)
end
plot!()
Example block output

Droplet Growth Rate

Growth rate of cloud droplets as a function of diameter at 1% supersaturation (Eq. 17.70), demonstrating that smaller droplets grow faster (dDp/dt ∝ 1/Dp).

dg = DropletGrowth()
dg_sys = mtkcompile(dg)

D_range = 10.0 .^ range(log10(1e-6), log10(50e-6), length = 50)
growth_vals = Float64[]

for D_val in D_range
    prob = NonlinearProblem(dg_sys,
        Dict(
            dg_sys.D_p => D_val, dg_sys.S_v => 1.01, dg_sys.T => 293.15,
            dg_sys.n_s => 0.0, dg_sys.d_u => 0.0
        ))
    sol = solve(prob)
    push!(growth_vals, sol[dg_sys.dDp_dt])
end

plot(D_range * 1e6, growth_vals * 1e6,
    xlabel = "Droplet Diameter (µm)", ylabel = "Growth Rate dD_p/dt (µm/s)",
    linewidth = 2, label = "S = 1.01, T = 293 K",
    title = "Droplet Growth Rate (Eq. 17.70)",
    legend = :topright)
Example block output

Ice Nuclei Concentration

Ice nuclei concentration increases exponentially with decreasing temperature (Eq. 17.103).

ice = IcePhysics()
ice_sys = mtkcompile(ice)

T_ice_range = 233.15:1.0:273.15  # -40°C to 0°C
IN_vals = Float64[]

for T_val in T_ice_range
    prob = NonlinearProblem(ice_sys, Dict(ice_sys.T => T_val, ice_sys.a_w => 1.0))
    sol = solve(prob)
    push!(IN_vals, sol[ice_sys.IN] / 1000.0)  # Convert from /m³ to /L
end

plot(T_ice_range .- 273.15, IN_vals,
    xlabel = "Temperature (°C)", ylabel = "Ice Nuclei (L⁻¹)",
    yscale = :log10, linewidth = 2, label = "Eq. 17.103",
    title = "Ice Nuclei Concentration",
    legend = :topright)
Example block output