Microphysical Process

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

template<typename P>
concept MicrophysicalProcess
#include <microphysicalprocess.hpp>

Concept of a microphysical process.

The MicrophysicalProcess concept represents all types that meet the requirements (constraints) of two time-stepping functions (“next_step” and “on_step”), as well as the constraints on the “run_step” function.

tparam P:

The type that satisfies the MicrophysicalProcess concept.

template<MicrophysicalProcess Microphys1, MicrophysicalProcess Microphys2>
struct CombinedMicrophysicalProcess

Combined microphysical process struct.

The CombinedMicrophysicalProcess struct combines two microphysical processes into one. It implements the MicrophysicalProcess concept by delegating calls to the individual processes. Structure enacts associative addition operation that defines the set for the microphysical process Monoid.

Template Parameters:
  • Microphys1 – The type of the first microphysical process.

  • Microphys2 – The type of the second microphysical process.

Public Functions

inline CombinedMicrophysicalProcess(const Microphys1 a, const Microphys2 b)

Constructs a CombinedMicrophysicalProcess object.

Parameters:
  • a – The first microphysical process.

  • b – The second microphysical process.

inline unsigned int next_step(const unsigned int subt) const

Returns the next time step for the combined microphysical process.

Parameters:

subt – The current time step.

Returns:

The smaller of the next time steps from the two individual processes.

inline bool on_step(const unsigned int subt) const

Checks if the combined microphysical process should perform an on-step action.

Parameters:

subt – The current time step.

Returns:

True if either individual process indicates an on-step action.

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

Runs the combined microphysical process.

Parameters:
  • team_member – The Kokkos team member executing the process.

  • subt – The current time step.

  • supers – The view of super-droplets.

  • state – The state of the system / volume.

Returns:

The updated view of super-droplets after the process.

Private Members

Microphys1 a

The first instance of type of MicrophysicalProcess.

Microphys2 b

The second instance of type of MicrophysicalProcess.

auto operator>>(const MicrophysicalProcess auto a, const MicrophysicalProcess auto b)

Operator for combining two microphysical processes.

This operator combines two microphysical processes into one using the CombinedMicrophysicalProcess struct.

Parameters:
  • a – The first microphysical process.

  • b – The second microphysical process.

Returns:

The combined microphysical process.

struct NullMicrophysicalProcess

Null microphysical process struct.

The NullMicrophysicalProcess struct represents a microphysical process that does nothing. It is defined to satisfy null member of the Monoid set.

Public Functions

inline unsigned int next_step(const unsigned int subt) const

Returns the next time step for the null microphysical process.

Parameters:

subt – The current time step.

Returns:

The maximum unsigned integer value, indicating no further time step will require action of null microphyisical process.

inline bool on_step(const unsigned int subt) const

Checks if the null microphysical process should perform an on-step action.

Parameters:

subt – The current time step.

Returns:

Always returns false, indicating no action is ever performed.

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

Runs the null microphysical process.

Is null, i.e. does nothing and returns unchanged super-droplet view.

Parameters:
  • team_member – The team member executing the process.

  • subt – The current time step.

  • supers – The view of super-droplets.

  • state – The state of the system.

Returns:

The unchanged view of super-droplets.

template<typename F>
concept MicrophysicsFunc
#include <microphysicalprocess.hpp>

Concept for a microphysics function.

The MicrophysicsFunc concept represents all function-like types that can be called by the “run_step” function in ConstTstepMicrophysics.

tparam F:

The type that satisfies the MicrophysicsFunc concept.

template<MicrophysicsFunc F>
struct ConstTstepMicrophysics

Struct representing microphysics with constant time step.

The ConstTstepMicrophysics struct is a type that satisfies the concept of microphysical process and has a constant time step interval. It can be used to create microphysical processes with constant time steps between action of microphysics determined by the MicrophysicsFunc type ‘F’.

Template Parameters:

F – The type of the microphysics function.

Public Functions

inline ConstTstepMicrophysics(const unsigned int interval, const F f)

Constructs a ConstTstepMicrophysics object.

Parameters:
  • interval – The constant time step between calls to microphysics.

  • f – The microphysics function.

inline unsigned int next_step(const unsigned int subt) const

Returns the next time when the microphysics should be called given its constant interval.

Parameters:

subt – The current time step.

Returns:

The next time step based on the interval.

inline bool on_step(const unsigned int subt) const

Checks if the constant time step microphysics should perform an on-step action.

Parameters:

subt – The current time step.

Returns:

True if the current time step is a multiple of the interval.

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

Runs microphysics with the constant time step.

Parameters:
  • team_member – The team member executing the process.

  • subt – The current time step.

  • supers – The view of super-droplets.

  • state – The state of the system / volume.

Returns:

The updated view of super-droplets after the process.

Private Members

unsigned int interval

The constant time step between calls to microphysics.

F do_microphysics

Function-like microphysics is type of MicrophysicsFunc