Skip to content

Commit

Permalink
feat: use lognormal distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
yoctoyotta1024 committed Apr 29, 2024
1 parent a66607b commit 5484126
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libs/cartesiandomain/add_supers_at_domain_top.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ double CreateSuperdrop::droplet_numconc_distribution(const double radius,
return dnumconc_dlnr * dlnr; // number of droplets per unit volume
}

double lognormal_pdf(const double radius) {
/* normalised lognormal distribution returns the probability density of a given radius */
double CreateSuperdrop::lognormal_pdf(const double radius) const {
const auto inverse_norm = radius * sigtilda * std::sqrt(2.0 * std::numbers::pi);
const auto expo = (std::log(radius) - mutilda) / sigtilda;
return std::exp(-0.5 * expo * expo) / inverse_norm;
Expand Down

0 comments on commit 5484126

Please sign in to comment.