chombo-discharge
Loading...
Searching...
No Matches
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Physics::ItoKMC::ItoKMCPhysics Class Referenceabstract

Base class for interaction between Kinetic Monte Carlo and Ito-based plasma solvers. More...

#include <CD_ItoKMCPhysics.H>

Inheritance diagram for Physics::ItoKMC::ItoKMCPhysics:
Inheritance graph
[legend]
Collaboration diagram for Physics::ItoKMC::ItoKMCPhysics:
Collaboration graph
[legend]

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.
 
virtual Vector< std::stringgetPlotVariableNames () const noexcept
 Get number of plot variables.
 
virtual Vector< RealgetPlotVariables (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 plot variables.
 
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/false if physics model needs species gradients.
 
const std::map< int, std::pair< SpeciesType, int > > & getSpeciesMap () const noexcept
 Get the internal mapping between plasma species and Ito solvers.
 
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 Vector< RealcomputeMobilities (const Real a_time, const RealVect a_pos, const RealVect a_E) const noexcept=0
 Compute the Ito solver mobilities.
 
virtual Vector< RealcomputeDiffusionCoefficients (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< List< ItoParticle > > &a_secondaryParticles, Vector< Real > &a_cdrFluxes, Vector< List< Photon > > &a_secondaryPhotons, const Vector< List< ItoParticle > > &a_primaryParticles, const Vector< Real > &a_cdrFluxesExtrap, const Vector< List< 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< List< 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< List< 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< List< ItoParticle > * > &a_itoParticles, Vector< List< PointParticle > * > &a_cdrParticles, const Vector< List< Photon > * > &a_absorbedPhotons) const noexcept
 Reconcile photoionization reactions.
 

Protected Types

enum class  Algorithm {
  SSA , ExplicitEuler , Midpoint , PRC ,
  ImplicitEuler , HybridExplicitEuler , HybridMidpoint , HybridPRC ,
  HybridImplicitEuler
}
 Enum for switching between KMC algorithms. More...
 
enum class  ParticlePlacement { Random , Centroid , Downstream }
 Enum for switching between various particle placement algorithms.
 

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< KMCReactionm_kmcReactions
 List of reactions for the KMC solver.
 
std::vector< ItoKMCPhotoReactionm_photoReactions
 List of photoionization reactions.
 
std::vector< Realm_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< DiffusionFunctionm_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
 KMC reactions used in advanceReactionNetowkr.
 

Detailed Description

Base class for interaction between Kinetic Monte Carlo and Ito-based plasma solvers.

When using this class, the user should populate m_kmcReactions with the appropriate reactions AND implement routines for computing the mobility/diffusion coefficeints.

Member Enumeration Documentation

◆ Algorithm

Enum for switching between KMC algorithms.

'SSA' is the Gillespie algorithm, 'Tau' is tau-leaping and 'Hybrid' is the Cao et. al. algorithm.

Member Function Documentation

◆ advanceKMC()

void ItoKMCPhysics::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
inline

Advance the reaction network using the KMC algorithm.

Parameters
[in,out]a_numParticlesNumber of physical particles
[out]a_numNewPhotonsNumber of new physical photons to generate (of each type)
[out]a_physicsDtReasonable KMC time step computed at end of integration with eps = 1
[in]a_phiPlasma species densities.
[in]a_gradPhiPlasma species density gradients.
[in]a_dtTime step
[in]a_EElectric field
[in]a_posPhysical position
[in]a_dxGrid resolution
[in]a_kappaCut-cell volume fraction.

◆ computeAlpha()

virtual Real Physics::ItoKMC::ItoKMCPhysics::computeAlpha ( const Real  a_E,
const RealVect  a_x 
) const
pure virtual

Compute Townsend ionization coefficient.

Parameters
[in]a_EElectric field magnitude
[in]a_xPhysical coordinate
Returns
Should return the Townsend ionization coefficient.

Implemented in Physics::ItoKMC::ItoKMCJSON.

◆ computeDiffusionCoefficients()

virtual Vector< Real > Physics::ItoKMC::ItoKMCPhysics::computeDiffusionCoefficients ( const Real  a_time,
const RealVect  a_pos,
const RealVect  a_E 
) const
pure virtualnoexcept

Compute the Ito solver diffusion coefficients.

Parameters
[in]a_timeTime
[in]a_posPosition
[in]a_EElectric field
Returns
Must return a vector of non-negative diffusion coefficients for the plasma species

Implemented in Physics::ItoKMC::ItoKMCJSON.

◆ computeEta()

virtual Real Physics::ItoKMC::ItoKMCPhysics::computeEta ( const Real  a_E,
const RealVect  a_x 
) const
pure virtual

Compute Townsend attachment coefficient.

Parameters
[in]a_EElectric field magnitude
[in]a_xPhysical coordinate
Returns
Should return the Townsend attachment coefficient.

Implemented in Physics::ItoKMC::ItoKMCJSON.

◆ computeMobilities()

virtual Vector< Real > Physics::ItoKMC::ItoKMCPhysics::computeMobilities ( const Real  a_time,
const RealVect  a_pos,
const RealVect  a_E 
) const
pure virtualnoexcept

Compute the Ito solver mobilities.

Parameters
[in]a_timeTime
[in]a_posPosition
[in]a_EElectric field
Returns
Must return a vector of non-negative mobility coefficients for the plasma species

Implemented in Physics::ItoKMC::ItoKMCJSON.

◆ computeUpstreamPosition()

bool ItoKMCPhysics::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
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.

Parameters
[out]a_posUpstream position.
[out]a_loMinimum coordinate of the downstream region (relative to the unit cell)
[out]a_hiMaximum coordinate of the downstream region (relative to the unit cell)
[in]a_ZParticle charge number
[in]a_particlesParticles where we look for an upstream position.
[in]a_electricFieldElectric field vector
[in]a_cellPosPhysical location of the cell center
[in]a_dxGrid resolution

◆ defineSpeciesMap()

void ItoKMCPhysics::defineSpeciesMap ( )
inlineprotectednoexcept

Build internal representation of how we distinguish the Ito and CDR solvers.

Note
This should ALWAYS be called after initializing the species since ItoKMCStepper will rely on it.

◆ forwardIsotropicDiffusion()

RealVect ItoKMCPhysics::forwardIsotropicDiffusion ( const ItoParticle a_particle,
const Real  a_dt 
) const
inlineprotectednoexcept

Quasi-isotropic diffusion function for a particle which does not permit backward diffusion.

Parameters
[in]a_particleParticle to diffuse
[in]a_dtTime step
Returns
Same as isotropic diffusion, but ensures that the particle cannot diffuse backward

◆ getCdrSpecies()

const Vector< RefCountedPtr< CdrSpecies > > & ItoKMCPhysics::getCdrSpecies ( ) const
inline

Get all fluid drift-diffusion species.

Returns
m_cdrSpecies

◆ getItoSpecies()

const Vector< RefCountedPtr< ItoSpecies > > & ItoKMCPhysics::getItoSpecies ( ) const
inline

Get all particle drift-diffusion species.

Returns
m_itoSpecies

◆ getNeutralDensity()

virtual Real Physics::ItoKMC::ItoKMCPhysics::getNeutralDensity ( const RealVect  a_pos) const
pure virtualnoexcept

Get the neutral density at a position in space.

Parameters
[in]a_posPhysical position
Returns
Neutral density

Implemented in Physics::ItoKMC::ItoKMCJSON.

◆ getNumberOfPlotVariables()

int ItoKMCPhysics::getNumberOfPlotVariables ( ) const
virtualnoexcept

Get number of plot variables.

Reimplemented in Physics::ItoKMC::ItoKMCJSON.

◆ getPlotVariableNames()

Vector< std::string > ItoKMCPhysics::getPlotVariableNames ( ) const
virtualnoexcept

Get number of plot variables.

Reimplemented in Physics::ItoKMC::ItoKMCJSON.

◆ getPlotVariables()

Vector< Real > ItoKMCPhysics::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
virtualnoexcept

Get plot variables.

Parameters
[in]a_EElectric field
[in]a_posPhysical position
[in]a_phiPlasma species densities
[in]a_gradPhiDensity gradients for plasma species.
[in]a_dxGrid resolution
[in]a_kappaCut-cell volume fraction

Reimplemented in Physics::ItoKMC::ItoKMCJSON.

◆ getRtSpecies()

const Vector< RefCountedPtr< RtSpecies > > & ItoKMCPhysics::getRtSpecies ( ) const
inline

Get all photon species.

Returns
m_rtSpecies

◆ initialSigma()

Real ItoKMCPhysics::initialSigma ( const Real  a_time,
const RealVect  a_pos 
) const
inlinevirtual

Set initial surface charge. Default is 0, override if you want.

Parameters
[in]a_timeSimulation time
[in]a_posPhysical coordinate

◆ isotropicDiffusion()

RealVect ItoKMCPhysics::isotropicDiffusion ( const ItoParticle a_particle,
const Real  a_dt 
) const
inlineprotectednoexcept

Isotropic diffusion function for a particle.

Parameters
[in]a_particleParticle to diffuse
[in]a_dtTime step
Returns
Returns sqrt(2 * D * a_dt) * N(0,1), where N(0,1) is a normal distribution

◆ needGradients()

bool ItoKMCPhysics::needGradients ( ) const
virtualnoexcept

Return true/false if physics model needs species gradients.

Reimplemented in Physics::ItoKMC::ItoKMCJSON.

◆ noDiffusion()

RealVect ItoKMCPhysics::noDiffusion ( const ItoParticle a_particle,
const Real  a_dt 
) const
inlineprotectednoexcept

No diffusion function for a particle.

Parameters
[in]a_particleParticle to diffuse
[in]a_dtTime step
Returns
Returns the zero vector.

◆ parseRuntimeOptions()

void ItoKMCPhysics::parseRuntimeOptions ( )
inlinevirtualnoexcept

Parse run-time options.

Reimplemented in Physics::ItoKMC::ItoKMCJSON.

◆ reconcileParticles()

void ItoKMCPhysics::reconcileParticles ( Vector< List< 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
inlinenoexcept

Reconcile the number of particles.

This will add/remove particles and potentially also adjust the particle weights.

Parameters
[in,out]a_particlesComputational particles
[in]a_newNumParticlesNew number of particles (i.e., after the KMC advance)
[in]a_oldNumParticlesPrevious number of particles (i.e., before the KMC advance)
[in]a_electricFieldElectric field in cell
[in]a_cellPosCell center position
[in]a_centroidPosCell centroid position
[in]a_loCornerLow corner of minimum box enclosing the cut-cell
[in]a_hiCornerHigh corner of minimum box enclosing the cut-cell
[in]a_bndryCentroidCut-cell boundary centroid
[in]a_bndryNormalCut-cell normal (pointing into the domain)
[in]a_dxGrid resolution
[in]a_kappaCut-cell volume fraction.
Note
Public because this is called by ItoKMCStepper

◆ reconcilePhotoionization()

void ItoKMCPhysics::reconcilePhotoionization ( Vector< List< ItoParticle > * > &  a_itoParticles,
Vector< List< PointParticle > * > &  a_cdrParticles,
const Vector< List< Photon > * > &  a_absorbedPhotons 
) const
inlinenoexcept

Reconcile photoionization reactions.

Parameters
[in,out]a_itoPrticlesParticle products placed in Ito solvers.
[in,out]a_cdrParticlesParticle products placed in CDR solvers.
[in]a_absorbedPhotonsPhotons absorbed on the mesh.

This runs through the photo-reactions and associates photo-ionization products.

◆ reconcilePhotons()

void ItoKMCPhysics::reconcilePhotons ( Vector< List< 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
inlinenoexcept

Generate new photons.

This will add photons

Parameters
[in]a_newPhotonsNew photons
[in]a_numNewPhotonsNumber of physical photons to be generated.
[in]a_cellPosCell center position
[in]a_centroidPosCell centroid position
[in]a_loCornerLow corner of minimum box enclosing the cut-cell
[in]a_hiCornerHigh corner of minimum box enclosing the cut-cell
[in]a_bndryCentroidCut-cell boundary centroid
[in]a_bndryNormalCut-cell normal (pointing into the domain)
[in]a_dxGrid resolution
[in]a_kappaCut-cell volume fraction.
Note
Public because this is called by ItoKMCStepper

◆ removeParticles()

void ItoKMCPhysics::removeParticles ( List< ItoParticle > &  a_particles,
const long long  a_numToRemove 
) const
inlineprotected

Remove particles from the input list.

This will remove weight from the input particles if we can. Otherwise we remove full particles.

Parameters
[in,out]a_particlesList of (super-)particles to remove from.
[in]a_numToRemoveNumber of physical particles to remove from the input list

◆ secondaryEmissionEB()

virtual void Physics::ItoKMC::ItoKMCPhysics::secondaryEmissionEB ( Vector< List< ItoParticle > > &  a_secondaryParticles,
Vector< Real > &  a_cdrFluxes,
Vector< List< Photon > > &  a_secondaryPhotons,
const Vector< List< ItoParticle > > &  a_primaryParticles,
const Vector< Real > &  a_cdrFluxesExtrap,
const Vector< List< 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
pure virtualnoexcept

Resolve secondary emission at the EB.

Routine is here to handle charge injection, secondary emission etc.

Parameters
[out]a_secondaryParticlesOutgoing plasma species particles.
[out]a_cdrFluxesCDR fluxes for CDR species.
[out]a_secondaryPhotonsPhotons injected through the EB.
[in]a_primaryParticlesParticles that left the computational domain through the EB.
[in]a_cdrFluxesExtrapExtrapolated CDR fluxes.
[in]a_primaryPhotonsPhotons that left the computational domain through the EB.
[in]a_newNumParticlesTotal number of particles in the cut-cell AFTER the transport step.
[in]a_oldNumParticlesTotal number of particles in the cut-cell BEFORE the transport step.
[in]a_electricFieldElectric field.
[in]a_physicalCellCenterPhysical position of the cell center.
[in]a_cellCentroidCell centroid relative to the cell center (not multiplied by dx).
[in]a_bndryCentroidEB face centroid relative to the cell center (not multiplied by dx).
[in]a_bndryNormalCut-cell normal vector.
[in]a_bndryAreaCut-cell boundary area - not multiplied by dx (2D) or dx^2 (3D).
[in]a_dxGrid resolution on this level.
[in]a_dtTime step.
[in]a_isDielectricDielectric or electrode.
[in]a_matIndexMaterial index (taken from computationalGeometry).

Implemented in Physics::ItoKMC::ItoKMCJSON.

◆ updateReactionRates()

virtual void Physics::ItoKMC::ItoKMCPhysics::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
protectedpure virtualnoexcept

Update reaction rates.

Parameters
[out]a_kmcReactionsReaction rates to be set.
[in]a_EElectric field
[in]a_posPhysical position
[in]a_phiPlasma species densities
[in]a_gradPhiDensity gradients for plasma species.
[in]a_dtTime step
[in]a_dxGrid resolution
[in]a_kappaCut-cell volume fraction
Note
Must be implemented by the user.

Implemented in Physics::ItoKMC::ItoKMCJSON.

Member Data Documentation

◆ m_downstreamSpecies

int Physics::ItoKMC::ItoKMCPhysics::m_downstreamSpecies
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.

◆ m_eps

Real Physics::ItoKMC::ItoKMCPhysics::m_eps
protected

Solver setting for the Cao et. al. algorithm.

Equal to the maximum permitted change in the relative propensity for non-critical reactions

◆ m_kmcReactionsThreadLocal

thread_local std::vector< std::shared_ptr< const KMCReaction > > ItoKMCPhysics::m_kmcReactionsThreadLocal
staticprotected

KMC reactions used in advanceReactionNetowkr.

Note
This is set up via setupKMC in order toi ensure OpenMP thread safety when calling advanceReactionNetwork. The vector is later depopulated in killKMC().

◆ m_Ncrit

int Physics::ItoKMC::ItoKMCPhysics::m_Ncrit
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.

◆ m_NSSA

int Physics::ItoKMC::ItoKMCPhysics::m_NSSA
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.

◆ m_photoPathways

std::map<int, std::pair<std::discrete_distribution<int>, std::map<int, int> > > Physics::ItoKMC::ItoKMCPhysics::m_photoPathways
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.

◆ m_SSAlim

Real Physics::ItoKMC::ItoKMCPhysics::m_SSAlim
protected

Solver setting for the Cao et. al. algorithm.

Equal to the maximum permitted change in the relative propensity for non-critical reactions


The documentation for this class was generated from the following files: