Coalescence-Breakup-Rebound¶
Header file: <libs/superdrops/collisions/coalbure.hpp>
[source]
-
template<NFragments NFrags, CoalBuReFlag Flag>
struct DoCoalBuRe¶ DoCoalBuRe = DoCoalescenceBreakupRebound, i.e. enacts collision-coalescence, breakup, or rebound of super-droplets.
This class template implements the collision-coalescence, breakup, or rebound of superdroplets based on specified flag values.
- Template Parameters:
NFrags – Calculation for number of fragments in case of breakup.
Flag – Flag indicating the type of action to perform: coalescence, breakup, or rebound.
Public Functions
-
inline DoCoalBuRe(const NFrags nfrags, const Flag flag)¶
Constructs a new DoCoalBuRe = DoCoalescenceBreakupRebound object.
- Parameters:
nfrags – Calculation for the nmber of fragments in cases of breakup.
flag – Flag indicating the action to perform: coalescence, breakup or rebound.
-
inline bool operator()(Superdrop &drop1, Superdrop &drop2, const double prob, const double phi) const¶
Operator used as an adaptor such that DoCoalBuRe 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, breakup or rebound of two super-droplets.
- Parameters:
drop1 – First superdroplet.
drop2 – Second superdroplet.
prob – Probability of collision.
phi – Phi value.
- Returns:
True if the resulting superdroplet is null, otherwise false.
Private Functions
-
inline uint64_t rescale_phi(const double prob, const double phi) const¶
Rescales a random number phi to be in the desired range [0, 1].
This function adjusts the value of phi to account for the fact that if a collision occurs (i.e., if gamma != 0), then phi lies in the range [0, prob - floor(prob)] instead of [0, 1].
Note
This function is assumed to be consistent with collision_gamma(…) and must be.
- Parameters:
prob – The probability of collision.
phi – Random number, assumed to be in the range [0.0, prob - floor(prob)].
- Returns:
The rescaled value of phi as a uint64_t.
-
inline uint64_t collision_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.
This function calculates the value of the gamma factor for collisions based on the given probability of collisions. The calculation is as described for collision-coalescence in Shima et al. 2009 but applied to collisions (which may result in coalescence, rebound or breakup) not just collision-coalescence.
Note: Probability is probability of collision NOT collision-coalescence.
- Parameters:
xi1 – The multiplicity of the first super-droplet.
xi2 – The multiplicity of the second super-droplet.
prob – The probability of collision.
phi – Random number in the range [0.0, 1.0].
- Returns:
The calculated value of the collision gamma factor.
-
bool coalesce_breakup_or_rebound(const uint64_t gamma, const double phi, Superdrop &drop1, Superdrop &drop2) const¶
Enacts rebound, coalescence, or breakup based on the flag.
This function enacts rebound, coalescence, or breakup based on the specified flag value: If flag = 1 -> coalescence. If flag = 2 -> breakup. Otherwise -> rebound.
- Parameters:
gamma – The gamma factor.
phi – Phi value.
drop1 – First superdroplet.
drop2 – Second superdroplet.
- Returns:
True if the resulting superdroplet is null, otherwise false.
Private Members
-
DoCoalescence coal¶
Instance of DoCoalescence.
-
template<PairProbability Probability, NFragments NFrags, CoalBuReFlag Flag>
inline MicrophysicalProcess auto CoalBuRe(const unsigned int interval, const std::function<double(unsigned int)> int2realtime, const Probability collprob, const NFrags nfrags, const Flag coalbure_flag)¶ Constructs a Microphysical Process for collision-coalescence, breakup, or rebound of superdroplets.
This function constructs a Microphysical Process for collision-coalescence, breakup, or rebound of superdroplets with a constant timestep ‘interval’ and probability of collision determined by ‘collprob’.
- Template Parameters:
Probability – Type of PairProbability.
NFrags – Number of fragments for breakup.
Flag – Flag indicating the action to perform.
- Parameters:
interval – Timestep interval between collision events.
int2realtime – Function to convert interval to a real time [s].
collprob – Probability of collisions.
nfrags – Calculatino for number of fragments cases of breakup.
coalbure_flag – Flag indicating the action to perform: coalescence, breakup or rebound.
- Returns:
A Microphysical Process enacting collision- coalescence, breakup or rebound.