Coalescence¶
Header file: <libs/superdrops/collisions/coalescence.hpp>
[source]
-
inline bool is_null_superdrop(const Superdrop &drop)¶
Raises an error if the multiplicity of the super-droplet is 0.
This function checks if the given superdrop is null by verifying its multiplicity. It asserts that the multiplicity (
xi
) of the superdrop is greater than 0. If the multiplicity is 0, an assertion error is raised.- Parameters:
drop – A reference to the
Superdrop
object to be checked.- Returns:
Always returns 0 (=false).
-
struct DoCoalescence¶
Public Functions
-
bool operator()(Superdrop &drop1, Superdrop &drop2, const double prob, const double phi) const¶
Operator used as an adaptor such that DoCoalescence satisfies the PairEnactX concept and so can be used as the EnactCollision function-like object in the DoCollisions struct.
This operator calls functions to enact the collision-coalescence of two super-droplets.
- Parameters:
drop1 – The first super-droplet.
drop2 – The second super-droplet.
prob – The probability of collision-coalescence.
phi – Random number in the range [0.0, 1.0].
- Returns:
boolean=true if collision-coalescence resulted in null superdrops.
-
uint64_t coalescence_gamma(const uint64_t xi1, const uint64_t xi2, const double prob, const double phi) const¶
Calculates the value of the gamma factor in Monte Carlo collision-coalescence.
This function calculates the value of the gamma factor used in Monte Carlo collision-coalescence as described in Shima et al. 2009.
- Parameters:
xi1 – The multiplicity of the first super-droplet.
xi2 – The multiplicity of the second super-droplet.
prob – The probability of collision-coalescence.
phi – Random number in the range [0.0, 1.0].
- Returns:
The calculated value of the coalescence gamma factor.
-
bool coalesce_superdroplet_pair(const uint64_t gamma, Superdrop &drop1, Superdrop &drop2) const¶
Coalesces a pair of superdroplets.
This function coalesces a pair of superdroplets by changing their multiplicity, radius, and solute mass according to Shima et al. 2009 Section 5.1.3. part (5).
- Parameters:
gamma – The coalescence gamma factor.
drop1 – The first superdroplet.
drop2 – The second superdroplet.
- Returns:
True if coalescence results in a null superdroplet, false otherwise.
Private Functions
-
void twin_superdroplet_coalescence(const uint64_t gamma, Superdrop &drop1, Superdrop &drop2) const¶
Enacts coalescence of a pair of superdroplets where xi1 = gamma*xi2.
This function coalesces a pair of superdroplets where drop1.get_xi() = gamma* drop2.get_xi() by making twin superdroplets with the same xi, radius, and solute mass. It implements Shima et al. 2009 Section 5.1.3. part (5) option (b).
In rare case where xi1 = xi2 = gamma = 1, new_xi of drop1 = 0 and drop1 should be removed from domain.
Note: Implicit casting of gamma (and therefore droplets’ xi values) from uint64_t to double.
- Parameters:
gamma – The coalescence gamma factor.
drop1 – The first superdroplet.
drop2 – The second superdroplet.
-
void different_superdroplet_coalescence(const uint64_t gamma, Superdrop &drop1, Superdrop &drop2) const¶
Coalesces a pair of superdroplets where xi1 > gamma*xi2.
This function coalesces a pair of superdroplets where xi1 > gamma*xi2 by growing the radius and mass of drop2 via decreasing the multiplicity of drop1. It implements Shima et al. 2009 Section 5.1.3. part (5) option (a).
Note: Implicit casting of gamma (i.e. therefore droplets’ xi values) from uint64_t to double.
- Parameters:
gamma – The coalescence gamma factor.
drop1 – The first superdroplet.
drop2 – The second superdroplet.
-
bool operator()(Superdrop &drop1, Superdrop &drop2, const double prob, const double phi) const¶
-
template<PairProbability Probability>
inline MicrophysicalProcess auto CollCoal(const unsigned int interval, const std::function<double(unsigned int)> int2realtime, const Probability collcoalprob)¶ Constructs a microphysical process for collision-coalescence of superdroplets.
This function constructs a microphysical process for collision-coalescence of superdroplets with a constant timestep and probability of collision-coalescence determined by ‘collcoalprob’.
- Template Parameters:
Probability – Type satisfying the PairProbability concept.
- Parameters:
interval – The constant timestep interval.
int2realtime – A function that converts an integer timestep to real time.
collcoalprob – The probability of collision-coalescence.
- Returns:
An instance of MicrophysicalProcess for collision-coalescence.