CliMA / CliMA/CloudMicrophysics.jl

P3: `D_gr` is less than `D_th` for some `F_rim`, `ρ_rim`

Open
#587 2 comments 0 reactions 0 assignees View on GitHub
P3
Dominant language
Julia
Stars
55
Forks
11
Avg merge
1d 5h
Merged PRs (30d)
8

Description

It appears that for some values of `F_rim` and `ρ_rim`, the expected relationship `D_th < D_gr < D_cr` does not hold.

In particular, `F_rim=0.93`, `ρ_rim=975.0` gives rise to `D_th > D_gr`. Code follows:

1. Using built-in functionality (needs #582):

```Julia
import CloudMicrophysics.Parameters as CMP
import CloudMicrophysics.P3Scheme as P3
FT = Float64
params = CMP.ParametersP3(FT)
F_rim = FT(0.93)
ρ_rim = FT(975)
D_th1, D_gr1, = P3.get_thresholds_ρ_g(params, F_rim, ρ_rim)
# 9.73e-5 9.69e-5
```

2. using previous iterative methods

```Julia
import RootSolvers as RS

FT = Float64
F_rim = FT(0.93)
ρ_rim = FT(975)

# Constants from CMP.ParametersP3
α_va, β_va = 0.018537721864540644, 1.9
ρ_i = 916.7

function ρ_d_helper(D_cr, D_gr)
β_m2 = β_va - 2
6 * α_va * (D_cr^β_m2 - D_gr^β_m2) / π / β_m2 / (D_cr - D_gr)
end
ρ_g_helper(F_rim, ρ_rim, ρ_d) = F_rim * ρ_rim + (1 - F_rim) * ρ_d
D_gr_helper(ρ_g) = (6 * α_va / π / ρ_g)^(1 / (3 - β_va))
D_cr_helper(F_rim, ρ_g) = (1 / (1 - F_rim) * 6 * α_va / π / ρ_g)^(1 / (3 - β_va))

P3_problem(ρ_d) =
ρ_d - ρ_d_helper(
D_cr_helper(F_rim, ρ_g_helper(F_rim, ρ_rim, ρ_d)),
D_gr_helper(ρ_g_helper(F_rim, ρ_rim, ρ_d)),
)

ρ_d =
RS.find_zero(
P3_problem,
RS.SecantMethod(FT(0), FT(1000)),
RS.CompactSolution(),
).root
# 193.4

ρ_g = ρ_g_helper(F_rim, ρ_rim, ρ_d)
# 920.3

D_th = (π * ρ_i / 6 / α_va)^(1 / (β_va - 3))
# 9.73e-5

D_gr_helper(ρ_g)
# 9.69e-5
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with P3.get_thresholds_ρ_g and ParametersP3, reproducing the supplied F_rim=0.93 and ρ_rim=975.0 case and comparing it with the iterative RootSolvers calculation. Trace the threshold relationship and determine whether the expected D_th < D_gr < D_cr ordering is valid; done means the discrepancy is explained and the issue's expected behavior is resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.