Coalescence
Droplets.jl uses the Superdroplet method for coalescence (Shima et al., 2009).
Droplets.coagulation_run_0D — Type
struct coagulation_run{FT<:AbstractFloat}Struct initialising temp memory used for coagulation.
Input:
- Ns::Int : Number of superdroplets.
Fields:
- I::Vector{Int} : Vector of indexes to be shuffled for permutations.
- pαdt::Vector{FT} : Vector of coalescence probabilities for each pair.
- ϕ::Vector{FT} : Random numbers to be used in Monte Carlo coalescence.
- lowest_zero::Ref{Bool} : Reference to a boolean indicating if the lowest multiplicity is zero.
- deficit::Ref{FT} : Reference to a float representing the deficit in mass or volume.
Droplets.coagulation_run_spatial — Type
coagulation_run_spatial{FT<:AbstractFloat}
struct for allocation related to coalescence in a spatially resolved simulation.Droplets.coalescence_timestep! — Method
coalescence_timestep!(run::backend, scheme::scheme_type, droplets::droplet_attributes)Perform a coalescence timestep for the given droplets using the Superdroplet Method (SDM) Shima et al. (2009) when the lowest multiplicity of superdroplets is less than 1, the largest superdroplet is split into two equal parts, as proposed by Dziekan and Pawlowska (ACP, 2017) https://doi.org/10.5194/acp-17-13509-2017
Arguments
run::backend: Serial or Parallelscheme::schemetype: adaptive timestepping or nonedroplets::droplet_attributes: The superdroplets.
if dropletattributes1d, coagdata must be coagulationrun_spatial
Droplets.adaptive_pαdt! — Method
adaptive_pαdt!(L::Vector{Tuple{Int,Int}}, droplets::droplet_attributes, coag_data::coagulation_run, t_left::Ref{FT}, kernel::Function, settings::coag_settings{FT}) where FT<:AbstractFloatMap the probability function over the list of droplet pairs, L, using adaptive timestepping logic and update the coagulation data in place.
Arguments
L::Vector{Tuple{Int,Int}}: List of droplet indices.droplets::droplet_attributes: Droplet attributes.coag_data::coagulation_run: Coagulation data.t_left::Ref{FT}: Timestep after adaptive substep.kernel::Function: Coalescence kernel function.settings::coag_settings{FT}: Coagulation settings.
Droplets.compute_pαdt! — Method
compute_pαdt!(L::Vector{Tuple{Int,Int}}, droplets::droplet_attributes, coag_data::coagulation_run, kernel::Function, scale::FT,scalecoagsettings::coag_settings{FT}) where FT<:AbstractFloatMap the probability function over the list of droplet pairs, L, and update the coagulation data in place.
Arguments
L::Vector{Tuple{Int,Int}}: List of droplet indices to be considered for coalescence.droplets::droplet_attributes: Droplet attributes.coag_data::coagulation_run: Coagulation data.kernel::Function: Coalescence kernel function.coagsettings::coag_settings{FT}: Coagulation settings.
Droplets.pair_Ps_adaptive! — Method
pair_Ps_adaptive!(α::Int, pair::Tuple{Int,Int}, droplets::droplet_attributes, coag_data::coagulation_run, t_max::Vector{FT})This function calculates the coalescence probability for a given pair of droplets, using adaptive timestepping logic (Bartman et al. 2021). It takes the following arguments:
α::Int: The index of the coalescence model.pair::Tuple{Int,Int}: The indices of the droplets in the pair.droplets::droplet_attributes: The attributes of the droplets.coag_data::coagulation_run: The coagulation run data.t_max::Vector{FT}: The maximum timestep allowed given multiple sampling.
Droplets.sdm_update! — Method
sdm_update!(pair::Tuple{Int,Int}, α::Int, droplets::droplet_attributes, coag_data::coagulation_run)Perform the SDM coalescence update for the superdroplets when a coalesence event is determined, updating the droplet attributes in place.
Arguments
pair::Tuple{Int,Int}: The pair of droplets to be updated.α::Int: The index of the coalescence model.droplets::droplet_attributes: The droplet attributes.coag_data::coagulation_run: The coagulation data.
Droplets.test_pairs! — Method
test_pairs!(scheme::backend, Ns::Int, L::Vector{Tuple{Int,Int}}, droplets::droplet_attributes, coag_data::coagulation_run)Perform the SDM coalescence update for the superdroplets. Update the droplet attributes in place in case of coalescence event.
Arguments
scheme::Union{Serial, Parallel}: The scheme to use for the update.Ns::Int: The number of superdroplets.L::Vector{Tuple{Int,Int}}: The list of droplet pairs.droplets::droplet_attributes: The droplet attributes.coag_data::coagulation_run: The coagulation data.
Droplets.init_logarithmic — Method
init_logarithmic(settings::coag_settings{FT}) where FT<:AbstractFloatinit_logarithmic initializes the superdroplets, using a logarithmically spaced droplet radius spectrum, initializing the multiplicities so that the water volume in the system forms an exponential distribution around the initial volume.
Arguments
settings: Coagulation settings.
Droplets.init_monodisperse — Method
init_monodisperse(settings::coag_settings{FT}) where FT<:AbstractFloatinit_monodisperse initializes the superdroplets so that all droplets have the same attributes. Arguments
settings: Coagulation settings.
Droplets.init_uniform_sd — Method
inituniformsd(settings::coag_settings{FT}) where FT<:AbstractFloat
inituniformsd initializes the superdroplets, using an evenly spaced droplet radius spectrum, initializing the multiplicities so that the water volume in the system forms an exponential distribution around the initial volume.
Arguments
settings: Coagulation settings.
Droplets.init_ξ_const — Method
init_ξ_const(settings::coag_settings{FT}) where FT<:AbstractFloatinitξconst initializes droplets based on the constant-multiplicity initialization method, using an exponential distribution around the initial volume of the droplets. The method is as described in Shima et al. (2009) https://doi.org/10.5194/acp-9-4491-2009
Arguments
settings: Coagulation settings, type ::coag_settings.
Droplets.golovinSCE — Method
" golovinSCE(x,x0,n0,b,time)
Analytic solution to the Smoluchowski Collection Equation using the Golovin (additive) kernel (Golovin, 1963).
Arguments
x:: volume evaulated atx0:: initial volumen0:: initial number densityb:: Golovin kernel coefficienttime:: time at which to evaluate the solution
Note the use of the besselix function rather than besseli, to solve overflow issues. The exponential term is then modified to compensate.