Skip to content

Commit

Permalink
merge with upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
trontrytel committed Apr 16, 2024
2 parents 010773c + 94d1a96 commit f2c5236
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 5 deletions.
34 changes: 34 additions & 0 deletions docs/src/P3Scheme.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,37 @@ Using this approach we get the following relative errors for ``\lambda``
include("plots/P3LambdaErrorPlots.jl")
```
![](P3LambdaHeatmap.png)

## Terminal Velocity

We calculated moment-weighted terminal velocity speeds using the [Chen2022](@cite) velocity parametrization.
The mass total-weighted fall speed (``V_m``) and the number total-weighted fall speed (``V_n``) were calculated as follows:

```math
V_m = \frac{\int_{0}^{\infty} \! V(D) m(D) N'(D) \mathrn{d}D}{\int_{0}^{\infty} \! m(D) N'(D) \mathrm{d}D}
```
```math
V_n = \frac{\int_{0}^{\infty} \! V(D) N'(D) \mathrn{d}D}{\int_{0}^{\infty} \! N'(D) \mathrm{d}D}
```

where ``V(D)`` is the velocity given by the Chen parametrization for a particle of diameter D, defined below.

```math
V(D) = \phi^{\kappa} \sum_{i=1}^{j} \; a_i D^{b_i} e^{-c_i \; D}
```

and ``\phi = (16 \rho_{ice}^2 A(D)^3) / (9 \pi m(D)^2)``.

Finally, we also analyzed the mass-weighted mean particle size ``D_m`` which is given by the following:

```math
D_m = \frac{\int_{0}^{\infty} \! D m(D) N'(D) \mathrn{d}D}{\int_{0}^{\infty} \! m(D) N'(D) \mathrm{d}D}
```

Plotting these relationships for small, medium, and large ``D_m`` gives us the following:

```@example
include("plots/P3TerminalVelocityPlots.jl")
```

![](MorrisonandMilbrandtFig2.svg)
6 changes: 3 additions & 3 deletions docs/src/plots/P3TerminalVelocityPlots.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import CLIMAParameters
import CLIMAParams
import CloudMicrophysics as CM
import CloudMicrophysics.P3Scheme as P3
import CloudMicrophysics.Parameters as CMP
Expand Down Expand Up @@ -32,7 +32,7 @@ function get_values(

V_m[i, j] =
P3.terminal_velocity_mass(p3, Chen2022, q, N, ρ_r, F_r, ρ_a)
# get D_m in mm for plots
# get D_m in mm for plots
D_m[i, j] = 1e3 * P3.D_m(p3, q, N, ρ_r, F_r)
end
end
Expand All @@ -54,7 +54,7 @@ function figure_2()
q_s = FT(0.0008)
N_s = FT(1e6)

# medium D_m
# medium D_m
q_m = FT(0.22)
N_m = FT(1e6)

Expand Down
4 changes: 2 additions & 2 deletions src/P3Scheme.jl
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ end
- c1, c2, c3 - respective constants
Integrates the function c1 * D ^ (c2) * exp(-c3 * D) dD from a to b
Returns the result
Returns the result
"""
function integrate_to_gamma(a::FT, b::FT, c1::FT, c2::FT, c3::FT) where {FT}
if b == Inf
Expand Down Expand Up @@ -422,7 +422,7 @@ function distribution_parameter_solver(
end

"""
terminal_velocity_mass(p3, Chen2022, q, N, ρ_r, F_r)
terminal_velocity(p3, Chen2022, q, N, ρ_r, F_r)
- p3 - a struct with P3 scheme parameters
- Chen 2022 - a struch with terminal velocity parameters as in Chen(2022)
Expand Down

0 comments on commit f2c5236

Please sign in to comment.