Skip to content

Commit 846353f

Browse files
committed
try new buoyancy formulation
1 parent a6f4f67 commit 846353f

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/MoistAirBuoyancies.jl

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,18 @@ const c = Center()
103103
q = @inbounds tracers.q[i, j, k]
104104
𝒰 = HeightReferenceThermodynamicState(θ, q, z)
105105

106-
ρ₀ = base_density(mb.reference_constants, mb.thermodynamics)
106+
# Perform saturation adjustment
107+
α = specific_volume(𝒰, mb.reference_constants, mb.thermodynamics)
108+
109+
# Compute reference specific volume
107110
αʳ = reference_specific_volume(z, mb.reference_constants, mb.thermodynamics)
108111
g = mb.thermodynamics.gravitational_acceleration
109112

110-
# Perform saturation adjustment
111-
α = specific_volume(𝒰, mb.reference_constants, mb.thermodynamics)
113+
# Formulation in terms of base density:
114+
# ρ₀ = base_density(mb.reference_constants, mb.thermodynamics)
115+
# return ρ₀ * g * (α - αʳ)
112116

113-
return ρ₀ * g *- αʳ)
117+
return g *- αʳ) / αʳ
114118
end
115119

116120
@inline ∂z_b(i, j, k, grid, mb::MoistAirBuoyancy, tracers) =
@@ -289,8 +293,9 @@ end
289293
cᵖᵐ = mixture_heat_capacity(state.q, thermo)
290294
inv_ϰᵐ = Rᵐ / cᵖᵐ
291295
pᵣ = reference_pressure(state.z, ref, thermo)
292-
p₀ = ref.base_pressure
293-
return (pᵣ / p₀)^inv_ϰᵐ
296+
FT = eltype(pᵣ)
297+
pₑ₀ = convert(FT, 1e5)
298+
return (pᵣ / pₑ₀)^inv_ϰᵐ
294299
end
295300

296301
#####

0 commit comments

Comments
 (0)