Skip to content

Commit 259b8d5

Browse files
tapiosszy21
authored andcommitted
Add vapor static energy function
1 parent 7102ec2 commit 259b8d5

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "Thermodynamics"
22
uuid = "b60c26fb-14c3-4610-9d3e-2d17fe7ff00c"
33
authors = ["Climate Modeling Alliance"]
4-
version = "0.15.0"
4+
version = "0.15.1"
55

66
[deps]
77
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"

docs/src/API.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ liquid_specific_humidity
8787
mixing_ratios
8888
moist_static_energy
8989
dry_static_energy
90+
vapor_static_energy
9091
virtual_dry_static_energy
9192
q_vap_from_RH_liquid
9293
q_vap_saturation

src/air_energies.jl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export specific_enthalpy_liquid
1414
export specific_enthalpy_ice
1515
export total_specific_enthalpy
1616
export dry_static_energy
17+
export vapor_static_energy
1718
export virtual_dry_static_energy
1819

1920
"""
@@ -336,3 +337,19 @@ The dry static energy, given
336337
@inline function dry_static_energy(param_set::APS, T, e_pot)
337338
return specific_enthalpy_dry(param_set, T) + e_pot
338339
end
340+
341+
"""
342+
vapor_static_energy(param_set, T, e_pot)
343+
344+
The `dry` static energy of water vapor, `cp_v * (T - T_0) + e_pot`, given
345+
346+
- `param_set` an `AbstractParameterSet`, see the [`Thermodynamics`](@ref) for more details
347+
- `T` temperature
348+
- `e_pot` gravitational potential energy per unit mass (geopotential)
349+
350+
"""
351+
@inline function vapor_static_energy(param_set::APS, T, e_pot)
352+
cp_v = TP.cp_v(param_set)
353+
T_0 = TP.T_0(param_set)
354+
return cp_v * (T - T_0) + e_pot
355+
end

0 commit comments

Comments
 (0)