Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

P3 Terminal Velocity #334

Closed
wants to merge 41 commits into from
Closed

P3 Terminal Velocity #334

wants to merge 41 commits into from

Conversation

anastasia-popova
Copy link
Contributor

@anastasia-popova anastasia-popova commented Feb 22, 2024

Purpose

Implement Terminal Velocity in the P3 Scheme, compare to the plots in the Mildbrant and Morrison (2015) paper

To-do

  • transfer to integrate function()
  • move mass function back to the plots
  • implement the Chen 2022 velocity
  • add tests for velocity
  • create plots comparable to the P3 paper
  • compare plots

Content


  • I have read and checked the items on the review checklist.

Copy link

codecov bot commented Feb 22, 2024

Codecov Report

Merging #334 (785cd66) into main (cfe831a) will decrease coverage by 0.26%.
Report is 4 commits behind head on main.
The diff coverage is 92.79%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #334      +/-   ##
==========================================
- Coverage   94.81%   94.56%   -0.26%     
==========================================
  Files          36       36              
  Lines        1253     1342      +89     
==========================================
+ Hits         1188     1269      +81     
- Misses         65       73       +8     
Components Coverage Δ
src 98.68% <92.79%> (-0.61%) ⬇️
ext 54.40% <ø> (ø)

Copy link
Member

@nefrathenrici nefrathenrici left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @anastasia-popova ! I just left a few comments that I hope are helpful

@@ -288,6 +231,26 @@ function DSD_N₀(p3::PSP3, N::FT, λ::FT) where {FT}
return N / Γ(1 + μ) * λ^(1 + μ)
end

"""
integrate_to_gamma(a, b, c1, c2, c3)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is much neater and more readable. Thank you!

).root

return (; λ = exp(x), N_0 = DSD_N₀(p3, N, exp(x)))
end

"""
terminal_velocity_mass(p3, Chen2022, q, N, ρ_r, F_r)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a lot of repetition here. I'll try to combine those two functions into one

Copy link
Member

@nefrathenrici nefrathenrici left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I agree with @trontrytel, there is some duplicate code that could be merged.

@@ -29,6 +30,7 @@ DocStringExtensions = "0.8, 0.9"
EnsembleKalmanProcesses = "1.1.5"
ForwardDiff = "0.10"
MLJ = "0.20"
QuadGK = "2.9.4"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the compat need to be so specific? Would 2.9 work?

Comment on lines +467 to +474
(ai, bi, ci) = CO.Chen2022_vel_coeffs_small(Chen2022, ρ_a)
v += integrate_to_gamma(
FT(0),
D_th,
FT(π) / 6 * p3.ρ_i * ai[i] * N_0,
bi[i] + μ + 3,
ci[i] + λ,
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lines are run in both cases, so they could be hoisted out of the ifelse

@trontrytel
Copy link
Member

Done via #370

@trontrytel trontrytel closed this Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants