|
ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
|
Super-droplets initialization structure. More...
#include <ERF_SDInitialization.H>


Public Member Functions | |
| virtual | ~SDInjection ()=default |
| void | updateDt (const double a_dt, const bool a_active) |
| Update time-dependent quantities for particle injection. More... | |
| void | readInputs (SDInputs &, const std::string &, const amrex::Geometry &, const MatVec &, const MatVec &) override |
| void | readInputs (SDInputs &a_in, const amrex::Geometry &a_geom, const MatVec &a_species_mat, const MatVec &a_aerosol_mat, const double a_dt) |
| Read super-droplet injection parameters from input file. More... | |
| void | printParameters (const MatVec &, const MatVec &) const override |
| int | numSDPerCell (const amrex::Real) const override |
| Number of super-droplets to inject per cell this step. Decided in updateDt() from the accumulated count (0 = inject nothing). More... | |
| amrex::Real | numParticlesPerCell (const amrex::Real) const override |
| Number of physical particles to inject per cell this step. Equals num_sd * integer-multiplicity, decided in updateDt(). More... | |
| bool | perBoxInjection () const override |
| Per-box high-multiplicity injection (false for initialization and legacy per-cell injection). More... | |
| int | injectBoxCount () const override |
| Number of super-droplets to inject in the whole box this step. More... | |
| amrex::Real | injectMultiplicity () const override |
| Multiplicity of each super-droplet injected this step. More... | |
| unsigned int | injectSeed () const override |
| Reproducible seed for scattering this step's super-droplets. More... | |
Public Member Functions inherited from SDInitProperties | |
| virtual | ~SDInitProperties ()=default |
| virtual void | setDefaults (const amrex::Geometry &a_geom, const MatVec &a_species_mat, const MatVec &a_aerosol_mat) |
| Set default values for initialization parameters. More... | |
| void | getDistribution (amrex::Vector< amrex::Real > &a_mass, int a_np, amrex::Real a_density, SDDistributionType a_init_type, amrex::Real a_mass_min, amrex::Real a_mass_max, amrex::Real a_mass_mean, amrex::Real a_radius_min, amrex::Real a_radius_max, amrex::Real a_radius_mean, amrex::Real a_radius_gstd, std::mt19937 &a_rng) const |
| Get a distribution with constant multiplicity. More... | |
| void | getDistribution (amrex::Vector< amrex::Real > &a_mass, amrex::Vector< amrex::Real > &a_mult, amrex::Real a_dV, int a_np, amrex::Real a_density, SDDistributionType a_init_type, amrex::Real a_mass_min, amrex::Real a_mass_max, amrex::Real a_mass_mean, amrex::Real a_radius_min, amrex::Real a_radius_max, amrex::Real a_radius_mean, amrex::Real a_radius_gstd, std::mt19937 &a_rng) const |
| Get a distribution with sampled multiplicity. More... | |
| void | getAerosolDistribution (amrex::Vector< amrex::Real > &a_mass, const int a_idx, const int a_np, const amrex::Real a_density, std::mt19937 &a_rng) const |
| Compute the aerosol mass distribution. More... | |
| void | getAerosolDistribution (amrex::Vector< amrex::Real > &a_mass, amrex::Vector< amrex::Real > &a_mult, amrex::Real a_dV, int a_idx, int a_np, amrex::Real a_density, std::mt19937 &a_rng) const |
| Compute the aerosol mass distribution with sampled multiplicity. More... | |
| void | getSpeciesDistribution (amrex::Vector< amrex::Real > &a_mass, const int a_idx, const int a_np, const amrex::Real a_density, std::mt19937 &a_rng) const |
| Compute the species mass distribution with constant multiplicity. More... | |
| void | getSpeciesDistribution (amrex::Vector< amrex::Real > &a_mass, amrex::Vector< amrex::Real > &a_mult, amrex::Real a_dV, int a_idx, int a_np, amrex::Real a_density, std::mt19937 &a_rng) const |
| Compute the species mass distribution with sampled multiplicity. More... | |
| SDDistributionParams | getSpeciesDistParams (int a_idx, amrex::Real a_density, amrex::Real a_cell_volume, bool a_sampled_mult) const |
| Get GPU-compatible distribution parameters for a species. More... | |
| SDDistributionParams | getAerosolDistParams (int a_idx, amrex::Real a_density, amrex::Real a_cell_volume, bool a_sampled_mult) const |
| Get GPU-compatible distribution parameters for an aerosol. More... | |
| SDDistributionParams | makeDistributionParams (SDDistributionType a_init_type, amrex::Real a_mass_min, amrex::Real a_mass_max, amrex::Real a_mass_mean, amrex::Real a_radius_min, amrex::Real a_radius_max, amrex::Real a_radius_mean, amrex::Real a_radius_gstd, amrex::Real a_density, amrex::Real a_cell_volume, bool a_sampled_mult) const |
| Create GPU-compatible distribution parameters structure. More... | |
| bool | sampledMultiplicity () const |
| Determine whether multiplicity is sampled or constant. More... | |
| amrex::Real | volume () const |
| Calculate the volume of the particle domain. More... | |
Additional Inherited Members | |
Public Types inherited from SDInitProperties | |
| using | MatVec = std::vector< std::unique_ptr< MaterialProperties > > |
Super-droplets initialization structure.
|
virtualdefault |
Injection rate (number of physical particles per meter^3 second)
|
inlineoverridevirtual |
|
inlineoverridevirtual |
|
inlineoverridevirtual |
|
inlineoverridevirtual |
Number of physical particles to inject per cell this step. Equals num_sd * integer-multiplicity, decided in updateDt().
Implements SDInitProperties.
|
inlineoverridevirtual |
Number of super-droplets to inject per cell this step. Decided in updateDt() from the accumulated count (0 = inject nothing).
Implements SDInitProperties.
|
inlineoverridevirtual |
Per-box high-multiplicity injection (false for initialization and legacy per-cell injection).
Reimplemented from SDInitProperties.
|
overridevirtual |
print super-droplets injection parameters to screen
Reimplemented from SDInitProperties.

|
inlineoverridevirtual |
read super-droplets injection parameters
Reimplemented from SDInitProperties.
| void SDInjection::readInputs | ( | SDInputs & | a_in, |
| const amrex::Geometry & | a_geom, | ||
| const MatVec & | a_species_mat, | ||
| const MatVec & | a_aerosol_mat, | ||
| const double | a_dt | ||
| ) |
Read super-droplet injection parameters from input file.
This function reads injection-specific parameters like injection rate, timing parameters, and domain velocity.
| [in] | a_in | Two-tier input resolver |
| [in] | a_geom | Simulation geometry information |
| [in] | a_species_mat | Vector of species material properties |
| [in] | a_aerosol_mat | Vector of aerosol material properties |
| [in] | a_dt | Current timestep size |

|
inline |
Update time-dependent quantities for particle injection.
This function updates:
The number of super-droplets per cell is the specified count (m_ppc, or derived from the SD rate). The physical-particle count accumulates from the injection rate; a step injects only once each of those super-droplets would carry at least unit multiplicity, with integer multiplicity max(round(num_par/num_sd), 1). This lets sub-unity per-step injection rates be honored automatically, with no separate opt-in.
| [in] | a_dt | Timestep size in seconds |
| [in] | a_active | True while the injection time window is open |
| bool SDInjection::m_both_specified = false |
Whether each knob was specified in any readInputs call (the resolver reports this exactly, in a single pass).
| amrex::Real SDInjection::m_box_volume = -1 |
Accumulated super-droplet count owed to the box (per-box mode)
Referenced by updateDt().
| amrex::Real SDInjection::m_cell_volume = -1 |
Number of super-droplets to inject this step (0 = none). Per cell in legacy mode; per box in per-box high-multiplicity mode.
Referenced by updateDt().
| amrex::Vector<amrex::Real> SDInjection::m_domain_vel = {zero,zero,zero} |
Start time for injection
Referenced by updateDt().
| amrex::Real SDInjection::m_eff_sd_rate = -1 |
Injection-box volume [m^3], set from the box at read time
Referenced by updateDt().
| amrex::Real SDInjection::m_frac_tol = amrex::Real(1.0e-3) |
Minimum multiplicity for per-box injection (default 100)
Referenced by updateDt().
| amrex::Real SDInjection::m_inj_rate = 0 |
Injection rate (number of SDs per meter^3 second)
Referenced by updateDt().
| unsigned int SDInjection::m_inject_count = 0 |
Reproducible seed for scattering this step's super-droplets
Referenced by updateDt().
| amrex::Real SDInjection::m_inject_mult = zero |
Tolerance below 1 at which an accumulated injection fires
Referenced by injectMultiplicity(), numParticlesPerCell(), and updateDt().
| int SDInjection::m_inject_num_sd = 0 |
Integer multiplicity of each super-droplet injected this step
Referenced by injectBoxCount(), numParticlesPerCell(), numSDPerCell(), and updateDt().
| unsigned int SDInjection::m_inject_seed = 0 |
Input prefix (e.g. injection.0) for diagnostic messages
Referenced by injectSeed(), and updateDt().
| amrex::Real SDInjection::m_min_multiplicity = 100 |
Per-box high-multiplicity injection mode (set when particles_per_cell is not specified)
| bool SDInjection::m_mm_specified = false |
Effective SD injection rate [# m^-3 s^-1] used in per-box mode
| amrex::Real SDInjection::m_numdens_accum = zero |
Injection-level cell volume [m^3], set from geometry at read time
Referenced by updateDt().
| amrex::Real SDInjection::m_numdens_sd = -1 |
Injection domain velocity
| bool SDInjection::m_perbox = false |
True when both sd_rate and min_multiplicity are explicitly specified
Referenced by perBoxInjection(), and updateDt().
| bool SDInjection::m_ppc_specified = false |
| std::string SDInjection::m_prefix |
| amrex::Real SDInjection::m_sd_accum = zero |
Count of injection events so far, used as a reproducible scatter seed
Referenced by updateDt().
| amrex::Real SDInjection::m_sd_inj_rate = 0 |
Initial number density of super-droplets
Referenced by updateDt().
| bool SDInjection::m_sd_specified = false |
| amrex::Real SDInjection::m_tstart = zero |
Stop time for injection
| amrex::Real SDInjection::m_tstop = amrex::Real(1.0e17) |
Accumulated physical-particle number density [m^-3]. When the per-cell injection rate is sub-unity, the fractional part is carried here until it amounts to at least one super-droplet of unit multiplicity.