Condensation

Header file: <libs/superdrops/condensation.hpp> [source]

struct DoCondensation

Implements condensation and evaporation microphysics for super-droplets.

Public Functions

inline DoCondensation(const bool do_alter_thermo, const unsigned int niters, const double delt, const double maxrtol, const double maxatol, const double subdelt)

Constructs a DoCondensation object.

Parameters:
  • do_alter_thermo – Whether to alter the thermodynamics of the State.

  • niters – Number of iterations of implicit Euler method.

  • delt – Time step to integrate ODE using implcit Euler method.

  • maxrtol – Maximum relative tolerance for implicit Euler method.

  • maxatol – Maximum absolute tolerance for implicit Euler method.

  • subdelt – Sub-time step size in implicit Euler method.

inline subviewd_supers operator()(const TeamMember &team_member, const unsigned int subt, subviewd_supers supers, State &state) const

Operator used as an “adaptor” for using condensation as the function-like type satisfying the MicrophysicsFunction concept.

This operator is an “adaptor” for using condensation as the MicrophysicsFunction type in a ConstTstepMicrophysics instance (hint which satsifies the MicrophysicalProcess concept).

Parameters:
  • team_member – The Kokkos team member.

  • subt – The microphysics time step.

  • supers – The view of super-droplets.

  • state – The State.

Returns:

The updated view super-droplets.

Private Functions

void do_condensation(const TeamMember &team_member, const subviewd_supers supers, State &state) const

Enacts condensation / evaporation microphysics.

Enacts condensation / evaporation microphysics. Change to superdroplet radius, and optionally thermodynamics of the State due to sum of water condensed via diffusion and condensation / evporation of water vapour during a given timestep delt. Using equations (eqn [X.YY]) from “An Introduction To Clouds From The Microscale to Climate” by Lohmann, Luond and Mahrt, 1st edition.

Parameters:
  • team_member – The Kokkos team member.

  • supers – The superdroplets.

  • state – The state.

double superdroplets_change(const TeamMember &team_member, const subviewd_supers supers, const State &state) const

Changes super-droplet radii according to condensation / evaporation and returns the total change in liquid water mass in volume as a result.

returns total change in liquid water mass (dimensionless) in volume, ‘mass_condensed’, due to condensation onto / evaporation of super-droplets.

The equivalent serial version of Kokkos::parallel_reduce([…]) is summing deltamass over loop:

for (size_t ii(0); ii < ngbxs; ++ii)
{
 [...]
 totmass_condensed += deltamass;
}

Parameters:
  • team_member – The Kokkos team member.

  • supers – The superdroplets.

  • state – The state.

Returns:

The total change in liquid water mass.

double superdrop_mass_change(Superdrop &drop, const double temp, const double s_ratio, const double ffactor) const

Updates the super-droplet radius and returns the mass of liquid condensed or evaporated.

Updates the super-droplet radius due to radial growth/shrink via condensation and diffusion of water vapour according to equations from “An Introduction To Clouds From The Microscale to

Climate” by Lohmann, Luond and Mahrt, 1st edition. New radius is calculated using ‘impe’

ImplicitEuler instance which iteratively solves forward integration of condensation-diffusion ODE. Return mass of liquid that condensed onto / evaporated off of droplet.

Parameters:
  • drop – The super-droplet.

  • temp – The ambient temperature.

  • s_ratio – The saturation ratio.

  • ffactor – The sum of the diffusion factors.

Returns:

The mass of liquid condensed or evaporated.

void effect_on_thermodynamic_state(const TeamMember &team_member, const double totmass_condensed, State &state) const

Applies the effect of condensation / evaporation on the thermodynamics of the State.

if do_alter_thermo is true, use a single team member to change the thermodynamics of the State due to the effect of condensation / evaporation.

Parameters:
  • team_member – The Kokkos team member.

  • totmass_condensed – The total mass of liquid condensed.

  • state – The State of the volume containing the super-droplets (prior to condensation / evaporation).

State state_change(const double totrho_condensed, State &state) const

Changes the thermodynamic variables of the State.

Changes the thermodynamic variables, temperature, vapour and liquid mass mixing ratios (qvap and qcond respectively) of the State given the total change in condensed water mass in its volume.

Parameters:
  • totrho_condensed – The total condensed water mass in volume of State.

  • state – The State of the volume containing the super-droplets (prior to condensation / evaporation).

Returns:

The updated State.

Private Members

bool do_alter_thermo

Whether to make condensation/evaporation alter State or not

ImplicitEuler impe

instance of ImplicitEuler ODE solver

inline MicrophysicalProcess auto Condensation(const unsigned int interval, const std::function<double(unsigned int)> step2dimlesstime, const bool do_alter_thermo, const unsigned int niters, const double maxrtol, const double maxatol, const double SUBDELT, const std::function<double(double)> realtime2dimless)

Constructs a microphysical process for condensation / evaporation of super-droplets with a constant time-step ‘interval’.

Parameters:
  • interval – The constant time-step for condensation.

  • do_alter_thermo – Whether to alter the thermodynamic state after condensation / evaporation.

  • niters – Number of iterations of implicit Euler method.

  • step2dimlesstime – A function to convert ‘interval’ time-step to a dimensionless time.

  • maxrtol – Maximum relative tolerance for implicit Euler method.

  • maxatol – Maximum absolute tolerance for implicit Euler method.

  • SUBDELT – The sub-time step of implicit Euler method.

  • realtime2dimless – A function to convert a real-time to a dimensionless time.

Returns:

The constructed microphysical process for condensation / evaporation.