chombo-discharge
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
Physics::CdrPlasma::CdrPlasmaJSON Class Reference

Class which implements CdrPlasmaPhysics and parses plasma chemistry from a JSON input file. More...

#include <CD_CdrPlasmaJSON.H>

Inheritance diagram for Physics::CdrPlasma::CdrPlasmaJSON:
Inheritance graph
[legend]
Collaboration diagram for Physics::CdrPlasma::CdrPlasmaJSON:
Collaboration graph
[legend]

Public Types

using InitialDataFunction = std::function< Real(const RealVect a_position, const Real a_time)>
 Function alias for initial data function. More...
 
using FunctionEN = std::function< Real(const Real a_E, const Real a_N)>
 Function for encapsulating operations f = f(E,N). field in Townsend units. More...
 
using FunctionX = std::function< Real(const RealVect a_position)>
 Function for encapsulating a function f = f(x) where x is the physical coordinates. More...
 
using FunctionEX = std::function< Real(const Real E, const RealVect x)>
 Function for encapsulating a function f = f(E, x) where E is the electric field at physical coordinates x. More...
 
using FunctionT = std::function< Real(const Real a_T)>
 Function for encapsulating a function f = f(T) where T is the temperature of some species. More...
 
using FunctionTT = std::function< Real(const Real a_T1, const Real a_T2)>
 Function for encapsulating a function f = f(T1, T2) where T1/T2 are temperatures of two species. More...
 

Public Member Functions

 CdrPlasmaJSON ()
 Default constructor. Puts object in usable state.
 
 CdrPlasmaJSON (const int a_dummy)
 Dummy constructor. Leaves object in undefined state. More...
 
virtual ~CdrPlasmaJSON ()
 Destructor.
 
virtual void parseRuntimeOptions () override
 Parse run-time class options.
 
virtual int getNumberOfPlotVariables () const override
 Get number of plot variables for this physics class. More...
 
virtual Vector< std::string > getPlotVariableNames () const override
 Get plot variable names. The names and positions between this routine and getPlotVariables must be consistent!
 
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. More...
 
virtual Real computeAlpha (const Real E, const RealVect a_position) const override
 Compute alpha. Should return Townsend ionization coefficient. More...
 
virtual Real computeEta (const Real a_E, const RealVect a_position) const override
 Compute eta. Should return Townsend attachment coefficient. More...
 
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. More...
 
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. More...
 
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. More...
 
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 equations. More...
 
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 equations. More...
 
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. More...
 
virtual Real initialSigma (const Real a_time, const RealVect a_pos) const override
 Set the initial surface charge. More...
 
- Public Member Functions inherited from Physics::CdrPlasma::CdrPlasmaPhysics
 CdrPlasmaPhysics ()
 Default constructor. Does nothing.
 
virtual ~CdrPlasmaPhysics ()
 Base destructor. Does nothing.
 
const Vector< RefCountedPtr< CdrSpecies > > & getCdrSpecies () const
 Get all CDR species.
 
const Vector< RefCountedPtr< RtSpecies > > & getRtSpecies () const
 Get all RTE species.
 
int getNumCdrSpecies () const
 Return number of CDR species that we solve for.
 
int getNumRtSpecies () const
 Return number of RTE equations that we solve for.
 

Protected Types

enum class  LookupMethod {
  Constant , FunctionX , FunctionT , FunctionTT ,
  FunctionEN , FunctionEX , TableEN , TableEnergy ,
  AlphaV , EtaV
}
 Enum class for distinguishing types of computation methods when computing transport data stuff.
 
enum class  ReactionIntegrator {
  None , ExplicitEuler , ExplicitTrapezoidal , ExplicitMidpoint ,
  ExplicitRK4
}
 Enum for distinguishing integration methods. Note that 'None' just fills directly with source terms.
 
enum class  ReactiveEnergyLoss {
  AddMean , SubtractMean , AddDirect , SubtractDirect ,
  External
}
 Enum class for distinguishing how we add/lose energy when running LEA-based models. The user will specify how to do this in the chemistry file, where 'AddMean' means that we add the mean energy to the equation. Likewise, 'SubtractMean' implies removing the mean energy, and 'External' is a user-specified energy to be added/removed.
 

Protected Member Functions

virtual void parseOptions ()
 Parse class options.
 
virtual void parseIntegrator ()
 Parse the reactive integrator.
 
virtual void parseJSON ()
 Parse the JSON file.
 
virtual void initializeSigma ()
 Initialize surface charge. More...
 
virtual void initializeNeutralSpecies ()
 Initialize neutral species.
 
virtual void initializePlasmaSpecies ()
 Initialize species. More...
 
virtual void initializePhotonSpecies ()
 Initialize photon species. More...
 
virtual void parseMobilities ()
 Initialize species mobilities.
 
virtual void parseDiffusion ()
 Initialize species diffusion coefficients.
 
virtual void parseTemperatures ()
 Initialize species temperatures.
 
virtual void parseAlpha ()
 Parse the Townsend ionization coefficient.
 
virtual void parseEta ()
 Parse the Townsend attachment coefficient.
 
virtual void parsePlasmaReactions ()
 Parse plasma reactions.
 
virtual InitialDataFunction parsePlasmaSpeciesInitialData (const json &a_json) const
 Generate an initial data function for a given plasma species. More...
 
virtual List< PointParticleparsePlasmaSpeciesInitialParticles (const json &a_json) const
 Generate initial particles for a given plasma species. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
virtual void parsePlasmaReactionRate (const int a_reactionIndex, const json &a_reactionJSON)
 Parse reaction rate for plasma reaction. More...
 
virtual void parsePlasmaReactionScaling (const int a_reactionIndex, const json &a_reactionJSON)
 Parse scaling factors for reactions. More...
 
virtual void parsePlasmaReactionPlot (const int a_reactionIndex, const json &a_reactionJSON)
 Parse reaction plotting. More...
 
virtual void parsePlasmaReactionDescription (const int a_reactionIndex, const json &a_reactionJSON, const std::string a_wildcard)
 Parse plasma reaction descriptions. More...
 
virtual void parsePlasmaReactionSoloviev (const int a_reactionIndex, const json &a_reactionJSON)
 Parse plasma reaction energy correction. More...
 
virtual void parsePlasmaReactionEnergyLosses (const int a_reactionIndex, const json &a_reactionJSON)
 Parse plasma reaction energy losses. More...
 
virtual void parsePhotoReactions ()
 Parse photo-reactions.
 
virtual void parsePhotoReactionScaling (const int a_reactionIndex, const json &a_reactionJSON)
 Parse scaling for photo-reactions. Includes Helmholtz corrections if doing Helmholtz reconstruction of photoionization profiles. More...
 
virtual void parsePhotoReactionEnergyLosses (const int a_reactionIndex, const json &a_reactionJSON)
 Parse photo-reaction energy losses. More...
 
virtual void sanityCheckSpecies () const
 Do a species sanity check. More...
 
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. More...
 
virtual void parseElectrodeReactions ()
 Parse secondary emission on electrodes.
 
virtual void parseElectrodeReactionRate (const int a_reactionIndex, const json &a_reactionJSON)
 Parse reaction rate for electrode surface reactions. More...
 
virtual void parseElectrodeReactionScaling (const int a_reactionIndex, const json &a_reactionJSON)
 Parse electrode reaction scaling for a specific reaction. More...
 
virtual void parseElectrodeReactionEnergyLosses (const int a_reactionIndex, const json &a_reactionJSON)
 Parse electrode-reaction energy losses. More...
 
virtual void parseDielectricReactions ()
 Parse secondary emission on dielectrics.
 
virtual void parseDielectricReactionRate (const int a_reactionIndex, const json &a_reactionJSON)
 Parse reaction rate for dielectric surface reactions. More...
 
virtual void parseDielectricReactionScaling (const int a_reactionIndex, const json &a_reactionJSON)
 Parse dielectric electrode reaction scaling for a specific reaction. More...
 
virtual void parseDielectricReactionEnergyLosses (const int a_reactionIndex, const json &a_reactionJSON)
 Parse dielectric-reaction energy losses. More...
 
virtual void parseDomainReactions ()
 Parse secondary emission on domain.
 
virtual void parseDomainReactionRate (const int a_reactionIndex, const json &a_reactionJSON, const std::vector< std::string > &a_sides)
 Parse reaction rate for domain reactions. More...
 
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. More...
 
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. More...
 
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. More...
 
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. We assume that temperature-energy relations are e = 3/2 * kB * T. More...
 
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. More...
 
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. More...
 
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. More...
 
void throwParserError (const std::string a_error) const
 Throw a parser error. More...
 
void throwParserWarning (const std::string a_warning) const
 Throw a parser wearning. More...
 
bool containsWildcard (const std::string a_str) const
 Protect the @ character in a string. More...
 
bool containsBracket (const std::string a_str) const
 Protect all kinds of brackets in a string. More...
 
bool isBracketed (const std::string a_str) const
 Return true if string starts and ends with a paranthesis. More...
 
std::string trim (const std::string &a_string) const
 Remove whitespace from string.
 
bool isNeutralSpecies (const std::string &a_name) const
 Return true if species exists in map and false otherwise. More...
 
bool isPlasmaSpecies (const std::string &a_name) const
 Return true if species exists in map and false otherwise. More...
 
bool isPhotonSpecies (const std::string &a_name) const
 Return true if species exists in map and false otherwise. More...
 
bool doesFileExist (const std::string a_filename) const
 Check if file exists. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 

Protected Attributes

bool m_verbose
 Verbose or not.
 
bool m_plotGas
 Plot gas pressure, density, and temperature.
 
bool m_plotAlpha
 Plot Townsend ionization coefficient.
 
bool m_plotEta
 Plot Townsend attachment coefficient.
 
bool m_discretePhotons
 Using discrete photons or not.
 
bool m_skipReactions
 A flag for skipping reactions completely.
 
json m_json
 JSON definition. This is populated when calling parseJSON.
 
ReactionIntegrator m_reactionIntegrator
 Reaction integrator.
 
std::string m_jsonFile
 Input JSON file name.
 
std::vector< json > m_cdrSpeciesJSON
 JSON entries for species in the defined field 'plasma species'.
 
std::vector< json > m_rteSpeciesJSON
 JSON entries for species in photon_species.
 
std::function< Real(const RealVect a_position, const Real a_time)> m_initialSigma
 Initial surface charge.
 
FunctionX m_gasPressure
 Gas pressure (in Pascal).
 
FunctionX m_gasTemperature
 Gas temperature (in Kelvin)
 
FunctionX m_gasDensity
 Gas number density (in m^(-3))
 
Real m_chemistryDt
 Chemistry time step.
 
std::vector< FunctionXm_neutralSpeciesDensities
 Neutral species densities.
 
std::vector< std::shared_ptr< NeutralSpeciesJSON > > m_neutralSpecies
 These are the neutral species.
 
std::map< std::string, int > m_neutralSpeciesMap
 Map for figuring out which where in m_neutralSpecies a neutral species is found.
 
std::map< int, std::string > m_neutralSpeciesInverseMap
 Inverse of m_neutralSpeciesMap.
 
std::map< std::string, int > m_cdrSpeciesMap
 string-int encoding of the CDr species. More...
 
std::map< int, std::string > m_cdrSpeciesInverseMap
 int-string encoding of the CDR species. More...
 
std::map< int, bool > m_cdrIsEnergySolver
 int-bool encoding for determining if a solver is an energy solver.
 
std::map< int, bool > m_cdrHasEnergySolver
 int-bool encoding for determining if a CDR solver HAS an associated energy solver.
 
std::map< int, std::tuple< Real, Real, Real > > m_cdrEnergyComputation
 Parameters for computing the mean energy from energy density and density. More...
 
std::map< int, int > m_cdrTransportEnergyMap
 int-int encoding for associating a transport solver with an energy solver. More...
 
std::map< int, Real > m_cdrMasses
 Map of the species masses. This is needed for imposing BCs on the energy equations. More...
 
std::map< std::string, int > m_rteSpeciesMap
 string-int encoding of the RTE species. More...
 
std::map< int, std::string > m_rteSpeciesInverseMap
 int-string encoding of the RTE species. More...
 
LookupMethod m_alphaLookup
 Lookup method for Townsend ionization coefficient.
 
LookupMethod m_etaLookup
 Lookup method for Townsend attachment coefficient.
 
Real m_alphaConstant
 For when we can use alpha = constant.
 
Real m_etaConstant
 For when we can use eta = constant.
 
FunctionEN m_alphaFunctionEN
 For when we can put alpha = alpha(E,N) as an analytic function.
 
FunctionEN m_etaFunctionEN
 For when we can put eta = eta(E,N) as an analytic function.
 
LookupTable1D< Real, 1 > m_alphaTableEN
 For when we can put alpha = table(E,N)
 
LookupTable1D< Real, 1 > m_etaTableEN
 For when we can put eta = table(E,N)
 
std::map< int, LookupMethodm_mobilityLookup
 Mobility lookup method for each species.
 
std::map< int, Real > m_mobilityConstants
 Map for constant mobilities.
 
std::map< int, FunctionENm_mobilityFunctionsEN
 Map for function-based mobilities mu = mu(E,N)
 
std::map< int, FunctionEXm_mobilityFunctionsEX
 Map for function-based mobilities mu = mu(E,x)
 
std::map< int, LookupTable1D< Real, 1 > > m_mobilityTablesEN
 Map for table-based mobilities. Stored as tables (E/N, mu*N)
 
std::map< int, LookupTable1D< Real, 1 > > m_mobilityTablesEnergy
 Map for table-based mobilities as function of energy. More...
 
std::map< int, LookupMethodm_diffusionLookup
 Diffusion lookup method.
 
std::map< int, Real > m_diffusionConstants
 Map for constant diffusion coefficients.
 
std::map< int, FunctionENm_diffusionFunctionsEN
 Map for function-based diffusion coefficients. .
 
std::map< int, LookupTable1D< Real, 1 > > m_diffusionTablesEN
 Map for table-based diffusion coefficients D = D(E,N). More...
 
std::map< int, LookupTable1D< Real, 1 > > m_diffusionTablesEnergy
 Map for table-based diffusion coefficients as function of energy. More...
 
std::map< int, LookupMethodm_temperatureLookup
 Temperature lookup method.
 
std::map< int, FunctionXm_temperatureConstants
 Constant temperatures.
 
std::map< int, LookupTable1D< Real, 1 > > m_temperatureTablesEN
 Temperatures as functions of E/N.
 
std::map< int, std::string > m_plasmaReactionDescriptions
 Description of plasma reactions. Only used for I/O.
 
std::map< int, LookupMethodm_plasmaReactionLookup
 Map for figuring out how to look up the rate for a certain plasma reaction.
 
std::map< int, Real > m_plasmaReactionConstants
 Constant plasma reaction rates.
 
std::map< int, int > m_plasmaReactionAlphaV
 Plasma reaction rates that are alpha*|v|.
 
std::map< int, int > m_plasmaReactionEtaV
 Plasma reaction rates that are eta*|v|.
 
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. More...
 
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. More...
 
std::map< int, FunctionENm_plasmaReactionFunctionsEN
 Function-based plasma reaction rates.
 
std::map< int, LookupTable1D< Real, 1 > > m_plasmaReactionTablesEN
 Map for table-based reaction coefficients, where k = k(E,N).
 
std::map< int, std::pair< int, LookupTable1D< Real, 1 > > > m_plasmaReactionTablesEnergy
 Map for table-based reaction coefficients where k = k(energy). More...
 
std::map< int, FunctionEXm_plasmaReactionEfficiencies
 Scaled plasma reactions. These account for e.g. reaction efficiencies, collisional quenching, etc.
 
std::vector< CdrPlasmaReactionJSONm_plasmaReactions
 Plasma reactions.
 
std::map< int, bool > m_plasmaReactionPlot
 Plot plasma reaction or not.
 
std::map< int, std::pair< bool, int > > m_plasmaReactionSolovievCorrection
 Flag for whether or not reaction includes Soloviev energy correction. More...
 
std::map< int, std::map< int, std::pair< ReactiveEnergyLoss, Real > > > m_plasmaReactionEnergyLosses
 For mapping reactive energy losses for all reactions. More...
 
std::map< int, bool > m_plasmaReactionHasEnergyLoss
 Associative container for determining if a reaction is associated with an energy loss/gain.
 
std::map< int, FunctionEXm_photoReactionEfficiencies
 Flag for photo-reaction efficiencies. Includes Helmholtz corrections, if present.
 
std::map< int, bool > m_photoReactionUseHelmholtz
 Map over the Helmholtz reconstructions.
 
std::vector< CdrPlasmaPhotoReactionJSONm_photoReactions
 Photo-reactions.
 
std::map< int, std::list< std::pair< int, Real > > > m_photoReactionEnergyLosses
 Associated energy losses for a photo-reaction. More...
 
std::map< int, bool > m_photoReactionHasEnergyLoss
 Associative container for determining if a reaction is associated with an energy loss/gain.
 
std::map< int, LookupMethodm_electrodeReactionLookup
 Lookup method for the electrode surface reaction rates.
 
std::map< int, Real > m_electrodeReactionConstants
 Constant electrode reaction rate.
 
std::map< int, FunctionEXm_electrodeReactionEfficiencies
 Electrode reaction effiencies. Used for scaling reactions on electrodes in a "generic" way.
 
std::vector< CdrPlasmaSurfaceReactionJSONm_electrodeReactions
 List of electrode reactions.
 
std::map< int, std::list< std::pair< int, Real > > > m_electrodeReactionEnergyLosses
 Associated energy losses for a surface reaction on electrodes. More...
 
std::map< int, bool > m_electrodeReactionHasEnergyLoss
 Associative container for determining if a reaction is associated with an energy loss/gain.
 
std::map< int, bool > m_electrodeExtrapBC
 A container which determines if we should add the extrapolated flux as an inflow condition.
 
std::map< int, LookupMethodm_dielectricReactionLookup
 Lookup method for the dielectric surface reaction rates.
 
std::map< int, Real > m_dielectricReactionConstants
 Constant dielectric reaction rate.
 
std::map< int, FunctionEXm_dielectricReactionEfficiencies
 Dielectric reaction effiencies. Used for scaling reactions on dielectrics in a "generic" way.
 
std::vector< CdrPlasmaSurfaceReactionJSONm_dielectricReactions
 List of dielectric reactions.
 
std::map< int, std::list< std::pair< int, Real > > > m_dielectricReactionEnergyLosses
 Associated energy losses for a surface reaction on dielectrics. More...
 
std::map< int, bool > m_dielectricReactionHasEnergyLoss
 Associative container for determining if a reaction is associated with an energy loss/gain.
 
std::map< int, bool > m_dielectricExtrapBC
 A container which determines if we should add the extrapolated flux as an inflow condition.
 
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=x, 1=y, 2=z) and a Side::LoHiSide representing side (Side::Lo, Side::Hi)
 
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, 1=y, 2=z) and a Side::LoHiSide representing side (Side::Lo, Side::Hi)
 
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. The pair is made up of an int representing direction (0=x, 1=y, 2=z) and a Side::LoHiSide representing side (Side::Lo, Side::Hi)
 
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, 1=y, 2=z) and a Side::LoHiSide representing side (Side::Lo, Side::Hi)
 
const std::map< char, int > m_dirCharToInt {{'x', 0}, {'y', 1}, {'z', 2}}
 map to translate dir from char to int
 
const std::map< std::string, Side::LoHiSide > m_sideStringToSide {{"lo", Side::Lo}, {"hi", Side::Hi}}
 map to translate side from std::string to Side::LoHiSide
 
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. More...
 
- Protected Attributes inherited from Physics::CdrPlasma::CdrPlasmaPhysics
Vector< RefCountedPtr< CdrSpecies > > m_cdrSpecies
 List of species.
 
Vector< RefCountedPtr< RtSpecies > > m_rtSpecies
 List of optical transitions between species.
 
int m_numCdrSpecies
 Number of species.
 
int m_numRtSpecies
 Number of RTE species.
 

Detailed Description

Class which implements CdrPlasmaPhysics and parses plasma chemistry from a JSON input file.

Member Typedef Documentation

◆ FunctionEN

using Physics::CdrPlasma::CdrPlasmaJSON::FunctionEN = std::function<Real(const Real a_E, const Real a_N)>

Function for encapsulating operations f = f(E,N). field in Townsend units.

Parameters
[in]a_EElectric field in SI units.
[in]a_NNeutral density.
Returns
Returns f = f(E,N).
Note
a_E is in SI units and the neutral density is in m^-3.

◆ FunctionEX

using Physics::CdrPlasma::CdrPlasmaJSON::FunctionEX = std::function<Real(const Real E, const RealVect x)>

Function for encapsulating a function f = f(E, x) where E is the electric field at physical coordinates x.

Parameters
[in]EElectric field magnitude in SI units.
[in]xPhysical coordinates

◆ FunctionT

using Physics::CdrPlasma::CdrPlasmaJSON::FunctionT = std::function<Real(const Real a_T)>

Function for encapsulating a function f = f(T) where T is the temperature of some species.

Parameters
[in]a_TSome temperature.

◆ FunctionTT

using Physics::CdrPlasma::CdrPlasmaJSON::FunctionTT = std::function<Real(const Real a_T1, const Real a_T2)>

Function for encapsulating a function f = f(T1, T2) where T1/T2 are temperatures of two species.

Parameters
[in]a_T1Some species temperature.
[in]a_T2Some other species temperature.

◆ FunctionX

using Physics::CdrPlasma::CdrPlasmaJSON::FunctionX = std::function<Real(const RealVect a_position)>

Function for encapsulating a function f = f(x) where x is the physical coordinates.

Parameters
[in]a_positionPhysical coordinates
Returns
Returns f(x)

◆ InitialDataFunction

using Physics::CdrPlasma::CdrPlasmaJSON::InitialDataFunction = std::function<Real(const RealVect a_position, const Real a_time)>

Function alias for initial data function.

Parameters
[in]a_positionPhysical coordinates
[in]a_timeTime

Constructor & Destructor Documentation

◆ CdrPlasmaJSON()

CdrPlasmaJSON::CdrPlasmaJSON ( const int  a_dummy)

Dummy constructor. Leaves object in undefined state.

This constructor is present in order to allow new derived class of CdrPlasmaJSON that instantiate without calling the all-defining base constructor.

Parameters
[in]a_dummyDummy argument.

Member Function Documentation

◆ addPhotoIonization()

void CdrPlasmaJSON::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
protectedvirtual

Add photoionization products to transport equations source terms.

Parameters
[in,out]a_cdrSourcesSource terms for CDR densities.
[in]a_rteDensitiesRTE mesh densities.
[in]a_positionPhysical coordinates
[in]a_EElectric field (SI units)
[in]a_dtTime step
[in]a_dxGrid resolution.

◆ advanceReactionNetwork()

void CdrPlasmaJSON::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
overridevirtual

Routine intended for advancing a reaction network over a time a_dt.

This routine assumes that the subsequent advance is in the form phi^(k+1) = phi^k + S*a_dt. Thus, this routine exists such that users can EITHER fill a_cdrSources and a_rteSources directly with an explicit rule, OR they can perform a fully implicit advance within this routine and set S from that.

Parameters
[out]a_cdrSourcesSource terms for CDR equations.
[out]a_rteSourcesSource terms for RTE equations.
[in]a_cdrDensitiesGrid-based density for particle species.
[in]a_cdrGradientsGrid-based gradients for particle species.
[in]a_rteDensitiesGrid-based densities for photons.
[in]a_EElectric field.
[in]a_posPosition in space.
[in]a_dxGrid resolution.
[in]a_dtAdvanced time.
[in]a_timeCurrent time.
[in]a_kappaGrid cell unit volume.

Implements Physics::CdrPlasma::CdrPlasmaPhysics.

◆ computeAlpha()

Real CdrPlasmaJSON::computeAlpha ( const Real  E,
const RealVect  a_position 
) const
overridevirtual

Compute alpha. Should return Townsend ionization coefficient.

This function is mostly used for the cell tagging classes, but can be used for reactions as well.

Parameters
[in]a_EElectric field.

Implements Physics::CdrPlasma::CdrPlasmaPhysics.

◆ computeCdrDielectricFluxes()

Vector< Real > CdrPlasmaJSON::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
overridevirtual

Compute CDR fluxes on dielectric-gas interfaces. This is used as a boundary condition in the CDR equations.

Parameters
[in]a_timeTime
[in]a_posPosition
[in]a_normalNormal vector. This points into the gas phase.
[in]a_EElectric field
[in]a_cdrDensitiesCDR densities (on the EB)
[in]a_cdrVelocitiesNormal component of CDR velocities (on the EB).
[in]a_cdrGradientsNormal gradients of cdr densities
[in]a_rteFluxesRTE fluxes (normal component only)
[in]a_extrapCdrFluxesExtrapolated fluxes from the gas side.
Returns
Returns the flux on a dielectric interface cell. The vector ordering must be the same as m_cdrSpecies.

Implements Physics::CdrPlasma::CdrPlasmaPhysics.

◆ computeCdrDiffusionCoefficients()

Vector< Real > CdrPlasmaJSON::computeCdrDiffusionCoefficients ( const Real  a_time,
const RealVect  a_pos,
const RealVect  a_E,
const Vector< Real >  a_cdrDensities 
) const
overridevirtual

Compute diffusion coefficients for the CDR equations.

Parameters
[in]a_timeTime
[in]a_posPosition
[in]a_EElectric field
[in]a_cdrDensitiesCDR densities
Returns
Returns the diffusion coefficients for each CDR species. The vector ordering is the same as m_cdrSpecies.

Implements Physics::CdrPlasma::CdrPlasmaPhysics.

◆ computeCdrDomainFluxes()

Vector< Real > CdrPlasmaJSON::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
overridevirtual

Compute CDR fluxes through domain sides. This is used as a boundary condition in the CDR equations.

Parameters
[in]a_timeTime
[in]a_posPosition
[in]a_dirDirection (0 = x, 1=y etc)
[in]a_sideSide (low or high side)
[in]a_EElectric field
[in]a_cdrDensitiesCDR densities.
[in]a_cdrVelocitiesCDR velocities (normal component only).
[in]a_cdrGradientsCDR gradients (normal component only)
[in]a_rteFluxesRTE fluxes (normal component only)
[in]a_extrapCdrFluxesExtrapolated fluxes from the gas side.

Implements Physics::CdrPlasma::CdrPlasmaPhysics.

◆ computeCdrDriftVelocities()

Vector< RealVect > CdrPlasmaJSON::computeCdrDriftVelocities ( const Real  a_time,
const RealVect  a_pos,
const RealVect  a_E,
const Vector< Real >  a_cdrDensities 
) const
overridevirtual

Compute velocities for the CDR equations.

Parameters
[in]a_timeTime
[in]a_posPosition
[in]a_EElectric field
[in]a_cdrDensitiesCDR densities
Returns
Returns the drift velocities for each CDR species. The vector ordering is the same as m_cdrSpecies.

Implements Physics::CdrPlasma::CdrPlasmaPhysics.

◆ computeCdrElectrodeFluxes()

Vector< Real > CdrPlasmaJSON::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
overridevirtual

Compute CDR fluxes on electrode-gas interfaces. This is used as a boundary condition in the CDR equations.

Parameters
[in]a_timeTime
[in]a_posPosition
[in]a_normalBoundary normal vector. This points into the gas phase.
[in]a_EElectric field
[in]a_cdrVelocitiesCDR velocities. Normal component only.
[in]a_cdrDensitiesCDR densities.
[in]a_cdrGradientsNormal gradients of cdr densities
[in]a_rteFluxesRTE fluxes (normal component only)
[in]a_extrapCdrFluxesExtrapolated fluxes from the gas side.
Returns
Returns the flux on an electrode interface cell. The vector ordering must be the same as m_cdrSpecies.

Implements Physics::CdrPlasma::CdrPlasmaPhysics.

◆ computeEta()

Real CdrPlasmaJSON::computeEta ( const Real  a_E,
const RealVect  a_position 
) const
overridevirtual

Compute eta. Should return Townsend attachment coefficient.

This function is mostly used for the cell tagging classes, but can be used for reactions as well.

Parameters
[in]a_EElectric field.
[in]a_positionPosition

Implements Physics::CdrPlasma::CdrPlasmaPhysics.

◆ computePlasmaReactionRate()

Real CdrPlasmaJSON::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
protectedvirtual

Compute the reaction rate for a plasma reaction.

This routine exists because we need to compute the rates both in advanceReactionNetwork and getPlotVariables. This function reduces code duplication.

Parameters
[in]a_reactionIndexReaction index
[in]a_cdrDensitiesPlasma species densities.
[in]a_cdrMobilitiesPlasma species mobilities.
[in]a_cdrDiffusionCoefficientsPlasma species diffusion coefficients.
[in]a_cdrTemperaturesPlasma species temperatures.
[in]a_cdrEnergiesPlasma species energies.
[in]a_cdrGradientsPlasma species gradients.
[in]a_posPosition (physical coordinates)
[in]a_vectorEElectric field (vector)
[in]a_EElectric field magnitude (SI units)
[in]a_EtdElectric field magnitude (Townsend units)
[in]a_NNeutral density
[in]a_alphaTownsend ionization coefficient
[in]a_etaTownsend attachment coefficient
[in]a_timeTime

◆ computePlasmaSpeciesDiffusion()

std::vector< Real > CdrPlasmaJSON::computePlasmaSpeciesDiffusion ( const RealVect  a_position,
const RealVect  a_E,
const std::vector< Real >  a_cdrDensities 
) const
protectedvirtual

Compute the various plasma species diffusion coefficients.

Parameters
[in]a_positionPhysical coordinates
[in]a_EElectric field (SI units)
[in]a_cdrDensitiesList of plasma species densities
Returns
Returns the diffusion coefficients for each CDR species. The vector ordering is the same as m_cdrSpecies.

◆ computePlasmaSpeciesEnergies()

std::vector< Real > CdrPlasmaJSON::computePlasmaSpeciesEnergies ( const RealVect &  a_position,
const RealVect &  a_E,
const std::vector< Real > &  a_cdrDensities 
) const
protectedvirtual

Compute the various plasma species energies. Returns a list of energies in electron-volts. We assume that temperature-energy relations are e = 3/2 * kB * T.

If a transported species is associated with an energy solver the energy is computed from e = (n_eps)/ne. Otherwise, we compute the energy and returns 3/2 * kB * T.

Parameters
[in]a_positionPhysical coordinates
[in]a_EElectric field (SI units)
[in]a_cdrDensitiesList of plasma species densities.

◆ computePlasmaSpeciesMobilities()

std::vector< Real > CdrPlasmaJSON::computePlasmaSpeciesMobilities ( const RealVect &  a_position,
const RealVect &  a_E,
const std::vector< Real > &  a_cdrDensities 
) const
protectedvirtual

Compute the various plasma species mobilities.

Parameters
[in]a_positionPhysical coordinates
[in]a_EElectric field (SI units)
[in]a_cdrDensitiesList of plasma species densities.

◆ computePlasmaSpeciesTemperatures()

std::vector< Real > CdrPlasmaJSON::computePlasmaSpeciesTemperatures ( const RealVect &  a_position,
const RealVect &  a_E,
const std::vector< Real > &  a_cdrDensities 
) const
protectedvirtual

Compute the various plasma species temperatures.

Parameters
[in]a_positionPhysical coordinates
[in]a_EElectric field (SI units)
[in]a_cdrDensitiesList of plasma species densities.

◆ containsBracket()

bool CdrPlasmaJSON::containsBracket ( const std::string  a_str) const
protected

Protect all kinds of brackets in a string.

Parameters
[in]a_strInput string. If it contains any bracket we throw an error.

◆ containsWildcard()

bool CdrPlasmaJSON::containsWildcard ( const std::string  a_str) const
protected

Protect the @ character in a string.

Parameters
[in]a_strInput string. If it contains the at character we throw an error.

◆ doesFileExist()

bool CdrPlasmaJSON::doesFileExist ( const std::string  a_filename) const
protected

Check if file exists.

Parameters
[in]a_filenameFile name

◆ fillSourceTerms()

void CdrPlasmaJSON::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
protected

Routine for filling the source terms in the reactive problem.

Parameters
[out]a_cdrSourcesContains source term for CDR equations.
[out]a_rteSourcesContains source terms for RTE equations.
[in]a_cdrDensitiesCDR densities
[in]a_cdrGradientsCDR gradients at time a_time
[in]a_EElectric field
[in]a_posPhysical coordinates
[in]a_dxGrid resolution
[in]a_timeTime
[in]a_kappaVolume fraction

◆ getNumberOfPlotVariables()

int CdrPlasmaJSON::getNumberOfPlotVariables ( ) const
overridevirtual

Get number of plot variables for this physics class.

This is used by CdrPlasmaStepper for pre-allocating data that will be put in a plot file. The current implementation plots the gas pressure, temperature, and density

Reimplemented from Physics::CdrPlasma::CdrPlasmaPhysics.

◆ getPlotVariables()

Vector< Real > CdrPlasmaJSON::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
overridevirtual

Provide plot variables. This is used by CdrPlasmaStepper when writing plot files.

The plot variables should have length this->getNumberOfPlotVariables (as should getPlotVariableNames)

Parameters
[in]a_cdrDensitiesGrid-based density for particle species.
[in]a_cdrGradientsGrid-based gradients for particle species.
[in]a_rteDensitiesGrid-based densities for photons.
[in]a_EElectric field.
[in]a_posPosition in space.
[in]a_dxGrid resolution.
[in]a_dtAdvanced time.
[in]a_timeCurrent time.
[in]a_kappaGrid cell unit volume.

Reimplemented from Physics::CdrPlasma::CdrPlasmaPhysics.

◆ getReactionSpecies()

void CdrPlasmaJSON::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
protectedvirtual

Get the int-encoding corresponding to species involved in some reaction.

Parameters
[out]a_plasmaReactantsPlasma reactants
[out]a_neutralReactantsNeutral reactants
[out]a_photonReactantsPhoton reactants
[out]a_plasmaProductsPlasma products
[out]a_neutralProductsNeutral products
[out]a_photonProductsPhoton products
[in]a_reactantsReactant names
[in]a_productsReaction names

◆ initializePhotonSpecies()

void CdrPlasmaJSON::initializePhotonSpecies ( )
protectedvirtual

Initialize photon species.

This will initialize the radiative transfer species absed on the "photon_species" field in the JSON file.

◆ initializePlasmaSpecies()

void CdrPlasmaJSON::initializePlasmaSpecies ( )
protectedvirtual

Initialize species.

This will initialize the species based on the "plasma_species" field in the JSON file.

◆ initializeSigma()

void CdrPlasmaJSON::initializeSigma ( )
protectedvirtual

Initialize surface charge.

This will initialize the surface charge based on the "sigma" field in the JSON file. If you want more complex initial surface charges, you will have to either extend this routine or overwrite it.

◆ initialSigma()

Real CdrPlasmaJSON::initialSigma ( const Real  a_time,
const RealVect  a_pos 
) const
overridevirtual

Set the initial surface charge.

Parameters
[in]a_timeTime
[in]a_posPosition

Implements Physics::CdrPlasma::CdrPlasmaPhysics.

◆ integrateReactions()

void CdrPlasmaJSON::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
protectedvirtual

Routine for integrating the reactive-only problem using various algorithms.

Parameters
[in,out]a_cdrDensitiesOn input, contains n(t). On output it contains n(t+dt).
[out]a_photonProductionOn input, should be equal to zero. On output it will contain the number of photons produced during the time step.
[in]a_cdrGradientsCDR gradients at time a_time
[in]a_EElectric field
[in]a_posPhysical coordinates
[in]a_dxGrid resolution
[in]a_dtTime step
[in]a_kappaVolume fraction

◆ integrateReactionsExplicitEuler()

void CdrPlasmaJSON::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
protected

Routine for integrating the reactive-only problem using the explicit Euler rule.

Parameters
[in,out]a_cdrDensitiesOn input, contains n(t). On output it contains n(t+dt).
[out]a_photonProductionOn input, should be equal to zero. On output it will contain the number of photons produced during the time step.
[in]a_cdrGradientsCDR gradients at time a_time
[in]a_EElectric field
[in]a_posPhysical coordinates
[in]a_dxGrid resolution
[in]a_dtTime step
[in]a_timeTime
[in]a_kappaVolume fraction

◆ integrateReactionsExplicitRK2()

void CdrPlasmaJSON::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
protected

Routine for integrating the reactive-only problem using a second order Runge-Kutta method.

This includes the tableu through the a_tableuAlpha parameter.

Parameters
[in,out]a_cdrDensitiesOn input, contains n(t). On output it contains n(t+dt).
[out]a_photonProductionOn input, should be equal to zero. On output it will contain the number of photons produced during the time step.
[in]a_cdrGradientsCDR gradients at time a_time
[in]a_EElectric field
[in]a_posPhysical coordinates
[in]a_dxGrid resolution
[in]a_dtTime step
[in]a_timeTime
[in]a_kappaVolume fraction
[in]a_tableuAlphaRK2 tableu alpha. Use 0.5 for midpoint and 1.0 for trapezoidal (Heun's method)

◆ integrateReactionsExplicitRK4()

void CdrPlasmaJSON::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
protected

Routine for integrating the reactive-only problem using the foruth order Runge-Kutta method.

Parameters
[in,out]a_cdrDensitiesOn input, contains n(t). On output it contains n(t+dt).
[out]a_photonProductionOn input, should be equal to zero. On output it will contain the number of photons produced during the time step.
[in]a_cdrGradientsCDR gradients at time a_time
[in]a_EElectric field
[in]a_posPhysical coordinates
[in]a_dxGrid resolution
[in]a_dtTime step
[in]a_timeTime
[in]a_kappaVolume fraction

◆ integrateReactionsImplicitEuler()

void Physics::CdrPlasma::CdrPlasmaJSON::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
protected

Routine for integrating the reactive-only problem using the implicit Euler rule.

Parameters
[in,out]a_cdrDensitiesOn input, contains n(t). On output it contains n(t+dt).
[out]a_photonProductionOn input, should be equal to zero. On output it will contain the number of photons produced during the time step.
[in]a_cdrGradientsCDR gradients at time a_time
[in]a_EElectric field
[in]a_posPhysical coordinates
[in]a_dxGrid resolution
[in]a_dtTime step
[in]a_timeTime
[in]a_kappaVolume fraction

◆ isBracketed()

bool CdrPlasmaJSON::isBracketed ( const std::string  a_str) const
protected

Return true if string starts and ends with a paranthesis.

Parameters
[in]a_strInput string.
Returns
True if the first character in the string is ( and the last character is )

◆ isNeutralSpecies()

bool CdrPlasmaJSON::isNeutralSpecies ( const std::string &  a_name) const
protected

Return true if species exists in map and false otherwise.

Parameters
[in]a_nameNeutral species name

◆ isPhotonSpecies()

bool CdrPlasmaJSON::isPhotonSpecies ( const std::string &  a_name) const
protected

Return true if species exists in map and false otherwise.

Parameters
[in]a_nameRte species name

◆ isPlasmaSpecies()

bool CdrPlasmaJSON::isPlasmaSpecies ( const std::string &  a_name) const
protected

Return true if species exists in map and false otherwise.

Parameters
[in]a_nameCdr species name

◆ parseDielectricReactionEnergyLosses()

void CdrPlasmaJSON::parseDielectricReactionEnergyLosses ( const int  a_reactionIndex,
const json &  a_reactionJSON 
)
protectedvirtual

Parse dielectric-reaction energy losses.

Parameters
[in]a_reactionIndexReaction index.
[in]a_reactionJSONInput reaction. Must be one of the entries in the 'dielectric reactions' array.

◆ parseDielectricReactionRate()

void CdrPlasmaJSON::parseDielectricReactionRate ( const int  a_reactionIndex,
const json &  a_reactionJSON 
)
protectedvirtual

Parse reaction rate for dielectric surface reactions.

Parameters
[in]a_reactionIndexReaction index.
[in]a_reactionJSONInput reaction. Must be one of the entries in the 'electrode reactions' array.

◆ parseDielectricReactionScaling()

void CdrPlasmaJSON::parseDielectricReactionScaling ( const int  a_reactionIndex,
const json &  a_reactionJSON 
)
protectedvirtual

Parse dielectric electrode reaction scaling for a specific reaction.

This can be used to adjust for e.g. positional or field dependence.

Parameters
[in]a_reactionIndexReaction index (this is the array index in the dielectric reaction array supplied in the JSON file)
[in]a_reactionJSONJSON entry for the reaction in the JSON input file.

◆ parseDomainReactionRate()

void CdrPlasmaJSON::parseDomainReactionRate ( const int  a_reactionIndex,
const json &  a_reactionJSON,
const std::vector< std::string > &  a_sides 
)
protectedvirtual

Parse reaction rate for domain reactions.

Parameters
[in]a_reactionIndexReaction index.
[in]a_reactionJSONInput reaction. Must be one of the entries in the 'domain reactions' array.
[in]a_sidesList of the domain sides that this occurs at

◆ parseDomainReactionScaling()

void CdrPlasmaJSON::parseDomainReactionScaling ( const int  a_reactionIndex,
const json &  a_reactionJSON,
const std::vector< std::string > &  a_sides 
)
protectedvirtual

Parse domain reaction scaling for a specific reaction.

This can be used to adjust for e.g. positional or field dependence.

Parameters
[in]a_reactionIndexReaction index (this is the array index in the domain reaction array supplied in the JSON file)
[in]a_reactionJSONJSON entry for the reaction in the JSON input file.
[in]a_sidesList of the domain sides that this occurs at

◆ parseElectrodeReactionEnergyLosses()

void CdrPlasmaJSON::parseElectrodeReactionEnergyLosses ( const int  a_reactionIndex,
const json &  a_reactionJSON 
)
protectedvirtual

Parse electrode-reaction energy losses.

Parameters
[in]a_reactionIndexReaction index.
[in]a_reactionJSONInput reaction. Must be one of the entries in the 'electrode reactions' array.

◆ parseElectrodeReactionRate()

void CdrPlasmaJSON::parseElectrodeReactionRate ( const int  a_reactionIndex,
const json &  a_reactionJSON 
)
protectedvirtual

Parse reaction rate for electrode surface reactions.

Parameters
[in]a_reactionIndexReaction index.
[in]a_reactionJSONInput reaction. Must be one of the entries in the 'electrode reactions' array.

◆ parseElectrodeReactionScaling()

void CdrPlasmaJSON::parseElectrodeReactionScaling ( const int  a_reactionIndex,
const json &  a_reactionJSON 
)
protectedvirtual

Parse electrode reaction scaling for a specific reaction.

This can be used to adjust for e.g. positional or field dependence.

Parameters
[in]a_reactionIndexReaction index (this is the array index in the reaction array supplied in the JSON file)
[in]a_reactionJSONJSON entry for the reaction in the JSON input file.

◆ parsePhotoReactionEnergyLosses()

void CdrPlasmaJSON::parsePhotoReactionEnergyLosses ( const int  a_reactionIndex,
const json &  a_reactionJSON 
)
protectedvirtual

Parse photo-reaction energy losses.

Parameters
[in]a_reactionIndexReaction index.
[in]a_reactionJSONInput reaction. Must be one of the entries in the 'photo reactions' array.

◆ parsePhotoReactionScaling()

void CdrPlasmaJSON::parsePhotoReactionScaling ( const int  a_reactionIndex,
const json &  a_reactionJSON 
)
protectedvirtual

Parse scaling for photo-reactions. Includes Helmholtz corrections if doing Helmholtz reconstruction of photoionization profiles.

Parameters
[in]a_reactionIndexReaction index.
[in]a_reactionJSONInput reaction. Must be one of the entries in the 'photo reactions' array.

◆ parsePlasmaReactionDescription()

void CdrPlasmaJSON::parsePlasmaReactionDescription ( const int  a_reactionIndex,
const json &  a_reactionJSON,
const std::string  a_wildcard 
)
protectedvirtual

Parse plasma reaction descriptions.

Parameters
[in]a_reactionIndexReaction index.
[in]a_reactionJSONInput reaction. Must be one of the entries in the 'plasma reactions' array.

◆ parsePlasmaReactionEnergyLosses()

void CdrPlasmaJSON::parsePlasmaReactionEnergyLosses ( const int  a_reactionIndex,
const json &  a_reactionJSON 
)
protectedvirtual

Parse plasma reaction energy losses.

Parameters
[in]a_reactionIndexReaction index.
[in]a_reactionJSONInput reaction. Must be one of the entries in the 'plasma reactions' array.

◆ parsePlasmaReactionPlot()

void CdrPlasmaJSON::parsePlasmaReactionPlot ( const int  a_reactionIndex,
const json &  a_reactionJSON 
)
protectedvirtual

Parse reaction plotting.

Parameters
[in]a_reactionIndexReaction index.
[in]a_reactionJSONInput reaction. Must be one of the entries in the 'plasma reactions' array.

◆ parsePlasmaReactionRate()

void CdrPlasmaJSON::parsePlasmaReactionRate ( const int  a_reactionIndex,
const json &  a_reactionJSON 
)
protectedvirtual

Parse reaction rate for plasma reaction.

Parameters
[in]a_reactionIndexReaction index.
[in]a_reactionJSONInput reaction. Must be one of the entries in the 'plasma reactions' array.

Add the rate and lookup method.

◆ parsePlasmaReactionScaling()

void CdrPlasmaJSON::parsePlasmaReactionScaling ( const int  a_reactionIndex,
const json &  a_reactionJSON 
)
protectedvirtual

Parse scaling factors for reactions.

Parameters
[in]a_reactionIndexReaction index.
[in]a_reactionJSONInput reaction. Must be one of the entries in the 'plasma reactions' array.

◆ parsePlasmaReactionSoloviev()

void CdrPlasmaJSON::parsePlasmaReactionSoloviev ( const int  a_reactionIndex,
const json &  a_reactionJSON 
)
protectedvirtual

Parse plasma reaction energy correction.

Parameters
[in]a_reactionIndexReaction index.
[in]a_reactionJSONInput reaction. Must be one of the entries in the 'plasma reactions' array.

◆ parsePlasmaSpeciesInitialData()

CdrPlasmaJSON::InitialDataFunction CdrPlasmaJSON::parsePlasmaSpeciesInitialData ( const json &  a_json) const
protectedvirtual

Generate an initial data function for a given plasma species.

Parameters
[in]a_jsonJSON field, usually (always?) describing one of the objects in the 'plasma species' field.

◆ parsePlasmaSpeciesInitialParticles()

List< PointParticle > CdrPlasmaJSON::parsePlasmaSpeciesInitialParticles ( const json &  a_json) const
protectedvirtual

Generate initial particles for a given plasma species.

Parameters
[in]a_jsonJSON field, usually (always?) describing one of the objects in the 'plasma species' field.

◆ parseReactionString()

void CdrPlasmaJSON::parseReactionString ( std::vector< std::string > &  a_reactants,
std::vector< std::string > &  a_products,
const std::string &  a_reaction 
) const
protectedvirtual

Parses a reaction string into reactangs and products.

Parameters
[out]a_reactantsLeft-hand side of reaction
[out]a_productsRight-hand side of reaction
[in]a_reactionReaction string. Must be in format "a + b + c -> e + f + g".

◆ parseReactionWildcards()

std::list< std::tuple< std::string, std::vector< std::string >, std::vector< std::string > > > CdrPlasmaJSON::parseReactionWildcards ( const std::vector< std::string > &  a_reactants,
const std::vector< std::string > &  a_products,
const json &  a_reaction 
)
protectedvirtual

Make a reaction set into a superset. This parses wildcards '@' in reaction string.

Parameters
[in]a_reactantsList of reactants. Can contain wildcard.
[in]a_productsList of products. Can contain wildcard.
[in]a_reactionJSON reaction entry.
Returns
Returns a list of reactants and products with wilcards replaced. The tuple entries are: <wildcard, reactants, products>

◆ sanctifyPhotoReaction()

void CdrPlasmaJSON::sanctifyPhotoReaction ( const std::vector< std::string > &  a_reactants,
const std::vector< std::string > &  a_products,
const std::string  a_reaction 
) const
protectedvirtual

Check if a photo-reaction makes sense in terms of the species that have been defined.

This will throw errors if the species do not exist or charge is not conserved.

Parameters
[in]a_reactantsReactants
[in]a_productsReaction products
[in]a_reactionReaction string

◆ sanctifyPlasmaReaction()

void CdrPlasmaJSON::sanctifyPlasmaReaction ( const std::vector< std::string > &  a_reactants,
const std::vector< std::string > &  a_products,
const std::string  a_reaction 
) const
protectedvirtual

Check if a plasma-reaction makes sense in terms of the species that have been defined.

This will throw errors if the species do not exist or charge is not conserved.

Parameters
[in]a_reactantsReactants
[in]a_productsReaction products
[in]a_reactionReaction string

◆ sanctifySurfaceReaction()

void CdrPlasmaJSON::sanctifySurfaceReaction ( const std::vector< std::string > &  a_reactants,
const std::vector< std::string > &  a_products,
const std::string  a_reaction 
) const
protectedvirtual

Check if a surface-reaction makes sense in terms of the species that have been defined.

Parameters
[in]a_reactantsReactants
[in]a_productsReaction products
[in]a_reactionReaction string

◆ sanityCheckSpecies()

void CdrPlasmaJSON::sanityCheckSpecies ( ) const
protectedvirtual

Do a species sanity check.

This will make sure that species names are not duplicates.

◆ throwParserError()

void CdrPlasmaJSON::throwParserError ( const std::string  a_error) const
protected

Throw a parser error.

Parameters
[in]a_errorError code.

◆ throwParserWarning()

void CdrPlasmaJSON::throwParserWarning ( const std::string  a_warning) const
protected

Throw a parser wearning.

Parameters
[in]a_errorWarning

Member Data Documentation

◆ m_cdrEnergyComputation

std::map<int, std::tuple<Real, Real, Real> > Physics::CdrPlasma::CdrPlasmaJSON::m_cdrEnergyComputation
protected

Parameters for computing the mean energy from energy density and density.

The energy is computed as e = max(Emin, min(Emax, E)) where E = n_energy/(min(n_density, safety));

◆ m_cdrMasses

std::map<int, Real> Physics::CdrPlasma::CdrPlasmaJSON::m_cdrMasses
protected

Map of the species masses. This is needed for imposing BCs on the energy equations.

This is populated in initializePlasmaSpecies.

◆ m_cdrSpeciesInverseMap

std::map<int, std::string> Physics::CdrPlasma::CdrPlasmaJSON::m_cdrSpeciesInverseMap
protected

int-string encoding of the CDR species.

This is needed because we sometimes need to use the species name for indexing in the vector.

Note
This is the inverse of m_cdrSpeciesMap

◆ m_cdrSpeciesMap

std::map<std::string, int> Physics::CdrPlasma::CdrPlasmaJSON::m_cdrSpeciesMap
protected

string-int encoding of the CDr species.

This is needed because we sometimes need to use the species name for indexing in the vector.

◆ m_cdrTransportEnergyMap

std::map<int, int> Physics::CdrPlasma::CdrPlasmaJSON::m_cdrTransportEnergyMap
protected

int-int encoding for associating a transport solver with an energy solver.

This is only defined for the species that has/is an energy solver. The first index is the transport solver index and the second index is the energy solver index.

◆ m_dielectricReactionEnergyLosses

std::map<int, std::list<std::pair<int, Real> > > Physics::CdrPlasma::CdrPlasmaJSON::m_dielectricReactionEnergyLosses
protected

Associated energy losses for a surface reaction on dielectrics.

The list is a list of species and the corresponding energy losses for a reaction. Note that although we write 'loss', this can also be an energy 'gain'.

◆ m_diffusionTablesEN

std::map<int, LookupTable1D<Real, 1> > Physics::CdrPlasma::CdrPlasmaJSON::m_diffusionTablesEN
protected

Map for table-based diffusion coefficients D = D(E,N).

Tables stored as (E/N, D*N)

◆ m_diffusionTablesEnergy

std::map<int, LookupTable1D<Real, 1> > Physics::CdrPlasma::CdrPlasmaJSON::m_diffusionTablesEnergy
protected

Map for table-based diffusion coefficients as function of energy.

Stored as tables (eV, D*N)

◆ m_domainExtrapBC

std::map<std::tuple<int, Side::LoHiSide, int>, bool> Physics::CdrPlasma::CdrPlasmaJSON::m_domainExtrapBC
protected

A container which determines if we should add the extrapolated flux as an inflow condition.

The first entry in the map is the species integer index. The tuple indicates (coordinate_direction, side, doExtrap).

◆ m_electrodeReactionEnergyLosses

std::map<int, std::list<std::pair<int, Real> > > Physics::CdrPlasma::CdrPlasmaJSON::m_electrodeReactionEnergyLosses
protected

Associated energy losses for a surface reaction on electrodes.

The list is a list of species and the corresponding energy losses for a reaction. Note that although we write 'loss', this can also be an energy 'gain'.

◆ m_mobilityTablesEnergy

std::map<int, LookupTable1D<Real, 1> > Physics::CdrPlasma::CdrPlasmaJSON::m_mobilityTablesEnergy
protected

Map for table-based mobilities as function of energy.

Stored as tables (eV, mu*N)

◆ m_photoReactionEnergyLosses

std::map<int, std::list<std::pair<int, Real> > > Physics::CdrPlasma::CdrPlasmaJSON::m_photoReactionEnergyLosses
protected

Associated energy losses for a photo-reaction.

The list is a list of species and the corresponding energy losses for a reaction. Note that although we write 'loss', this can also be an energy 'gain'.

◆ m_plasmaReactionEnergyLosses

std::map<int, std::map<int, std::pair<ReactiveEnergyLoss, Real> > > Physics::CdrPlasma::CdrPlasmaJSON::m_plasmaReactionEnergyLosses
protected

For mapping reactive energy losses for all reactions.

The index in the first map is the reaction (i.e., index in m_plasmaReactions). The second map determines how reactive energy losses/gains are computed for each species. The first index in the second map indicates the species which will add/lose energy, and the std::pair indicates how this loss is computed.

◆ m_plasmaReactionFunctionsT

std::map<int, std::pair<int, FunctionT> > Physics::CdrPlasma::CdrPlasmaJSON::m_plasmaReactionFunctionsT
protected

Maps for functions of the type k = f(T) where T is the temperature of some species.

In the tuple the first index in the pair indicates the species we are talking about here. A special rule is enforced when this index is < 0 in which case the temperature is replaced by the background gas temperature.

◆ m_plasmaReactionFunctionsTT

std::map<int, std::tuple<int, int, FunctionTT> > Physics::CdrPlasma::CdrPlasmaJSON::m_plasmaReactionFunctionsTT
protected

Maps for functions of the type k = f(T1,T2) where T1 and T2 are the temperatures of some species.

This signature is absolute horrific – what it means is that we have a reaction which should be evaluated as f(T1, T2), but we need to know which species are involved. By design, this should be general so that T1 and T2 can be the temperatures of any species, including neutral species. So, we make a tuple for indicating which species we are talking about. The first index in the tuple is the first species, the second is the second species and the third entry in the tuple is the actual function. A special rule occurs if one of the first two indices is < 0 in which case the temperature is replaced by the background gas temperature.

◆ m_plasmaReactionSolovievCorrection

std::map<int, std::pair<bool, int> > Physics::CdrPlasma::CdrPlasmaJSON::m_plasmaReactionSolovievCorrection
protected

Flag for whether or not reaction includes Soloviev energy correction.

If this is true, the rate for a reaction (in the local field approximation) will be modified as k * (1 + E.(D * grad(phi))/n *

◆ m_plasmaReactionTablesEnergy

std::map<int, std::pair<int, LookupTable1D<Real, 1> > > Physics::CdrPlasma::CdrPlasmaJSON::m_plasmaReactionTablesEnergy
protected

Map for table-based reaction coefficients where k = k(energy).

The first index is the reaction index, while the pair describes which species energy and the tabulated data.

◆ m_rteSpeciesInverseMap

std::map<int, std::string> Physics::CdrPlasma::CdrPlasmaJSON::m_rteSpeciesInverseMap
protected

int-string encoding of the RTE species.

This is needed because we sometimes need to use the species name for indexing in the vector.

Note
This is the inverse of m_rteSpeciesMap

◆ m_rteSpeciesMap

std::map<std::string, int> Physics::CdrPlasma::CdrPlasmaJSON::m_rteSpeciesMap
protected

string-int encoding of the RTE species.

This is needed because we sometimes need to use the species name for indexing in the vector.


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