Skip to content

Commit 8591890

Browse files
authored
Merge pull request #566 from CliMA/he/ventilation
Add ventilation_factor function to Common
2 parents 54d4b66 + 98f851c commit 8591890

File tree

4 files changed

+63
-0
lines changed

4 files changed

+63
-0
lines changed

docs/src/API.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ Common.Chen2022_vel_coeffs_B2
244244
Common.Chen2022_vel_coeffs_B4
245245
Common.volume_sphere_D
246246
Common.volume_sphere_R
247+
Common.ventilation_factor
247248
```
248249

249250
# Parameters

src/Common.jl

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export Chen2022_exponential_pdf
2121
export Chen2022_vel_coeffs_B1
2222
export Chen2022_vel_coeffs_B2
2323
export Chen2022_vel_coeffs_B4
24+
export ventilation_factor
2425

2526
"""
2627
G_func(air_props, tps, T, Liquid())
@@ -361,4 +362,30 @@ See also [`volume_sphere_D`](@ref).
361362
"""
362363
volume_sphere_R(R) = volume_sphere_D(2R)
363364

365+
"""
366+
ventilation_factor(vent, aps, v_term)
367+
368+
Returns a function that computes the ventilation factor for a particle as a function of its diameter, `D`.
369+
370+
The ventilation factor parameterizes the increase in the mass and heat exchange for falling particles.
371+
372+
# Arguments
373+
- `vent`: Ventilation parameterization constants, [`CMP.VentilationSB2005`](@ref)
374+
- `aps`: Parameters with air properties, [`CMP.AirProperties`](@ref)
375+
- `v_term`: A function `v_term(D)` that returns the terminal velocity of a particle with diameter `D`
376+
377+
# Returns
378+
- `F_v(D)`: The ventilation factor as a function of diameter, `D`
379+
380+
See e.g. [SeifertBeheng2006](@cite) Eq. (24) for the definition of the ventilation factor.
381+
"""
382+
function ventilation_factor(vent, aps, v_term)
383+
(; vent_a, vent_b) = vent
384+
(; ν_air, D_vapor) = aps
385+
N_sc = ν_air / D_vapor # Schmidt number
386+
N_Re(D) = D * v_term(D) / ν_air # Reynolds number
387+
F_v(D) = vent_a + vent_b * (N_sc) * (N_Re(D)) # Ventilation factor
388+
return F_v
389+
end
390+
364391
end # module end

test/runtests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ include("aqua.jl")
1717
include("performance_tests.jl")
1818
include("aerosol_activation_calibration.jl")
1919
include("ice_nucleation_calibration.jl")
20+
include("ventilation_tests.jl")

test/ventilation_tests.jl

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
using Test: @testset, @test, @test_throws, @test_broken
2+
import CloudMicrophysics.P3Scheme as P3
3+
import CloudMicrophysics.Common as CO
4+
import CloudMicrophysics.Parameters as CMP
5+
import CloudMicrophysics.Microphysics2M as CM2
6+
import Thermodynamics as TD
7+
import ClimaParams as CP
8+
9+
@info("Ventilation factor tests")
10+
11+
function test_ventilation_factor(FT)
12+
@testset "Ventilation factor / P3 terminal velocity smoke test ($FT)" begin
13+
params = CMP.ParametersP3(FT)
14+
vel = CMP.Chen2022VelType(FT)
15+
aps = CMP.AirProperties(FT)
16+
F_rim = FT(0.5) # Riming fraction [-]
17+
ρ_r = FT(500) # Riming density [kg/m³]
18+
ρₐ = FT(1.2) # Air density [kg/m³]
19+
state = P3.get_state(params; F_rim, ρ_r)
20+
vent = state.params.vent
21+
v_term = D -> P3.ice_particle_terminal_velocity(state, D, vel, ρₐ)
22+
vent_factor = CO.ventilation_factor(vent, aps, v_term)
23+
Ds = range(FT(0.5e-4), stop = FT(4.5e-4), length = 5)
24+
calc_vents = vent_factor.(Ds)
25+
smoke_vents = [0.91818553, 1.3191912, 1.7451854, 2.1598392, 2.5553002]
26+
for (calc_vent, smoke_vent) in zip(calc_vents, smoke_vents)
27+
@test calc_vent smoke_vent rtol = 1e-6
28+
end
29+
end
30+
end
31+
32+
for FT in [Float32, Float64]
33+
test_ventilation_factor(FT)
34+
end

0 commit comments

Comments
 (0)