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 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 collision-coalescence.

This function calculates the value of the gamma factor in collision-coalescence based on the given probability of collision.

Note: Probability is probability of collision NOT collision-coalescence.

Parameters:
  • xi1 – Xi value of the first superdroplet.

  • xi2 – Xi value of the second superdroplet.

  • prob – Probability of collision.

  • phi – Phi value.

Returns:

The calculated 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.

DoBreakup<NFrags> bu

Instance of DoBreakup with specified no. of fragments calculation.

Flag coalbure_flag

Instance of CoalBuReFlag indicating the action to perform.

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.