15 #ifndef CD_CdrPlasmaJSON_H
16 #define CD_CdrPlasmaJSON_H
24 #include <nlohmann/json.hpp>
35 #include <CD_NamespaceHeader.H>
37 using json = nlohmann::json;
63 using FunctionEN = std::function<Real(
const Real a_E,
const Real a_N)>;
70 using FunctionX = std::function<Real(
const RealVect a_position)>;
77 using FunctionEX = std::function<Real(
const Real E,
const RealVect x)>;
83 using FunctionT = std::function<Real(
const Real a_T)>;
90 using FunctionTT = std::function<Real(
const Real a_T1,
const Real a_T2)>;
127 virtual Vector<std::string>
145 const Vector<RealVect> a_cdrGradients,
146 const Vector<Real> a_rteDensities,
148 const RealVect a_position,
152 const Real a_kappa)
const override;
160 computeAlpha(
const Real E,
const RealVect a_position)
const override;
169 computeEta(
const Real a_E,
const RealVect a_position)
const override;
189 Vector<Real>& a_rteSources,
190 const Vector<Real> a_cdrDensities,
191 const Vector<RealVect> a_cdrGradients,
192 const Vector<Real> a_rteDensities,
194 const RealVect a_pos,
198 const Real a_kappa)
const override;
208 virtual Vector<RealVect>
210 const RealVect a_pos,
212 const Vector<Real> a_cdrDensities)
const override;
224 const RealVect a_pos,
226 const Vector<Real> a_cdrDensities)
const override;
243 const RealVect a_pos,
244 const RealVect a_normal,
246 const Vector<Real> a_cdrDensities,
247 const Vector<Real> a_cdrVelocities,
248 const Vector<Real> a_cdrGradients,
249 const Vector<Real> a_rteFluxes,
250 const Vector<Real> a_extrapCdrFluxes)
const override;
267 const RealVect a_pos,
268 const RealVect a_normal,
270 const Vector<Real> a_cdrDensities,
271 const Vector<Real> a_cdrVelocities,
272 const Vector<Real> a_cdrGradients,
273 const Vector<Real> a_rteFluxes,
274 const Vector<Real> a_extrapCdrFluxes)
const override;
291 const RealVect a_pos,
293 const Side::LoHiSide a_side,
295 const Vector<Real> a_cdrDensities,
296 const Vector<Real> a_cdrVelocities,
297 const Vector<Real> a_cdrGradients,
298 const Vector<Real> a_rteFluxes,
299 const Vector<Real> a_extrapCdrFluxes)
const override;
307 initialSigma(
const Real a_time,
const RealVect a_pos)
const override;
411 std::function<Real(
const RealVect a_position,
const Real a_time)>
m_initialSigma;
873 std::map<std::pair<int, Side::LoHiSide>, std::vector<CdrPlasmaSurfaceReactionJSON>>
m_domainReactions;
988 virtual List<PointParticle>
998 virtual std::list<std::tuple<std::string, std::vector<std::string>, std::vector<std::string>>>
1000 const std::vector<std::string>& a_products,
1001 const json& a_reaction);
1010 std::vector<std::string>& a_products,
1011 const std::string& a_reaction)
const;
1022 const std::vector<std::string>& a_products,
1023 const std::string a_reaction)
const;
1038 std::list<int>& a_neutralReactants,
1039 std::list<int>& a_photonReactants,
1040 std::list<int>& a_plasmaProducts,
1041 std::list<int>& a_neutralProducts,
1042 std::list<int>& a_photonProducts,
1043 const std::vector<std::string>& a_reactants,
1044 const std::vector<std::string>& a_products)
const;
1077 const json& a_reactionJSON,
1078 const std::string a_wildcard);
1134 const std::vector<std::string>& a_products,
1135 const std::string a_reaction)
const;
1213 const json& a_reactionJSON,
1214 const std::vector<std::string>& a_sides);
1225 const json& a_reactionJSON,
1226 const std::vector<std::string>& a_sides);
1236 const std::vector<std::string>& a_products,
1237 const std::string a_reaction)
const;
1245 virtual std::vector<Real>
1247 const RealVect& a_E,
1248 const std::vector<Real>& a_cdrDensities)
const;
1259 virtual std::vector<Real>
1261 const RealVect& a_E,
1262 const std::vector<Real>& a_cdrDensities)
const;
1270 virtual std::vector<Real>
1272 const RealVect& a_E,
1273 const std::vector<Real>& a_cdrDensities)
const;
1282 virtual std::vector<Real>
1285 const std::vector<Real> a_cdrDensities)
const;
1309 const std::vector<Real>& a_cdrDensities,
1310 const std::vector<Real>& a_cdrMobilities,
1311 const std::vector<Real>& a_cdrDiffusionCoefficients,
1312 const std::vector<Real>& a_cdrTemperatures,
1313 const std::vector<Real>& a_cdrEnergies,
1314 const std::vector<RealVect>& a_cdrGradients,
1315 const RealVect& a_pos,
1316 const RealVect& a_vectorE,
1320 const Real& a_alpha,
1322 const Real& a_time)
const;
1364 trim(
const std::string& a_string)
const;
1405 const std::vector<Real>& a_rteDensities,
1406 const RealVect a_position,
1409 const Real a_dx)
const;
1424 std::vector<Real>& a_photonProduction,
1425 const std::vector<RealVect> a_cdrGradients,
1427 const RealVect a_pos,
1431 const Real a_kappa)
const;
1447 std::vector<Real>& a_rteSources,
1448 const std::vector<Real> a_cdrDensities,
1449 const std::vector<RealVect> a_cdrGradients,
1451 const RealVect a_pos,
1454 const Real a_kappa)
const;
1470 std::vector<Real>& a_photonProduction,
1471 const std::vector<RealVect> a_cdrGradients,
1473 const RealVect a_pos,
1477 const Real a_kappa)
const;
1493 std::vector<Real>& a_photonProduction,
1494 const std::vector<RealVect> a_cdrGradients,
1496 const RealVect a_pos,
1500 const Real a_kappa)
const;
1518 std::vector<Real>& a_photonProduction,
1519 const std::vector<RealVect> a_cdrGradients,
1521 const RealVect a_pos,
1526 const Real a_tableuAlpha)
const;
1542 std::vector<Real>& a_photonProduction,
1543 const std::vector<RealVect> a_cdrGradients,
1545 const RealVect a_pos,
1549 const Real a_kappa)
const;
1554 #include <CD_NamespaceFooter.H>
Declaration of a class that encapsulates reactions for usage with CdrPlasmaJSON.
Declaration of basic physics coupling functions for Physics/CdrPlasma.
Declaration of a class that encapsulates reactions for usage with CdrPlasmaJSON.
Declaration of a class that encapsulates reactions for usage with CdrPlasmaJSON.
Declaration of a class that encapsulates a CDR species for use with CdrPlasmaJSON.
Declaration of a table for looking up coefficients etc.
Declaration of a class that encapsulates a neutral species for use with CdrPlasmaJSON.
Declaration of a class that encapsulates a RTE species for use with CdrPlasmaJSON.
Class which implements CdrPlasmaPhysics and parses plasma chemistry from a JSON input file.
Definition: CD_CdrPlasmaJSON.H:46
void integrateReactionsExplicitRK4(std::vector< Real > &a_cdrDensities, std::vector< Real > &a_photonProduction, const std::vector< RealVect > a_cdrGradients, const RealVect a_E, const RealVect a_pos, const Real a_dx, const Real a_dt, const Real a_time, const Real a_kappa) const
Routine for integrating the reactive-only problem using the foruth order Runge-Kutta method.
Definition: CD_CdrPlasmaJSON.cpp:5766
std::map< std::tuple< int, Side::LoHiSide, int >, bool > m_domainExtrapBC
A container which determines if we should add the extrapolated flux as an inflow condition.
Definition: CD_CdrPlasmaJSON.H:889
virtual void sanctifyPhotoReaction(const std::vector< std::string > &a_reactants, const std::vector< std::string > &a_products, const std::string a_reaction) const
Check if a photo-reaction makes sense in terms of the species that have been defined.
Definition: CD_CdrPlasmaJSON.cpp:2477
std::map< int, FunctionEX > m_dielectricReactionEfficiencies
Dielectric reaction effiencies. Used for scaling reactions on dielectrics in a "generic" way.
Definition: CD_CdrPlasmaJSON.H:822
std::map< int, std::map< int, std::pair< ReactiveEnergyLoss, Real > > > m_plasmaReactionEnergyLosses
For mapping reactive energy losses for all reactions.
Definition: CD_CdrPlasmaJSON.H:726
std::map< int, LookupMethod > m_diffusionLookup
Diffusion lookup method.
Definition: CD_CdrPlasmaJSON.H:594
virtual void initializeSigma()
Initialize surface charge.
Definition: CD_CdrPlasmaJSON.cpp:1236
virtual void parseDielectricReactionEnergyLosses(const int a_reactionIndex, const json &a_reactionJSON)
Parse dielectric-reaction energy losses.
Definition: CD_CdrPlasmaJSON.cpp:4108
virtual void parseIntegrator()
Parse the reactive integrator.
Definition: CD_CdrPlasmaJSON.cpp:107
std::map< int, LookupTable1D< Real, 1 > > m_mobilityTablesEN
Map for table-based mobilities. Stored as tables (E/N, mu*N)
Definition: CD_CdrPlasmaJSON.H:579
virtual void parseElectrodeReactionRate(const int a_reactionIndex, const json &a_reactionJSON)
Parse reaction rate for electrode surface reactions.
Definition: CD_CdrPlasmaJSON.cpp:3556
virtual void parseJSON()
Parse the JSON file.
Definition: CD_CdrPlasmaJSON.cpp:143
virtual void parsePlasmaReactionRate(const int a_reactionIndex, const json &a_reactionJSON)
Parse reaction rate for plasma reaction.
Definition: CD_CdrPlasmaJSON.cpp:2588
std::map< int, Real > m_plasmaReactionConstants
Constant plasma reaction rates.
Definition: CD_CdrPlasmaJSON.H:654
ReactionIntegrator m_reactionIntegrator
Reaction integrator.
Definition: CD_CdrPlasmaJSON.H:391
virtual std::vector< Real > computePlasmaSpeciesTemperatures(const RealVect &a_position, const RealVect &a_E, const std::vector< Real > &a_cdrDensities) const
Compute the various plasma species temperatures.
Definition: CD_CdrPlasmaJSON.cpp:4510
std::map< int, bool > m_electrodeReactionHasEnergyLoss
Associative container for determining if a reaction is associated with an energy loss/gain.
Definition: CD_CdrPlasmaJSON.H:798
std::map< int, FunctionEN > m_plasmaReactionFunctionsEN
Function-based plasma reaction rates.
Definition: CD_CdrPlasmaJSON.H:686
virtual void addPhotoIonization(std::vector< Real > &a_cdrSources, const std::vector< Real > &a_rteDensities, const RealVect a_position, const Real a_E, const Real a_dt, const Real a_dx) const
Add photoionization products to transport equations source terms.
Definition: CD_CdrPlasmaJSON.cpp:5407
std::function< Real(const Real E, const RealVect x)> FunctionEX
Function for encapsulating a function f = f(E, x) where E is the electric field at physical coordinat...
Definition: CD_CdrPlasmaJSON.H:77
std::map< std::pair< int, Side::LoHiSide >, std::map< int, LookupMethod > > m_domainReactionLookup
Lookup method for the domain reaction rates. The pair is made up of an int representing direction (0=...
Definition: CD_CdrPlasmaJSON.H:854
std::map< int, LookupMethod > m_temperatureLookup
Temperature lookup method.
Definition: CD_CdrPlasmaJSON.H:625
std::map< int, std::string > m_plasmaReactionDescriptions
Description of plasma reactions. Only used for I/O.
Definition: CD_CdrPlasmaJSON.H:644
virtual std::vector< Real > computePlasmaSpeciesDiffusion(const RealVect a_position, const RealVect a_E, const std::vector< Real > a_cdrDensities) const
Compute the various plasma species diffusion coefficients.
Definition: CD_CdrPlasmaJSON.cpp:4432
std::function< Real(const RealVect a_position, const Real a_time)> InitialDataFunction
Function alias for initial data function.
Definition: CD_CdrPlasmaJSON.H:53
std::map< int, int > m_plasmaReactionAlphaV
Plasma reaction rates that are alpha*|v|.
Definition: CD_CdrPlasmaJSON.H:659
std::map< int, LookupMethod > m_mobilityLookup
Mobility lookup method for each species.
Definition: CD_CdrPlasmaJSON.H:559
std::vector< CdrPlasmaReactionJSON > m_plasmaReactions
Plasma reactions.
Definition: CD_CdrPlasmaJSON.H:707
std::map< std::string, int > m_cdrSpeciesMap
string-int encoding of the CDr species.
Definition: CD_CdrPlasmaJSON.H:457
std::map< std::string, int > m_neutralSpeciesMap
Map for figuring out which where in m_neutralSpecies a neutral species is found.
Definition: CD_CdrPlasmaJSON.H:446
std::map< int, LookupTable1D< Real, 1 > > m_diffusionTablesEN
Map for table-based diffusion coefficients D = D(E,N).
Definition: CD_CdrPlasmaJSON.H:610
virtual List< PointParticle > parsePlasmaSpeciesInitialParticles(const json &a_json) const
Generate initial particles for a given plasma species.
Definition: CD_CdrPlasmaJSON.cpp:970
json m_json
JSON definition. This is populated when calling parseJSON.
Definition: CD_CdrPlasmaJSON.H:386
FunctionX m_gasDensity
Gas number density (in m^(-3))
Definition: CD_CdrPlasmaJSON.H:426
std::map< int, Real > m_electrodeReactionConstants
Constant electrode reaction rate.
Definition: CD_CdrPlasmaJSON.H:776
void throwParserError(const std::string a_error) const
Throw a parser error.
Definition: CD_CdrPlasmaJSON.cpp:159
std::vector< std::shared_ptr< NeutralSpeciesJSON > > m_neutralSpecies
These are the neutral species.
Definition: CD_CdrPlasmaJSON.H:441
bool isPlasmaSpecies(const std::string &a_name) const
Return true if species exists in map and false otherwise.
Definition: CD_CdrPlasmaJSON.cpp:4310
std::function< Real(const RealVect a_position)> FunctionX
Function for encapsulating a function f = f(x) where x is the physical coordinates.
Definition: CD_CdrPlasmaJSON.H:70
std::map< int, int > m_cdrTransportEnergyMap
int-int encoding for associating a transport solver with an energy solver.
Definition: CD_CdrPlasmaJSON.H:487
std::map< int, std::string > m_cdrSpeciesInverseMap
int-string encoding of the CDR species.
Definition: CD_CdrPlasmaJSON.H:464
virtual void parseElectrodeReactionScaling(const int a_reactionIndex, const json &a_reactionJSON)
Parse electrode reaction scaling for a specific reaction.
Definition: CD_CdrPlasmaJSON.cpp:3596
std::map< std::pair< int, Side::LoHiSide >, std::vector< CdrPlasmaSurfaceReactionJSON > > m_domainReactions
List of domain reactions. The pair is made up of an int representing direction (0=x,...
Definition: CD_CdrPlasmaJSON.H:873
virtual void parsePlasmaReactionPlot(const int a_reactionIndex, const json &a_reactionJSON)
Parse reaction plotting.
Definition: CD_CdrPlasmaJSON.cpp:3049
virtual std::list< std::tuple< std::string, std::vector< std::string >, std::vector< std::string > > > parseReactionWildcards(const std::vector< std::string > &a_reactants, const std::vector< std::string > &a_products, const json &a_reaction)
Make a reaction set into a superset. This parses wildcards '@' in reaction string.
Definition: CD_CdrPlasmaJSON.cpp:2367
std::vector< json > m_cdrSpeciesJSON
JSON entries for species in the defined field 'plasma species'.
Definition: CD_CdrPlasmaJSON.H:401
virtual void sanctifySurfaceReaction(const std::vector< std::string > &a_reactants, const std::vector< std::string > &a_products, const std::string a_reaction) const
Check if a surface-reaction makes sense in terms of the species that have been defined.
Definition: CD_CdrPlasmaJSON.cpp:2541
virtual void parseDomainReactionRate(const int a_reactionIndex, const json &a_reactionJSON, const std::vector< std::string > &a_sides)
Parse reaction rate for domain reactions.
Definition: CD_CdrPlasmaJSON.cpp:4002
std::map< int, std::list< std::pair< int, Real > > > m_electrodeReactionEnergyLosses
Associated energy losses for a surface reaction on electrodes.
Definition: CD_CdrPlasmaJSON.H:793
std::map< int, std::string > m_rteSpeciesInverseMap
int-string encoding of the RTE species.
Definition: CD_CdrPlasmaJSON.H:506
virtual void parseDielectricReactionScaling(const int a_reactionIndex, const json &a_reactionJSON)
Parse dielectric electrode reaction scaling for a specific reaction.
Definition: CD_CdrPlasmaJSON.cpp:3828
void fillSourceTerms(std::vector< Real > &a_cdrSources, std::vector< Real > &a_rteSources, const std::vector< Real > a_cdrDensities, const std::vector< RealVect > a_cdrGradients, const RealVect a_E, const RealVect a_pos, const Real a_dx, const Real a_time, const Real a_kappa) const
Routine for filling the source terms in the reactive problem.
Definition: CD_CdrPlasmaJSON.cpp:5540
std::map< int, std::list< std::pair< int, Real > > > m_photoReactionEnergyLosses
Associated energy losses for a photo-reaction.
Definition: CD_CdrPlasmaJSON.H:757
void throwParserWarning(const std::string a_warning) const
Throw a parser wearning.
Definition: CD_CdrPlasmaJSON.cpp:167
bool m_plotEta
Plot Townsend attachment coefficient.
Definition: CD_CdrPlasmaJSON.H:371
virtual void sanityCheckSpecies() const
Do a species sanity check.
Definition: CD_CdrPlasmaJSON.cpp:205
virtual Vector< Real > computeCdrDielectricFluxes(const Real a_time, const RealVect a_pos, const RealVect a_normal, const RealVect a_E, const Vector< Real > a_cdrDensities, const Vector< Real > a_cdrVelocities, const Vector< Real > a_cdrGradients, const Vector< Real > a_rteFluxes, const Vector< Real > a_extrapCdrFluxes) const override
Compute CDR fluxes on dielectric-gas interfaces. This is used as a boundary condition in the CDR equa...
Definition: CD_CdrPlasmaJSON.cpp:5143
FunctionX m_gasPressure
Gas pressure (in Pascal).
Definition: CD_CdrPlasmaJSON.H:416
std::vector< json > m_rteSpeciesJSON
JSON entries for species in photon_species.
Definition: CD_CdrPlasmaJSON.H:406
std::map< int, bool > m_electrodeExtrapBC
A container which determines if we should add the extrapolated flux as an inflow condition.
Definition: CD_CdrPlasmaJSON.H:803
FunctionX m_gasTemperature
Gas temperature (in Kelvin)
Definition: CD_CdrPlasmaJSON.H:421
virtual void parseReactionString(std::vector< std::string > &a_reactants, std::vector< std::string > &a_products, const std::string &a_reaction) const
Parses a reaction string into reactangs and products.
Definition: CD_CdrPlasmaJSON.cpp:257
std::map< int, std::tuple< int, int, FunctionTT > > m_plasmaReactionFunctionsTT
Maps for functions of the type k = f(T1,T2) where T1 and T2 are the temperatures of some species.
Definition: CD_CdrPlasmaJSON.H:681
virtual void parseDomainReactions()
Parse secondary emission on domain.
Definition: CD_CdrPlasmaJSON.cpp:3851
virtual void parsePhotoReactionEnergyLosses(const int a_reactionIndex, const json &a_reactionJSON)
Parse photo-reaction energy losses.
Definition: CD_CdrPlasmaJSON.cpp:3387
virtual void parseTemperatures()
Initialize species temperatures.
Definition: CD_CdrPlasmaJSON.cpp:2150
FunctionEN m_alphaFunctionEN
For when we can put alpha = alpha(E,N) as an analytic function.
Definition: CD_CdrPlasmaJSON.H:535
bool isBracketed(const std::string a_str) const
Return true if string starts and ends with a paranthesis.
Definition: CD_CdrPlasmaJSON.cpp:199
std::map< int, Real > m_diffusionConstants
Map for constant diffusion coefficients.
Definition: CD_CdrPlasmaJSON.H:599
LookupMethod
Enum class for distinguishing types of computation methods when computing transport data stuff.
Definition: CD_CdrPlasmaJSON.H:314
void integrateReactionsExplicitEuler(std::vector< Real > &a_cdrDensities, std::vector< Real > &a_photonProduction, const std::vector< RealVect > a_cdrGradients, const RealVect a_E, const RealVect a_pos, const Real a_dx, const Real a_dt, const Real a_time, const Real a_kappa) const
Routine for integrating the reactive-only problem using the explicit Euler rule.
Definition: CD_CdrPlasmaJSON.cpp:5691
std::map< int, int > m_plasmaReactionEtaV
Plasma reaction rates that are eta*|v|.
Definition: CD_CdrPlasmaJSON.H:664
std::string trim(const std::string &a_string) const
Remove whitespace from string.
Definition: CD_CdrPlasmaJSON.cpp:239
std::map< int, Real > m_cdrMasses
Map of the species masses. This is needed for imposing BCs on the energy equations.
Definition: CD_CdrPlasmaJSON.H:493
std::vector< CdrPlasmaSurfaceReactionJSON > m_dielectricReactions
List of dielectric reactions.
Definition: CD_CdrPlasmaJSON.H:827
bool isPhotonSpecies(const std::string &a_name) const
Return true if species exists in map and false otherwise.
Definition: CD_CdrPlasmaJSON.cpp:4325
std::map< int, std::string > m_neutralSpeciesInverseMap
Inverse of m_neutralSpeciesMap.
Definition: CD_CdrPlasmaJSON.H:451
virtual void parsePhotoReactionScaling(const int a_reactionIndex, const json &a_reactionJSON)
Parse scaling for photo-reactions. Includes Helmholtz corrections if doing Helmholtz reconstruction o...
Definition: CD_CdrPlasmaJSON.cpp:3303
std::map< int, bool > m_dielectricExtrapBC
A container which determines if we should add the extrapolated flux as an inflow condition.
Definition: CD_CdrPlasmaJSON.H:844
bool m_skipReactions
A flag for skipping reactions completely.
Definition: CD_CdrPlasmaJSON.H:381
std::map< int, bool > m_photoReactionHasEnergyLoss
Associative container for determining if a reaction is associated with an energy loss/gain.
Definition: CD_CdrPlasmaJSON.H:762
virtual void parseDielectricReactions()
Parse secondary emission on dielectrics.
Definition: CD_CdrPlasmaJSON.cpp:3678
std::map< int, FunctionEX > m_mobilityFunctionsEX
Map for function-based mobilities mu = mu(E,x)
Definition: CD_CdrPlasmaJSON.H:574
virtual Vector< Real > getPlotVariables(const Vector< Real > a_cdrDensities, const Vector< RealVect > a_cdrGradients, const Vector< Real > a_rteDensities, const RealVect a_E, const RealVect a_position, const Real a_dx, const Real a_dt, const Real a_time, const Real a_kappa) const override
Provide plot variables. This is used by CdrPlasmaStepper when writing plot files.
Definition: CD_CdrPlasmaJSON.cpp:4206
std::map< int, bool > m_plasmaReactionHasEnergyLoss
Associative container for determining if a reaction is associated with an energy loss/gain.
Definition: CD_CdrPlasmaJSON.H:731
virtual void parsePlasmaReactionEnergyLosses(const int a_reactionIndex, const json &a_reactionJSON)
Parse plasma reaction energy losses.
Definition: CD_CdrPlasmaJSON.cpp:3143
virtual Vector< Real > computeCdrElectrodeFluxes(const Real a_time, const RealVect a_pos, const RealVect a_normal, const RealVect a_E, const Vector< Real > a_cdrDensities, const Vector< Real > a_cdrVelocities, const Vector< Real > a_cdrGradients, const Vector< Real > a_rteFluxes, const Vector< Real > a_extrapCdrFluxes) const override
Compute CDR fluxes on electrode-gas interfaces. This is used as a boundary condition in the CDR equat...
Definition: CD_CdrPlasmaJSON.cpp:5000
virtual void parseEta()
Parse the Townsend attachment coefficient.
Definition: CD_CdrPlasmaJSON.cpp:1393
virtual void parseOptions()
Parse class options.
Definition: CD_CdrPlasmaJSON.cpp:84
Real m_chemistryDt
Chemistry time step.
Definition: CD_CdrPlasmaJSON.H:431
std::function< Real(const RealVect a_position, const Real a_time)> m_initialSigma
Initial surface charge.
Definition: CD_CdrPlasmaJSON.H:411
FunctionEN m_etaFunctionEN
For when we can put eta = eta(E,N) as an analytic function.
Definition: CD_CdrPlasmaJSON.H:540
virtual Real computeAlpha(const Real E, const RealVect a_position) const override
Compute alpha. Should return Townsend ionization coefficient.
Definition: CD_CdrPlasmaJSON.cpp:4782
LookupTable1D< Real, 1 > m_alphaTableEN
For when we can put alpha = table(E,N)
Definition: CD_CdrPlasmaJSON.H:545
virtual Vector< Real > computeCdrDiffusionCoefficients(const Real a_time, const RealVect a_pos, const RealVect a_E, const Vector< Real > a_cdrDensities) const override
Compute diffusion coefficients for the CDR equations.
Definition: CD_CdrPlasmaJSON.cpp:4981
virtual void initializeNeutralSpecies()
Initialize neutral species.
Definition: CD_CdrPlasmaJSON.cpp:364
std::map< std::pair< int, Side::LoHiSide >, std::map< int, Real > > m_domainReactionConstants
Constant domain reaction rate. The pair is made up of an int representing direction (0=x,...
Definition: CD_CdrPlasmaJSON.H:860
virtual Vector< RealVect > computeCdrDriftVelocities(const Real a_time, const RealVect a_pos, const RealVect a_E, const Vector< Real > a_cdrDensities) const override
Compute velocities for the CDR equations.
Definition: CD_CdrPlasmaJSON.cpp:4934
std::map< int, FunctionEN > m_mobilityFunctionsEN
Map for function-based mobilities mu = mu(E,N)
Definition: CD_CdrPlasmaJSON.H:569
Real m_alphaConstant
For when we can use alpha = constant.
Definition: CD_CdrPlasmaJSON.H:525
LookupTable1D< Real, 1 > m_etaTableEN
For when we can put eta = table(E,N)
Definition: CD_CdrPlasmaJSON.H:550
std::function< Real(const Real a_E, const Real a_N)> FunctionEN
Function for encapsulating operations f = f(E,N). field in Townsend units.
Definition: CD_CdrPlasmaJSON.H:63
bool m_discretePhotons
Using discrete photons or not.
Definition: CD_CdrPlasmaJSON.H:376
virtual void advanceReactionNetwork(Vector< Real > &a_cdrSources, Vector< Real > &a_rteSources, const Vector< Real > a_cdrDensities, const Vector< RealVect > a_cdrGradients, const Vector< Real > a_rteDensities, const RealVect a_E, const RealVect a_pos, const Real a_dx, const Real a_dt, const Real a_time, const Real a_kappa) const override
Routine intended for advancing a reaction network over a time a_dt.
Definition: CD_CdrPlasmaJSON.cpp:4847
std::map< int, std::pair< int, LookupTable1D< Real, 1 > > > m_plasmaReactionTablesEnergy
Map for table-based reaction coefficients where k = k(energy).
Definition: CD_CdrPlasmaJSON.H:697
std::vector< FunctionX > m_neutralSpeciesDensities
Neutral species densities.
Definition: CD_CdrPlasmaJSON.H:436
virtual int getNumberOfPlotVariables() const override
Get number of plot variables for this physics class.
Definition: CD_CdrPlasmaJSON.cpp:4083
virtual void parsePhotoReactions()
Parse photo-reactions.
Definition: CD_CdrPlasmaJSON.cpp:3242
std::vector< CdrPlasmaPhotoReactionJSON > m_photoReactions
Photo-reactions.
Definition: CD_CdrPlasmaJSON.H:750
virtual void parseDomainReactionScaling(const int a_reactionIndex, const json &a_reactionJSON, const std::vector< std::string > &a_sides)
Parse domain reaction scaling for a specific reaction.
Definition: CD_CdrPlasmaJSON.cpp:4050
bool isNeutralSpecies(const std::string &a_name) const
Return true if species exists in map and false otherwise.
Definition: CD_CdrPlasmaJSON.cpp:4295
std::map< std::string, int > m_rteSpeciesMap
string-int encoding of the RTE species.
Definition: CD_CdrPlasmaJSON.H:499
virtual void initializePlasmaSpecies()
Initialize species.
Definition: CD_CdrPlasmaJSON.cpp:590
std::map< int, LookupTable1D< Real, 1 > > m_diffusionTablesEnergy
Map for table-based diffusion coefficients as function of energy.
Definition: CD_CdrPlasmaJSON.H:616
std::map< int, LookupTable1D< Real, 1 > > m_mobilityTablesEnergy
Map for table-based mobilities as function of energy.
Definition: CD_CdrPlasmaJSON.H:585
std::map< int, FunctionEX > m_photoReactionEfficiencies
Flag for photo-reaction efficiencies. Includes Helmholtz corrections, if present.
Definition: CD_CdrPlasmaJSON.H:740
void integrateReactionsExplicitRK2(std::vector< Real > &a_cdrDensities, std::vector< Real > &a_photonProduction, const std::vector< RealVect > a_cdrGradients, const RealVect a_E, const RealVect a_pos, const Real a_dx, const Real a_dt, const Real a_time, const Real a_kappa, const Real a_tableuAlpha) const
Routine for integrating the reactive-only problem using a second order Runge-Kutta method.
Definition: CD_CdrPlasmaJSON.cpp:5721
std::map< int, bool > m_plasmaReactionPlot
Plot plasma reaction or not.
Definition: CD_CdrPlasmaJSON.H:712
virtual void initializePhotonSpecies()
Initialize photon species.
Definition: CD_CdrPlasmaJSON.cpp:1084
virtual Vector< Real > computeCdrDomainFluxes(const Real a_time, const RealVect a_pos, const int a_dir, const Side::LoHiSide a_side, const RealVect a_E, const Vector< Real > a_cdrDensities, const Vector< Real > a_cdrVelocities, const Vector< Real > a_cdrGradients, const Vector< Real > a_rteFluxes, const Vector< Real > a_extrapCdrFluxes) const override
Compute CDR fluxes through domain sides. This is used as a boundary condition in the CDR equations.
Definition: CD_CdrPlasmaJSON.cpp:5283
virtual InitialDataFunction parsePlasmaSpeciesInitialData(const json &a_json) const
Generate an initial data function for a given plasma species.
Definition: CD_CdrPlasmaJSON.cpp:751
std::function< Real(const Real a_T)> FunctionT
Function for encapsulating a function f = f(T) where T is the temperature of some species.
Definition: CD_CdrPlasmaJSON.H:83
virtual void parseMobilities()
Initialize species mobilities.
Definition: CD_CdrPlasmaJSON.cpp:1554
virtual ~CdrPlasmaJSON()
Destructor.
Definition: CD_CdrPlasmaJSON.cpp:78
ReactionIntegrator
Enum for distinguishing integration methods. Note that 'None' just fills directly with source terms.
Definition: CD_CdrPlasmaJSON.H:331
bool m_plotGas
Plot gas pressure, density, and temperature.
Definition: CD_CdrPlasmaJSON.H:361
Real m_etaConstant
For when we can use eta = constant.
Definition: CD_CdrPlasmaJSON.H:530
bool containsBracket(const std::string a_str) const
Protect all kinds of brackets in a string.
Definition: CD_CdrPlasmaJSON.cpp:181
LookupMethod m_alphaLookup
Lookup method for Townsend ionization coefficient.
Definition: CD_CdrPlasmaJSON.H:515
std::map< int, Real > m_mobilityConstants
Map for constant mobilities.
Definition: CD_CdrPlasmaJSON.H:564
void integrateReactionsImplicitEuler(std::vector< Real > &a_cdrDensities, std::vector< Real > &a_photonProduction, const std::vector< RealVect > a_cdrGradients, const RealVect a_E, const RealVect a_pos, const Real a_dx, const Real a_dt, const Real a_time, const Real a_kappa) const
Routine for integrating the reactive-only problem using the implicit Euler rule.
LookupMethod m_etaLookup
Lookup method for Townsend attachment coefficient.
Definition: CD_CdrPlasmaJSON.H:520
std::map< int, FunctionEN > m_diffusionFunctionsEN
Map for function-based diffusion coefficients. .
Definition: CD_CdrPlasmaJSON.H:604
virtual void parsePlasmaReactionScaling(const int a_reactionIndex, const json &a_reactionJSON)
Parse scaling factors for reactions.
Definition: CD_CdrPlasmaJSON.cpp:2935
std::map< int, bool > m_cdrIsEnergySolver
int-bool encoding for determining if a solver is an energy solver.
Definition: CD_CdrPlasmaJSON.H:469
const std::map< std::string, Side::LoHiSide > m_sideStringToSide
map to translate side from std::string to Side::LoHiSide
Definition: CD_CdrPlasmaJSON.H:883
virtual void integrateReactions(std::vector< Real > &a_cdrDensities, std::vector< Real > &a_photonProduction, const std::vector< RealVect > a_cdrGradients, const RealVect a_E, const RealVect a_pos, const Real a_dx, const Real a_dt, const Real a_time, const Real a_kappa) const
Routine for integrating the reactive-only problem using various algorithms.
Definition: CD_CdrPlasmaJSON.cpp:5460
std::map< int, Real > m_dielectricReactionConstants
Constant dielectric reaction rate.
Definition: CD_CdrPlasmaJSON.H:817
std::map< int, FunctionEX > m_electrodeReactionEfficiencies
Electrode reaction effiencies. Used for scaling reactions on electrodes in a "generic" way.
Definition: CD_CdrPlasmaJSON.H:781
virtual Vector< std::string > getPlotVariableNames() const override
Get plot variable names. The names and positions between this routine and getPlotVariables must be co...
Definition: CD_CdrPlasmaJSON.cpp:4167
std::map< int, LookupTable1D< Real, 1 > > m_plasmaReactionTablesEN
Map for table-based reaction coefficients, where k = k(E,N).
Definition: CD_CdrPlasmaJSON.H:691
std::map< int, LookupMethod > m_electrodeReactionLookup
Lookup method for the electrode surface reaction rates.
Definition: CD_CdrPlasmaJSON.H:771
virtual void parseAlpha()
Parse the Townsend ionization coefficient.
Definition: CD_CdrPlasmaJSON.cpp:1259
virtual void parseElectrodeReactionEnergyLosses(const int a_reactionIndex, const json &a_reactionJSON)
Parse electrode-reaction energy losses.
Definition: CD_CdrPlasmaJSON.cpp:3619
std::map< int, LookupMethod > m_dielectricReactionLookup
Lookup method for the dielectric surface reaction rates.
Definition: CD_CdrPlasmaJSON.H:812
std::map< int, std::pair< bool, int > > m_plasmaReactionSolovievCorrection
Flag for whether or not reaction includes Soloviev energy correction.
Definition: CD_CdrPlasmaJSON.H:718
std::map< int, FunctionEX > m_plasmaReactionEfficiencies
Scaled plasma reactions. These account for e.g. reaction efficiencies, collisional quenching,...
Definition: CD_CdrPlasmaJSON.H:702
std::map< int, LookupMethod > m_plasmaReactionLookup
Map for figuring out how to look up the rate for a certain plasma reaction.
Definition: CD_CdrPlasmaJSON.H:649
bool m_plotAlpha
Plot Townsend ionization coefficient.
Definition: CD_CdrPlasmaJSON.H:366
bool containsWildcard(const std::string a_str) const
Protect the @ character in a string.
Definition: CD_CdrPlasmaJSON.cpp:175
std::map< int, bool > m_dielectricReactionHasEnergyLoss
Associative container for determining if a reaction is associated with an energy loss/gain.
Definition: CD_CdrPlasmaJSON.H:839
virtual void parseDielectricReactionRate(const int a_reactionIndex, const json &a_reactionJSON)
Parse reaction rate for dielectric surface reactions.
Definition: CD_CdrPlasmaJSON.cpp:3788
virtual Real computePlasmaReactionRate(const int &a_reactionIndex, const std::vector< Real > &a_cdrDensities, const std::vector< Real > &a_cdrMobilities, const std::vector< Real > &a_cdrDiffusionCoefficients, const std::vector< Real > &a_cdrTemperatures, const std::vector< Real > &a_cdrEnergies, const std::vector< RealVect > &a_cdrGradients, const RealVect &a_pos, const RealVect &a_vectorE, const Real &a_E, const Real &a_Etd, const Real &a_N, const Real &a_alpha, const Real &a_eta, const Real &a_time) const
Compute the reaction rate for a plasma reaction.
Definition: CD_CdrPlasmaJSON.cpp:4617
std::map< int, bool > m_cdrHasEnergySolver
int-bool encoding for determining if a CDR solver HAS an associated energy solver.
Definition: CD_CdrPlasmaJSON.H:474
std::map< std::pair< int, Side::LoHiSide >, std::map< int, FunctionEX > > m_domainReactionEfficiencies
Domain reaction effiencies. Used for scaling reactions on domains in a "generic" way....
Definition: CD_CdrPlasmaJSON.H:867
std::map< int, std::list< std::pair< int, Real > > > m_dielectricReactionEnergyLosses
Associated energy losses for a surface reaction on dielectrics.
Definition: CD_CdrPlasmaJSON.H:834
virtual void parseDiffusion()
Initialize species diffusion coefficients.
Definition: CD_CdrPlasmaJSON.cpp:1867
std::map< int, std::pair< int, FunctionT > > m_plasmaReactionFunctionsT
Maps for functions of the type k = f(T) where T is the temperature of some species.
Definition: CD_CdrPlasmaJSON.H:670
std::string m_jsonFile
Input JSON file name.
Definition: CD_CdrPlasmaJSON.H:396
bool doesFileExist(const std::string a_filename) const
Check if file exists.
Definition: CD_CdrPlasmaJSON.cpp:4340
std::map< int, bool > m_photoReactionUseHelmholtz
Map over the Helmholtz reconstructions.
Definition: CD_CdrPlasmaJSON.H:745
std::map< int, LookupTable1D< Real, 1 > > m_temperatureTablesEN
Temperatures as functions of E/N.
Definition: CD_CdrPlasmaJSON.H:635
virtual void parsePlasmaReactionSoloviev(const int a_reactionIndex, const json &a_reactionJSON)
Parse plasma reaction energy correction.
Definition: CD_CdrPlasmaJSON.cpp:3094
const std::map< char, int > m_dirCharToInt
map to translate dir from char to int
Definition: CD_CdrPlasmaJSON.H:878
std::map< int, std::tuple< Real, Real, Real > > m_cdrEnergyComputation
Parameters for computing the mean energy from energy density and density.
Definition: CD_CdrPlasmaJSON.H:480
CdrPlasmaJSON()
Default constructor. Puts object in usable state.
Definition: CD_CdrPlasmaJSON.cpp:34
virtual void parsePlasmaReactions()
Parse plasma reactions.
Definition: CD_CdrPlasmaJSON.cpp:2284
virtual void sanctifyPlasmaReaction(const std::vector< std::string > &a_reactants, const std::vector< std::string > &a_products, const std::string a_reaction) const
Check if a plasma-reaction makes sense in terms of the species that have been defined.
Definition: CD_CdrPlasmaJSON.cpp:2431
std::vector< CdrPlasmaSurfaceReactionJSON > m_electrodeReactions
List of electrode reactions.
Definition: CD_CdrPlasmaJSON.H:786
virtual void getReactionSpecies(std::list< int > &a_plasmaReactants, std::list< int > &a_neutralReactants, std::list< int > &a_photonReactants, std::list< int > &a_plasmaProducts, std::list< int > &a_neutralProducts, std::list< int > &a_photonProducts, const std::vector< std::string > &a_reactants, const std::vector< std::string > &a_products) const
Get the int-encoding corresponding to species involved in some reaction.
Definition: CD_CdrPlasmaJSON.cpp:294
std::function< Real(const Real a_T1, const Real a_T2)> FunctionTT
Function for encapsulating a function f = f(T1, T2) where T1/T2 are temperatures of two species.
Definition: CD_CdrPlasmaJSON.H:90
virtual std::vector< Real > computePlasmaSpeciesMobilities(const RealVect &a_position, const RealVect &a_E, const std::vector< Real > &a_cdrDensities) const
Compute the various plasma species mobilities.
Definition: CD_CdrPlasmaJSON.cpp:4353
virtual Real initialSigma(const Real a_time, const RealVect a_pos) const override
Set the initial surface charge.
Definition: CD_CdrPlasmaJSON.cpp:5401
virtual void parseRuntimeOptions() override
Parse run-time class options.
Definition: CD_CdrPlasmaJSON.cpp:99
virtual void parsePlasmaReactionDescription(const int a_reactionIndex, const json &a_reactionJSON, const std::string a_wildcard)
Parse plasma reaction descriptions.
Definition: CD_CdrPlasmaJSON.cpp:3066
ReactiveEnergyLoss
Enum class for distinguishing how we add/lose energy when running LEA-based models....
Definition: CD_CdrPlasmaJSON.H:345
std::map< int, FunctionX > m_temperatureConstants
Constant temperatures.
Definition: CD_CdrPlasmaJSON.H:630
virtual Real computeEta(const Real a_E, const RealVect a_position) const override
Compute eta. Should return Townsend attachment coefficient.
Definition: CD_CdrPlasmaJSON.cpp:4812
virtual std::vector< Real > computePlasmaSpeciesEnergies(const RealVect &a_position, const RealVect &a_E, const std::vector< Real > &a_cdrDensities) const
Compute the various plasma species energies. Returns a list of energies in electron-volts....
Definition: CD_CdrPlasmaJSON.cpp:4532
virtual void parseElectrodeReactions()
Parse secondary emission on electrodes.
Definition: CD_CdrPlasmaJSON.cpp:3446
bool m_verbose
Verbose or not.
Definition: CD_CdrPlasmaJSON.H:356
Abstract base class for specifying plasma kinetics. This is the base class used by CdrPlasmaStepper w...
Definition: CD_CdrPlasmaPhysics.H:32
Name containing various physics models for running chombo-discharge code.
Definition: CD_AdvectionDiffusion.H:15