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


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 } |
| 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 (List< ItoParticle > &a_particles, const long long a_numToRemove) const |
| Remove particles from the input list. | |
| bool | computeUpstreamPosition (RealVect &a_pos, RealVect &a_lo, RealVect &a_hi, const int &a_Z, const List< 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. | |
| bool | m_incrementNewParticles |
| If true, increment onto existing particles rather than creating new ones. | |
| 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 std::vector< std::shared_ptr< const KMCReaction > > | m_kmcReactionsThreadLocal |
| Thread-local copies of KMC reactions used in advanceReactionNetwork. | |
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 |
|
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. |
|
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.
| [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.
| [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 |
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.
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.
| [in] | a_particle | Particle to diffuse |
| [in] | a_dt | Time step |
|
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 |
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 |
|
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 |
Thread-local copies of KMC reactions used in advanceReactionNetwork.
Set up via defineKMC() to ensure OpenMP thread safety; depopulated by killKMC().
|
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.
|
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