12 #ifndef CD_ItoKMCPhysics_H
13 #define CD_ItoKMCPhysics_H
21 #include <RefCountedPtr.H>
36 #include <CD_NamespaceHeader.H>
109 computeDt(
const RealVect a_E,
const RealVect a_pos,
const Vector<FPR> a_numParticles)
const noexcept;
133 const Vector<RefCountedPtr<ItoSpecies>>&
140 const Vector<RefCountedPtr<CdrSpecies>>&
147 const Vector<RefCountedPtr<RtSpecies>>&
153 virtual Vector<std::string>
167 const RealVect a_pos,
168 const Vector<Real>& a_phi,
169 const Vector<RealVect>& a_gradPhi,
171 const Real a_kappa) const noexcept;
212 inline const std::map<
int, std::pair<
SpeciesType,
int>>&
227 initialSigma(const Real a_time, const RealVect a_pos) const;
237 computeMobilities(const Real a_time, const RealVect a_pos, const RealVect a_E) const noexcept = 0;
273 Vector<Real>& a_cdrFluxes,
274 Vector<List<
Photon>>& a_secondaryPhotons,
275 const Vector<List<
ItoParticle>>& a_primaryParticles,
276 const Vector<Real>& a_cdrFluxesExtrap,
277 const Vector<List<
Photon>>& a_primaryPhotons,
279 const RealVect& a_physicalCellCenter,
280 const RealVect& a_cellCentroid,
281 const RealVect& a_bndryCentroid,
282 const RealVect& a_bndryNormal,
283 const Real a_bndryArea,
286 const
bool a_isDielectric,
287 const
int a_matIndex) const noexcept = 0;
303 Vector<
FPR>& a_numNewPhotons,
304 const Vector<Real>& a_phi,
305 const Vector<RealVect>& a_gradPhi,
308 const RealVect a_pos,
310 const Real a_kappa) const;
330 const Vector<
FPR>& a_newNumParticles,
331 const Vector<
FPR>& a_oldNumParticles,
332 const RealVect a_cellPos,
333 const RealVect a_centroidPos,
336 const RealVect a_bndryCentroid,
337 const RealVect a_bndryNormal,
339 const Real a_kappa) const noexcept;
358 const Vector<
FPR>& a_numNewPhotons,
359 const RealVect a_cellPos,
360 const RealVect a_centroidPos,
363 const RealVect a_bndryCentroid,
364 const RealVect a_bndryNormal,
366 const Real a_kappa) const noexcept;
378 const Vector<List<
Photon>*>& a_absorbedPhotons) const noexcept;
471 std::map<int, std::pair<std::discrete_distribution<int>, std::map<int, int>>>
m_photoPathways;
578 const RealVect a_pos,
579 const Vector<Real>& a_phi,
580 const Vector<RealVect>& a_gradPhi,
582 const Real a_kappa) const noexcept = 0;
596 #include <CD_NamespaceFooter.H>
Declaration of a class that passes information into CdrSolver (e.g., initial conditions).
Declaration of a class for holding photoionization reaction types in ito_plasma physics.
Implementation of CD_ItoKMCPhysics.H.
Real FPR
Numerical representation of the KMC state. Can be floating-point or integer type.
Definition: CD_ItoKMCPhysics.H:44
SpeciesType
Map to species type.
Definition: CD_ItoKMCPhysics.H:66
Declaration of a class that encapsulates a set of secondary emission reactions.
Declaration of a particle class for Ito diffusion.
Declaration of an ItoSpecies class that passes in names and initial data to ItoSolvers.
Declaration of a simple plasma reaction type for Kinetic Monte Carlo.
Declaration of a simple state vector for running Kinetic Monte Carlo for plasma problems.
Class for running Kinetic Monte Carlo functionality.
Declaration of a photon class for particle methods.
Declaration of a computational point particle.
Declaration of a class which supplies a user interface to radiative transfer code.
A particle class for use with ItoSolvers, i.e. drifting Brownian walkers.
Definition: CD_ItoParticle.H:40
Reaction type for advancing a KMCDualState for Kinetic Monte Carlo.
Definition: CD_KMCDualStateReaction.H:33
Declaration of a "dual state" for advancing with the Kinetic Monte Carlo module.
Definition: CD_KMCDualState.H:29
Class for running Kinetic Monte-Carlo simulations.
Definition: CD_KMCSolver.H:49
Particle class for usage with Monte Carlo radiative transfer.
Definition: CD_Photon.H:29
Base class for interaction between Kinetic Monte Carlo and Ito-based plasma solvers.
Definition: CD_ItoKMCPhysics.H:77
int m_maxNewParticles
Maximum new number of particles generated by the chemistry advance.
Definition: CD_ItoKMCPhysics.H:496
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.
Definition: CD_ItoKMCPhysicsImplem.H:552
int m_NSSA
Solver setting for the Cao et. al algorithm.
Definition: CD_ItoKMCPhysics.H:513
Vector< RefCountedPtr< RtSpecies > > m_rtSpecies
List of solver-tracked photon species.
Definition: CD_ItoKMCPhysics.H:491
virtual Vector< Real > computeDiffusionCoefficients(const Real a_time, const RealVect a_pos, const RealVect a_E) const noexcept=0
Compute the Ito solver diffusion coefficients.
virtual Real computeDt(const RealVect a_E, const RealVect a_pos, const Vector< FPR > a_numParticles) const noexcept
Compute a time step to use.
Definition: CD_ItoKMCPhysicsImplem.H:209
Real m_eps
Solver setting for the Cao et. al. algorithm.
Definition: CD_ItoKMCPhysics.H:525
bool m_debug
Turn on/off debugging.
Definition: CD_ItoKMCPhysics.H:426
void reconcilePhotoionization(Vector< List< ItoParticle > * > &a_itoParticles, Vector< List< PointParticle > * > &a_cdrParticles, const Vector< List< Photon > * > &a_absorbedPhotons) const noexcept
Reconcile photoionization reactions.
Definition: CD_ItoKMCPhysicsImplem.H:585
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.
Definition: CD_ItoKMCPhysics.cpp:35
int m_maxNewPhotons
Maximum new number of photons generated by the chemistry advance.
Definition: CD_ItoKMCPhysics.H:501
void defineKMC() const noexcept
Define the KMC solver and state.
Definition: CD_ItoKMCPhysicsImplem.H:114
virtual Vector< Real > computeMobilities(const Real a_time, const RealVect a_pos, const RealVect a_E) const noexcept=0
Compute the Ito solver mobilities.
std::string m_className
Class name. Used for options parsing.
Definition: CD_ItoKMCPhysics.H:421
std::vector< ItoKMCPhotoReaction > m_photoReactions
List of photoionization reactions.
Definition: CD_ItoKMCPhysics.H:463
const Vector< RefCountedPtr< RtSpecies > > & getRtSpecies() const
Get all photon species.
Definition: CD_ItoKMCPhysicsImplem.H:297
Vector< RefCountedPtr< ItoSpecies > > m_itoSpecies
List of solver-tracked particle drift-diffusion species.
Definition: CD_ItoKMCPhysics.H:481
Vector< RefCountedPtr< CdrSpecies > > m_cdrSpecies
List of solver-tracked fluid drift-diffusion species.
Definition: CD_ItoKMCPhysics.H:486
virtual ~ItoKMCPhysics() noexcept
Destructor. Does nothing.
Definition: CD_ItoKMCPhysicsImplem.H:60
virtual Real computeAlpha(const Real a_E, const RealVect a_x) const =0
Compute Townsend ionization coefficient.
static thread_local KMCSolverType m_kmcSolver
Kinetic Monte Carlo solver used in advanceReactionNetwork.
Definition: CD_ItoKMCPhysics.H:441
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 defineSpeciesMap() noexcept
Build internal representation of how we distinguish the Ito and CDR solvers.
Definition: CD_ItoKMCPhysicsImplem.H:96
const Vector< RefCountedPtr< ItoSpecies > > & getItoSpecies() const
Get all particle drift-diffusion species.
Definition: CD_ItoKMCPhysicsImplem.H:285
Real m_SSAlim
Solver setting for the Cao et. al. algorithm.
Definition: CD_ItoKMCPhysics.H:519
void parseAlgorithm() noexcept
Parse reaction algorithm.
Definition: CD_ItoKMCPhysicsImplem.H:250
int m_Ncrit
Solver setting for the Cao et. al algorithm.
Definition: CD_ItoKMCPhysics.H:507
const std::map< int, std::pair< SpeciesType, int > > & getSpeciesMap() const noexcept
Get the internal mapping between plasma species and Ito solvers.
Definition: CD_ItoKMCPhysicsImplem.H:201
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_dx, const Real a_kappa) const noexcept=0
Update reaction rates.
void advanceKMC(Vector< FPR > &a_numParticles, Vector< FPR > &a_numNewPhotons, 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 particles.
Definition: CD_ItoKMCPhysicsImplem.H:333
void reconcileParticles(Vector< List< ItoParticle > * > &a_particles, const Vector< FPR > &a_newNumParticles, const Vector< FPR > &a_oldNumParticles, 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.
Definition: CD_ItoKMCPhysicsImplem.H:406
std::map< int, std::pair< std::discrete_distribution< int >, std::map< int, int > > > m_photoPathways
Random number generators for photoionization pathways.
Definition: CD_ItoKMCPhysics.H:471
Algorithm
Enum for switching between KMC algorithms.
Definition: CD_ItoKMCPhysics.H:386
Algorithm m_algorithm
Algorithm to use for KMC advance.
Definition: CD_ItoKMCPhysics.H:406
virtual void parseRuntimeOptions() noexcept
Parse run-time options.
Definition: CD_ItoKMCPhysicsImplem.H:219
ParticlePlacement
Enum for switching between various particle placement algorithms.
Definition: CD_ItoKMCPhysics.H:398
void removeParticles(List< ItoParticle > &a_particles, const long long a_numToRemove) const
Remove particles from the input list.
Definition: CD_ItoKMCPhysicsImplem.H:487
const Vector< RefCountedPtr< CdrSpecies > > & getCdrSpecies() const
Get all fluid drift-diffusion species.
Definition: CD_ItoKMCPhysicsImplem.H:291
static thread_local std::vector< std::shared_ptr< const KMCReaction > > m_kmcReactionsThreadLocal
KMC reactions used in advanceReactionNetowkr.
Definition: CD_ItoKMCPhysics.H:453
std::vector< KMCReaction > m_kmcReactions
List of reactions for the KMC solver.
Definition: CD_ItoKMCPhysics.H:458
int getNumPhotonSpecies() const
Return number of RTE solvers.
Definition: CD_ItoKMCPhysicsImplem.H:321
virtual Vector< std::string > getPlotVariableNames() const noexcept
Get number of plot variables.
Definition: CD_ItoKMCPhysics.cpp:27
ItoKMCSurfaceReactionSet m_surfaceReactions
Surface reactions.
Definition: CD_ItoKMCPhysics.H:476
int getNumPlasmaSpecies() const
Return total number of plasma species.
Definition: CD_ItoKMCPhysicsImplem.H:315
int getNumItoSpecies() const
Return number of Ito solvers.
Definition: CD_ItoKMCPhysicsImplem.H:303
virtual Real initialSigma(const Real a_time, const RealVect a_pos) const
Set initial surface charge. Default is 0, override if you want.
Definition: CD_ItoKMCPhysicsImplem.H:327
virtual int getNumberOfPlotVariables() const noexcept
Get number of plot variables.
Definition: CD_ItoKMCPhysics.cpp:48
void define() noexcept
Define method – defines all the internal machinery.
Definition: CD_ItoKMCPhysicsImplem.H:66
std::map< int, std::pair< SpeciesType, int > > m_speciesMap
Map for associating a plasma species with an Ito solver or CDR solver.
Definition: CD_ItoKMCPhysics.H:416
void killKMC() const noexcept
Kill the KMC solver.
Definition: CD_ItoKMCPhysicsImplem.H:134
void definePhotoPathways() noexcept
Define pathways for photo-reactions.
Definition: CD_ItoKMCPhysicsImplem.H:148
void parsePPC() noexcept
Parse the maximum number of particles generated per cell.
Definition: CD_ItoKMCPhysicsImplem.H:229
static thread_local bool m_hasKMCSolver
Is the KMC solver defined or not.
Definition: CD_ItoKMCPhysics.H:436
int getNumCdrSpecies() const
Return number of CDR solvers.
Definition: CD_ItoKMCPhysicsImplem.H:309
ParticlePlacement m_particlePlacement
Particle placement algorithm.
Definition: CD_ItoKMCPhysics.H:411
void parseDebug() noexcept
Parse the maximum number of particles generated per cell.
Definition: CD_ItoKMCPhysicsImplem.H:240
virtual bool needGradients() const noexcept
Return true/false if physics model needs species gradients.
Definition: CD_ItoKMCPhysics.cpp:56
bool m_isDefined
Is defined or not.
Definition: CD_ItoKMCPhysics.H:431
virtual Real computeEta(const Real a_E, const RealVect a_x) const =0
Compute Townsend attachment coefficient.
static thread_local KMCState m_kmcState
KMC state used in advanceReactionNetwork.
Definition: CD_ItoKMCPhysics.H:446
ItoKMCPhysics() noexcept
Constructor. Does nothing.
Definition: CD_ItoKMCPhysicsImplem.H:27
Class for holding a set of surface reactions.
Definition: CD_ItoKMCSurfaceReactionSet.H:26
A particle class that only has a position and a weight.
Definition: CD_PointParticle.H:29
Class for encapsulating random number generation. This class is MPI and OpenMP safe.
Definition: CD_Random.H:36
Name containing various physics models for running chombo-discharge code.
Definition: CD_AdvectionDiffusion.H:15