|
chombo-discharge
|
Abstract base class coupling Kinetic Monte Carlo chemistry to Ito/CDR plasma solvers. More...
#include <CD_ItoKMCPhysics.H>


Public Member Functions | |
| ItoKMCPhysics () noexcept | |
| Constructor. Does nothing. | |
| virtual | ~ItoKMCPhysics () noexcept |
| Destructor. Does nothing. | |
| void | defineKMC () const noexcept |
| Define the KMC solver and state. | |
| void | killKMC () const noexcept |
| Kill the KMC solver. | |
| virtual Real | getNeutralDensity (const RealVect &a_pos) const noexcept=0 |
| Get the neutral density at a position in space. | |
| virtual Real | computeAlpha (const Real a_E, const RealVect &a_x) const =0 |
| Compute Townsend ionization coefficient. | |
| virtual Real | computeEta (const Real a_E, const RealVect &a_x) const =0 |
| Compute Townsend attachment coefficient. | |
| const Vector< RefCountedPtr< ItoSpecies > > & | getItoSpecies () const |
| Get all particle drift-diffusion species. | |
| const Vector< RefCountedPtr< CdrSpecies > > & | getCdrSpecies () const |
| Get all fluid drift-diffusion species. | |
| const Vector< RefCountedPtr< RtSpecies > > & | getRtSpecies () const |
| Get all photon species. | |
| const Vector< DiffusionFunction > & | getItoDiffusionFunctions () const noexcept |
| Get diffusion functions for all Ito species. | |
| virtual Vector< std::string > | getPlotVariableNames () const noexcept |
| Get plot variable names. | |
| virtual Vector< Real > | getPlotVariables (const RealVect &a_E, const RealVect &a_pos, const Vector< Real > &a_phi, const Vector< RealVect > &a_gradPhi, const Real a_dx, const Real a_kappa) const noexcept |
| Get plot variables. | |
| virtual int | getNumberOfPlotVariables () const noexcept |
| Get number of extra plot variables contributed by this physics model. | |
| int | getNumItoSpecies () const |
| Return number of Ito solvers. | |
| int | getNumCdrSpecies () const |
| Return number of CDR solvers. | |
| int | getNumPlasmaSpecies () const |
| Return total number of plasma species. | |
| int | getNumPhotonSpecies () const |
| Return number of RTE solvers. | |
| virtual bool | needGradients () const noexcept |
| Return true if the physics model requires species density gradients. | |
| virtual bool | needGradient (const int a_plasmaIndex) const noexcept |
| Return true if the physics model reads the density gradient of one particular plasma species. | |
| const std::map< int, std::pair< SpeciesType, int > > & | getSpeciesMap () const noexcept |
| Get the internal mapping from plasma-species index to solver type and solver index. | |
| virtual void | parseRuntimeOptions () noexcept |
| Parse run-time options. | |
| virtual Real | initialSigma (const Real a_time, const RealVect &a_pos) const |
| Set initial surface charge. Default is 0, override if you want. | |
| virtual void | computeMobilities (Vector< Real > &a_mobilities, const Real a_time, const RealVect &a_pos, const RealVect &a_E) const noexcept=0 |
| Compute the Ito solver mobilities. | |
| virtual void | computeDiffusionCoefficients (Vector< Real > &a_diffusionCoefficients, const Real a_time, const RealVect &a_pos, const RealVect &a_E) const noexcept=0 |
| Compute the Ito solver diffusion coefficients. | |
| virtual void | secondaryEmissionEB (Vector< ParticleSoA< ItoParticle > > &a_secondaryParticles, Vector< Real > &a_cdrFluxes, Vector< ParticleSoA< Photon > > &a_secondaryPhotons, const Vector< ParticleSoA< ItoParticle > > &a_primaryParticles, const Vector< Real > &a_cdrFluxesExtrap, const Vector< ParticleSoA< Photon > > &a_primaryPhotons, const RealVect &a_E, const RealVect &a_physicalCellCenter, const RealVect &a_cellCentroid, const RealVect &a_bndryCentroid, const RealVect &a_bndryNormal, const Real a_bndryArea, const Real a_dx, const Real a_dt, const bool a_isDielectric, const int a_matIndex) const noexcept=0 |
| Resolve secondary emission at the EB. | |
| void | advanceKMC (Vector< FPR > &a_numParticles, Vector< FPR > &a_numNewPhotons, Real &a_physicsDt, const Vector< Real > &a_phi, const Vector< RealVect > &a_gradPhi, const Real a_dt, const RealVect a_E, const RealVect a_pos, const Real a_dx, const Real a_kappa) const |
| Advance the reaction network using the KMC algorithm. | |
| void | reconcileParticles (Vector< ParticleSoA< ItoParticle > * > &a_particles, const Vector< FPR > &a_newNumParticles, const Vector< FPR > &a_oldNumParticles, const RealVect a_electricField, const RealVect a_cellPos, const RealVect a_centroidPos, const RealVect a_lo, const RealVect a_hi, const RealVect a_bndryCentroid, const RealVect a_bndryNormal, const Real a_dx, const Real a_kappa) const noexcept |
| Reconcile the number of particles. | |
| void | reconcilePhotons (Vector< ParticleSoA< Photon > * > &a_newPhotons, const Vector< FPR > &a_numNewPhotons, const RealVect a_cellPos, const RealVect a_centroidPos, const RealVect a_lo, const RealVect a_hi, const RealVect a_bndryCentroid, const RealVect a_bndryNormal, const Real a_dx, const Real a_kappa) const noexcept |
| Generate new photons. | |
| void | reconcilePhotoionization (Vector< ParticleSoA< ItoParticle > * > &a_itoParticles, Vector< ParticleSoA< NoPayload > * > &a_cdrParticles, const Vector< ParticleSoA< Photon > * > &a_absorbedPhotons) const noexcept |
| Reconcile photoionization reactions. | |
| void | reconcileCdrParticles (Vector< ParticleSoA< NoPayload > * > &a_cdrParticles, const Vector< ParticleSoA< ItoParticle > * > &a_itoParticles, const Vector< long long > &a_numNewParticles, const RealVect a_electricField, const RealVect a_cellPos, const RealVect a_centroidPos, const RealVect a_lo, const RealVect a_hi, const RealVect a_bndryCentroid, const RealVect a_bndryNormal, const Real a_dx, const Real a_kappa) const noexcept |
| Turn the CDR mass created by the reaction network into particles. | |
Protected Types | |
| enum class | Algorithm { SSA , ExplicitEuler , Midpoint , PRC , ImplicitEuler , HybridExplicitEuler , HybridMidpoint , HybridPRC , HybridImplicitEuler } |
| KMC time-stepping algorithms available for advancing the reaction network. More... | |
| enum class | ParticlePlacement { Random , Centroid , Downstream , Parent } |
| Strategies for placing secondary particles created during the KMC advance. More... | |
Protected Member Functions | |
| void | define () noexcept |
| Define method – defines all the internal machinery. | |
| void | defineSpeciesMap () noexcept |
| Build internal representation of how we distinguish the Ito and CDR solvers. | |
| void | definePhotoPathways () noexcept |
| Define pathways for photo-reactions. | |
| void | parsePPC () noexcept |
| Parse the maximum number of particles generated per cell. | |
| void | parseDebug () noexcept |
| Parse the maximum number of particles generated per cell. | |
| void | parseAlgorithm () noexcept |
| Parse reaction algorithm. | |
| virtual void | updateReactionRates (std::vector< std::shared_ptr< const KMCReaction > > &a_kmcReactions, const RealVect a_E, const RealVect a_pos, const Vector< Real > &a_phi, const Vector< RealVect > &a_gradPhi, const Real a_dt, const Real a_dx, const Real a_kappa) const noexcept=0 |
| Update reaction rates. | |
| void | removeParticles (ParticleSoA< ItoParticle > &a_particles, const long long a_numToRemove) const |
| Remove particles from the input list. | |
| RealVect | drawNewParticlePosition (const bool a_hasParent, const bool a_hasDownstream, const RealVect a_parentPos, const RealVect a_upstreamPos, const RealVect a_upstreamLo, const RealVect a_upstreamHi, const RealVect a_downstreamDirection, const RealVect a_cellPos, const RealVect a_centroidPos, const RealVect a_lo, const RealVect a_hi, const RealVect a_bndryCentroid, const RealVect a_bndryNormal, const Real a_dx, const Real a_kappa) const noexcept |
| Draw a position for a particle created by the reaction network in a grid cell. | |
| bool | sampleParentPosition (RealVect &a_pos, const ParticleSoA< ItoParticle > &a_particles, const std::vector< Real > &a_cumulativeWeights) const noexcept |
| Draw the position of a parent particle, with probability proportional to particle weight. | |
| void | buildParentWeights (std::vector< Real > &a_cumulativeWeights, const ParticleSoA< ItoParticle > &a_particles, const std::size_t a_numEligible) const noexcept |
| Build the running weight sum that sampleParentPosition() draws from. | |
| bool | computeUpstreamPosition (RealVect &a_pos, RealVect &a_lo, RealVect &a_hi, const int &a_Z, const ParticleSoA< ItoParticle > &a_particles, const RealVect &a_electricField, const RealVect &a_cellPos, const Real &a_dx) const noexcept |
| Compute the upstream position in a grid cell. Returns false if an upstream position was undefinable. | |
| RealVect | noDiffusion (const ItoParticle &a_particle, const Real a_dt) const noexcept |
| No diffusion function for a particle. | |
| RealVect | isotropicDiffusion (const ItoParticle &a_particle, const Real a_dt) const noexcept |
| Isotropic diffusion function for a particle. | |
| RealVect | forwardIsotropicDiffusion (const ItoParticle &a_particle, const Real a_dt) const noexcept |
| Quasi-isotropic diffusion function for a particle which does not permit backward diffusion. | |
Protected Attributes | |
| Algorithm | m_algorithm |
| Algorithm to use for KMC advance. | |
| ParticlePlacement | m_particlePlacement |
| Particle placement algorithm. | |
| std::map< int, std::pair< SpeciesType, int > > | m_speciesMap |
| Map for associating a plasma species with an Ito solver or CDR solver. | |
| std::string | m_className |
| Class name. Used for options parsing. | |
| bool | m_debug |
| Turn on/off debugging. | |
| bool | m_isDefined |
| Is defined or not. | |
| std::vector< KMCReaction > | m_kmcReactions |
| List of reactions for the KMC solver. | |
| std::vector< ItoKMCPhotoReaction > | m_photoReactions |
| List of photoionization reactions. | |
| std::vector< Real > | m_reactiveDtFactors |
| List of reactions that are a part of the time step limitation. | |
| std::map< int, std::pair< std::discrete_distribution< int >, std::map< int, int > > > | m_photoPathways |
| Random number generators for photoionization pathways. | |
| ItoKMCSurfaceReactionSet | m_surfaceReactions |
| Surface reactions. | |
| Vector< DiffusionFunction > | m_itoDiffusionFunctions |
| Diffusion functions for the various Ito species. | |
| Vector< RefCountedPtr< ItoSpecies > > | m_itoSpecies |
| List of solver-tracked particle drift-diffusion species. | |
| Vector< RefCountedPtr< CdrSpecies > > | m_cdrSpecies |
| List of solver-tracked fluid drift-diffusion species. | |
| Vector< RefCountedPtr< RtSpecies > > | m_rtSpecies |
| List of solver-tracked photon species. | |
| int | m_downstreamSpecies |
| An internal integer describing which species is the "ionizing" species. | |
| int | m_maxNewParticles |
| Maximum new number of particles generated by the chemistry advance. | |
| int | m_maxNewPhotons |
| Maximum new number of photons generated by the chemistry advance. | |
| int | m_Ncrit |
| Solver setting for the Cao et. al algorithm. | |
| int | m_NSSA |
| Solver setting for the Cao et. al algorithm. | |
| int | m_maxIter |
| Maximum number of iterations for implicit KMC-leaping algorithms. | |
| Real | m_SSAlim |
| Solver setting for the Cao et. al. algorithm. | |
| Real | m_eps |
| Solver setting for the Cao et. al. algorithm. | |
| Real | m_exitTol |
| Exit tolerance for implicit KMC-leaping algorithms. | |
Static Protected Attributes | |
| static thread_local bool | m_hasKMCSolver |
| Is the KMC solver defined or not. | |
| static thread_local KMCSolverType | m_kmcSolver |
| Kinetic Monte Carlo solver used in advanceReactionNetwork. | |
| static thread_local KMCState | m_kmcState |
| KMC state used in advanceReactionNetwork. | |
| static thread_local KMCState | m_kmcStateScratch |
| Perturbed KMC state used by the time step tail of advanceKMC. | |
| static thread_local std::vector< Real > | m_kmcPropensityScratch |
| Propensity buffer used by the time step tail of advanceKMC. | |
| static thread_local std::vector< long long > | m_weightScratch |
| Reusable buffer for ParticleManagement::partitionParticleWeights. | |
| static thread_local std::vector< Real > | m_parentWeightScratch |
| Running sum of the eligible parent weights in a grid cell, used by ParticlePlacement::Parent. | |
| static thread_local std::vector< std::shared_ptr< const KMCReaction > > | m_kmcReactionsThreadLocal |
| Thread-local copies of KMC reactions used in advanceReactionNetwork. | |
| static thread_local std::vector< std::shared_ptr< const KMCReaction > > | m_kmcReactionsDt |
| The subset of m_kmcReactionsThreadLocal that takes part in the physics time step calculation. | |
| static thread_local std::vector< Real > | m_reactiveDtFactorsDt |
| Time-step scaling factors for m_kmcReactionsDt, parallel to it. | |
| static thread_local std::vector< Real > | m_kmcPropensityScratchDt |
| Propensity buffer for m_kmcReactionsDt, parallel to it. | |
Abstract base class coupling Kinetic Monte Carlo chemistry to Ito/CDR plasma solvers.
Subclasses must implement updateReactionRates(), computeMobilities(), computeDiffusionCoefficients(), secondaryEmissionEB(), computeAlpha(), computeEta(), and getNeutralDensity(). The reaction network is specified by populating m_kmcReactions and (optionally) m_photoReactions and m_surfaceReactions in the subclass constructor.
|
strongprotected |
KMC time-stepping algorithms available for advancing the reaction network.
|
strongprotected |
Strategies for placing secondary particles created during the KMC advance.
|
inline |
Advance the reaction network using the KMC algorithm.
| [in,out] | a_numParticles | Number of physical particles |
| [out] | a_numNewPhotons | Number of new physical photons to generate (of each type) |
| [out] | a_physicsDt | Reasonable KMC time step computed at end of integration with eps = 1 |
| [in] | a_phi | Plasma species densities. |
| [in] | a_gradPhi | Plasma species density gradients. |
| [in] | a_dt | Time step |
| [in] | a_E | Electric field |
| [in] | a_pos | Physical position |
| [in] | a_dx | Grid resolution |
| [in] | a_kappa | Cut-cell volume fraction. |
|
inlineprotectednoexcept |
Build the running weight sum that sampleParentPosition() draws from.
Only the leading a_numEligible entries are eligible parents: the reconciliation appends to the same container, and a freshly created particle must not become a parent for its siblings.
| [out] | a_cumulativeWeights | Receives one running sum per eligible particle; cleared first. |
| [in] | a_particles | Candidate parents. |
| [in] | a_numEligible | Number of leading entries of a_particles that may be drawn. |
|
pure virtual |
Compute Townsend ionization coefficient.
| [in] | a_E | Electric field magnitude |
| [in] | a_x | Physical coordinate |
Implemented in Physics::ItoKMC::ItoKMCJSON.
|
pure virtualnoexcept |
Compute the Ito solver diffusion coefficients.
Fills a caller-owned buffer; see computeMobilities() for why.
| [out] | a_diffusionCoefficients | Non-negative diffusion coefficient per plasma species. Resized by the callee. |
| [in] | a_time | Time |
| [in] | a_pos | Position |
| [in] | a_E | Electric field |
Implemented in Physics::ItoKMC::ItoKMCJSON.
|
pure virtual |
Compute Townsend attachment coefficient.
| [in] | a_E | Electric field magnitude |
| [in] | a_x | Physical coordinate |
Implemented in Physics::ItoKMC::ItoKMCJSON.
|
pure virtualnoexcept |
Compute the Ito solver mobilities.
Fills a caller-owned buffer rather than returning one. This is called once per grid cell, so a returned Vector<Real> was a heap allocation and a free per cell – pure overhead, and (with Chombo memory tracking compiled in) a pair of counter updates on top. The caller hoists one buffer per patch instead.
Implementations must size a_mobilities to the number of plasma species and fill every entry; a species that is not mobile should be given zero rather than skipped, so the indexing stays dense.
| [out] | a_mobilities | Non-negative mobility coefficient per plasma species. Resized by the callee. |
| [in] | a_time | Time |
| [in] | a_pos | Position |
| [in] | a_E | Electric field |
Implemented in Physics::ItoKMC::ItoKMCJSON.
|
inlineprotectednoexcept |
Compute the upstream position in a grid cell. Returns false if an upstream position was undefinable.
This routine will compute the position of the "most upstream" particle in the input list. For all particles we assume that they advect in the direction of Z*E, where Z is the charge number. This routine also computes the minimum bounding box (in unit coordinates) that encloses the downstreamn region within the grid cell.
| [out] | a_pos | Upstream position. |
| [out] | a_lo | Minimum coordinate of the downstream region (relative to the unit cell) |
| [out] | a_hi | Maximum coordinate of the downstream region (relative to the unit cell) |
| [in] | a_Z | Particle charge number |
| [in] | a_particles | Particles where we look for an upstream position. |
| [in] | a_electricField | Electric field vector |
| [in] | a_cellPos | Physical location of the cell center |
| [in] | a_dx | Grid resolution |
|
inlineprotectednoexcept |
Build internal representation of how we distinguish the Ito and CDR solvers.
|
inlineprotectednoexcept |
Draw a position for a particle created by the reaction network in a grid cell.
The single implementation of ParticlePlacement, shared by the Ito and CDR products. The caller supplies the sampled parent (Parent) and the downstream region (Downstream); either may be flagged absent, in which case that mode falls back to a uniformly random position within the cell.
| [in] | a_hasParent | True if a_parentPos holds a usable parent position. |
| [in] | a_hasDownstream | True if the downstream region below is defined. |
| [in] | a_parentPos | Position of the sampled parent particle. Only read for ParticlePlacement::Parent. |
| [in] | a_upstreamPos | Upstream position within the cell, in unit coordinates. |
| [in] | a_upstreamLo | Lower corner of the downstream region, in unit coordinates. |
| [in] | a_upstreamHi | Upper corner of the downstream region, in unit coordinates. |
| [in] | a_downstreamDirection | Normalized drift direction of the downstream species. |
| [in] | a_cellPos | Cell center position |
| [in] | a_centroidPos | Cell centroid position |
| [in] | a_lo | Lower corner of the valid region of the cell, in unit coordinates |
| [in] | a_hi | Upper corner of the valid region of the cell, in unit coordinates |
| [in] | a_bndryCentroid | Cut-cell boundary centroid |
| [in] | a_bndryNormal | Cut-cell normal (pointing into the domain) |
| [in] | a_dx | Grid resolution |
| [in] | a_kappa | Cut-cell volume fraction |
|
inlineprotectednoexcept |
Quasi-isotropic diffusion function for a particle which does not permit backward diffusion.
| [in] | a_particle | Particle to diffuse |
| [in] | a_dt | Time step |
|
inline |
Get all fluid drift-diffusion species.
|
inlinenoexcept |
Get diffusion functions for all Ito species.
|
inline |
Get all particle drift-diffusion species.
|
pure virtualnoexcept |
Get the neutral density at a position in space.
| [in] | a_pos | Physical position |
Implemented in Physics::ItoKMC::ItoKMCJSON.
|
virtualnoexcept |
Get number of extra plot variables contributed by this physics model.
Reimplemented in Physics::ItoKMC::ItoKMCJSON.
|
inline |
Return number of CDR solvers.
|
inline |
Return number of Ito solvers.
|
inline |
Return number of RTE solvers.
|
inline |
Return total number of plasma species.
|
virtualnoexcept |
Get plot variable names.
Reimplemented in Physics::ItoKMC::ItoKMCJSON.
|
virtualnoexcept |
Get plot variables.
| [in] | a_E | Electric field |
| [in] | a_pos | Physical position |
| [in] | a_phi | Plasma species densities |
| [in] | a_gradPhi | Density gradients for plasma species. |
| [in] | a_dx | Grid resolution |
| [in] | a_kappa | Cut-cell volume fraction |
Reimplemented in Physics::ItoKMC::ItoKMCJSON.
|
inline |
Get all photon species.
|
inlinenoexcept |
Get the internal mapping from plasma-species index to solver type and solver index.
|
inlinevirtual |
Set initial surface charge. Default is 0, override if you want.
| [in] | a_time | Simulation time |
| [in] | a_pos | Physical coordinate |
|
inlineprotectednoexcept |
Isotropic diffusion function for a particle.
This is the stochastic hop alone; it carries no drift. In particular it does not contain the grad(D) correction that makes the Ito update transport v*n - D*grad(n) rather than v*n - grad(D*n) – that term is deterministic and is added to the particle displacement by the time stepper.
| [in] | a_particle | Particle to diffuse |
| [in] | a_dt | Time step |
|
inlinevirtualnoexcept |
Return true if the physics model reads the density gradient of one particular plasma species.
Refinement of needGradients(), which answers the same question for the whole model at once. Computing a gradient costs a cross-realm copy, a coarsening and a ghost interpolation over the whole AMR hierarchy, per species – so a model that consults one species' gradient pays for every species' unless it can say which one it meant.
The default is the conservative answer: whatever needGradients() says, for every species. A model that knows better should override this; one that does not keeps working unchanged.
| [in] | a_plasmaIndex | Plasma species index, in the ordering used by updateReactionRates()'s density argument: the Ito species first, then the CDR species. |
Reimplemented in Physics::ItoKMC::ItoKMCJSON.
|
virtualnoexcept |
Return true if the physics model requires species density gradients.
Reimplemented in Physics::ItoKMC::ItoKMCJSON.
|
inlineprotectednoexcept |
No diffusion function for a particle.
| [in] | a_particle | Particle to diffuse |
| [in] | a_dt | Time step |
|
inlinevirtualnoexcept |
Parse run-time options.
Reimplemented in Physics::ItoKMC::ItoKMCJSON.
|
inlinenoexcept |
Turn the CDR mass created by the reaction network into particles.
Emitting the production as particles lets the stepper deposit it with the Ito solvers' deposition, so both halves of a reaction reach the mesh the same way. The production is partitioned into at most m_maxNewParticles computational particles of integer weight, exactly as the Ito products are.
| [in,out] | a_cdrParticles | Particle products placed in the CDR solvers. |
| [in] | a_itoParticles | Ito particles in the cell, used by ParticlePlacement::Downstream. |
| [in] | a_numNewParticles | Number of physical particles produced per CDR species. Must be >= 0. |
| [in] | a_electricField | Electric field in cell |
| [in] | a_cellPos | Cell center position |
| [in] | a_centroidPos | Cell centroid position |
| [in] | a_lo | Lower corner of the valid region of the cell, in unit coordinates |
| [in] | a_hi | Upper corner of the valid region of the cell, in unit coordinates |
| [in] | a_bndryCentroid | Cut-cell boundary centroid |
| [in] | a_bndryNormal | Cut-cell normal (pointing into the domain) |
| [in] | a_dx | Grid resolution |
| [in] | a_kappa | Cut-cell volume fraction. |
|
inlinenoexcept |
Reconcile the number of particles.
This will add/remove particles and potentially also adjust the particle weights.
| [in,out] | a_particles | Computational particles |
| [in] | a_newNumParticles | New number of particles (i.e., after the KMC advance) |
| [in] | a_oldNumParticles | Previous number of particles (i.e., before the KMC advance) |
| [in] | a_electricField | Electric field in cell |
| [in] | a_cellPos | Cell center position |
| [in] | a_centroidPos | Cell centroid position |
| [in] | a_bndryCentroid | Cut-cell boundary centroid |
| [in] | a_bndryNormal | Cut-cell normal (pointing into the domain) |
| [in] | a_dx | Grid resolution |
| [in] | a_kappa | Cut-cell volume fraction. |
| [in] | a_lo | Lo |
| [in] | a_hi | Hi |
|
inlinenoexcept |
Reconcile photoionization reactions.
| [in,out] | a_cdrParticles | Particle products placed in CDR solvers. |
| [in] | a_absorbedPhotons | Photons absorbed on the mesh. |
This runs through the photo-reactions and associates photo-ionization products.
| [in] | a_itoParticles | Ito particles |
|
inlinenoexcept |
Generate new photons.
This will add photons
| [in] | a_newPhotons | New photons |
| [in] | a_numNewPhotons | Number of physical photons to be generated. |
| [in] | a_cellPos | Cell center position |
| [in] | a_centroidPos | Cell centroid position |
| [in] | a_bndryCentroid | Cut-cell boundary centroid |
| [in] | a_bndryNormal | Cut-cell normal (pointing into the domain) |
| [in] | a_dx | Grid resolution |
| [in] | a_kappa | Cut-cell volume fraction. |
| [in] | a_lo | Lo |
| [in] | a_hi | Hi |
|
inlineprotected |
Remove particles from the input list.
This will remove weight from the input particles if we can. Otherwise we remove full particles.
| [in,out] | a_particles | List of (super-)particles to remove from. |
| [in] | a_numToRemove | Number of physical particles to remove from the input list |
|
inlineprotectednoexcept |
Draw the position of a parent particle, with probability proportional to particle weight.
Used by ParticlePlacement::Parent. The caller passes the running weight sum, built by buildParentWeights(), so that a draw is a binary search rather than another walk over the cell's particles.
| [out] | a_pos | Position of the drawn parent. |
| [in] | a_particles | Candidate parents. |
| [in] | a_cumulativeWeights | Running weight sum of the eligible leading entries of a_particles. |
|
pure virtualnoexcept |
Resolve secondary emission at the EB.
Routine is here to handle charge injection, secondary emission etc.
| [out] | a_secondaryParticles | Outgoing plasma species particles. |
| [out] | a_cdrFluxes | CDR fluxes for CDR species. |
| [out] | a_secondaryPhotons | Photons injected through the EB. |
| [in] | a_primaryParticles | Particles that left the computational domain through the EB. |
| [in] | a_cdrFluxesExtrap | Extrapolated CDR fluxes. |
| [in] | a_primaryPhotons | Photons that left the computational domain through the EB. |
| [in] | a_physicalCellCenter | Physical position of the cell center. |
| [in] | a_cellCentroid | Cell centroid relative to the cell center (not multiplied by dx). |
| [in] | a_bndryCentroid | EB face centroid relative to the cell center (not multiplied by dx). |
| [in] | a_bndryNormal | Cut-cell normal vector. |
| [in] | a_bndryArea | Cut-cell boundary area - not multiplied by dx (2D) or dx^2 (3D). |
| [in] | a_dx | Grid resolution on this level. |
| [in] | a_dt | Time step. |
| [in] | a_isDielectric | Dielectric or electrode. |
| [in] | a_matIndex | Material index (taken from computationalGeometry). |
| [in] | a_E | E |
Implemented in Physics::ItoKMC::ItoKMCJSON.
|
protectedpure virtualnoexcept |
Update reaction rates.
| [out] | a_kmcReactions | Reaction rates to be set. |
| [in] | a_E | Electric field |
| [in] | a_pos | Physical position |
| [in] | a_phi | Plasma species densities |
| [in] | a_gradPhi | Density gradients for plasma species. |
| [in] | a_dt | Time step |
| [in] | a_dx | Grid resolution |
| [in] | a_kappa | Cut-cell volume fraction |
Implemented in Physics::ItoKMC::ItoKMCJSON.
|
protected |
An internal integer describing which species is the "ionizing" species.
This is used by the particle reconciliation routine when only placing secondary particles in the downstream region of the primary particles.
|
protected |
Solver setting for the Cao et. al. algorithm.
Equal to the maximum permitted change in the relative propensity for non-critical reactions
|
staticprotected |
Propensity buffer used by the time step tail of advanceKMC.
Reused across the tail's probes so the propensities are not returned by value, which allocated once per probe, i.e. once per reaction per grid cell.
|
staticprotected |
The subset of m_kmcReactionsThreadLocal that takes part in the physics time step calculation.
Holds the same objects as m_kmcReactionsThreadLocal, not copies, so the per-cell rate updates written through that list are seen here. Built by defineKMC() from m_reactiveDtFactors; see the comment there for why the compaction leaves the computed time step unchanged.
|
staticprotected |
Thread-local copies of KMC reactions used in advanceReactionNetwork.
Set up via defineKMC() to ensure OpenMP thread safety; depopulated by killKMC().
|
staticprotected |
Perturbed KMC state used by the time step tail of advanceKMC.
The tail probes each reaction by firing it to its critical number and re-evaluating the time step on the result. It needs a state to perturb without disturbing m_kmcState, and reuses this one so that the probe does not allocate once per reaction per grid cell.
|
protected |
Solver setting for the Cao et. al algorithm.
Determines critical reactions. A reaction is critical if it is m_Ncrit firings away from depleting a reactant.
|
protected |
Solver setting for the Cao et. al algorithm.
Maximum number of SSA steps to run when switching into SSA-based advancement for non-critical reactions.
|
staticprotected |
Running sum of the eligible parent weights in a grid cell, used by ParticlePlacement::Parent.
Built once per cell and species, so that each of the up to m_maxNewParticles draws is a binary search rather than another walk over the cell's particles. Thread-local for the same reason as m_weightScratch.
|
protected |
Random number generators for photoionization pathways.
The first index is the photon index, i.e. entry in m_photonSpecies. The second index in the map is an RNG generator for selecting photo-reactions, and a map which associates the returned reaction from the RNG generator with an index in m_photoReactions.
|
protected |
Solver setting for the Cao et. al. algorithm.
Equal to the maximum permitted change in the relative propensity for non-critical reactions
|
staticprotected |
Reusable buffer for ParticleManagement::partitionParticleWeights.
Reconciliation calls that function once per grid cell per species, from inside an OpenMP region; the vector-returning form allocates every one of those calls. Thread-local because the cell loop is threaded, and never shrunk, so the allocation is paid once per thread rather than once per cell.