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 double delt, const size_t maxniters, const double rtol, const double atol, const double minsubdelt)¶
Constructs a DoCondensation object.
- Parameters:
do_alter_thermo – Whether to alter the thermodynamics of the State.
delt – Time step to integrate ODE using implcit Euler method.
maxniters – Maximum no. iterations of Newton Raphson Method.
rtol – Relative tolerance for implicit Euler method.
atol – Absolute tolerance for implicit Euler method.
minsubdelt – Minimum subtimestep in cases of substepping implicit Euler method.
-
inline subviewd_supers operator()(const TeamMember &team_member, const unsigned int subt, subviewd_supers supers, State &state, const SDMMonitor auto mo) 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.
mo – Monitor of SDM processes.
- Returns:
The updated view super-droplets.
Private Functions
-
inline void do_condensation(const TeamMember &team_member, const subviewd_supers supers, State &state, const SDMMonitor auto mo) 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.
mo – Monitor of SDM processes.
-
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.
Private Members
-
ImplicitEuler impe¶
instance of ImplicitEuler ODE solver
-
inline DoCondensation(const bool do_alter_thermo, const double delt, const size_t maxniters, const double rtol, const double atol, const double minsubdelt)¶
-
inline MicrophysicalProcess auto Condensation(const unsigned int interval, const std::function<double(unsigned int)> step2dimlesstime, const bool do_alter_thermo, const size_t maxniters, const double rtol, const double atol, const double MINSUBDELT, 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.
maxniters – Maximum no. iterations of Newton Raphson Method.
step2dimlesstime – A function to convert ‘interval’ time-step to a dimensionless time.
rtol – Relative tolerance for implicit Euler method.
atol – Absolute tolerance for implicit Euler method.
MINSUBDELT – Minimum subtimestep in cases of substepping implicit Euler method.
realtime2dimless – A function to convert a real-time to a dimensionless time.
- Returns:
The constructed microphysical process for condensation / evaporation.