PRISM
 v0.0.0
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
prism::Reaction Class Reference

Stores all of the data needed to perform calculations with a specific reaction. More...

#include <Reaction.h>

Public Member Functions

 Reaction (const YAML::Node &rxn_input, const int rxn_id=0, const std::string &data_path="", const std::string &bib_file="", const bool check_refs=true, const bool read_xsec_files=true, const std::string &delimiter=" ")
 
const std::string & expression () const
 Self descriptive getter method.
 
const std::string & latexRepresentation () const
 Self descriptive getter method.
 
ReactionId id () const
 Self descriptive getter method note that Reactions ids are based on the block reactions are in all reaction ids are between 0 and n-1 where n is the number of reactions in the reaction block this allows quick access into vectors provided by the network parser object.
 
const std::vector< std::string > & references () const
 Self descriptive getter method.
 
const std::vector< std::string > & notes () const
 Self descriptive getter method.
 
bool hasTabulatedData () const
 Self descriptive getter method.
 
double deltaEnergyElectron () const
 Self descriptive getter method.
 
double deltaEnergyGas () const
 Self descriptive getter method.
 
const std::vector< SpeciesData > & reactantData () const
 Self descriptive getter method.
 
const std::vector< SpeciesData > & productData () const
 Self descriptive getter method.
 
bool isElastic () const
 Wether or not the user set a reaction as elastic or not.
 
const std::vector< std::shared_ptr< const Species > > species () const
 Getter method for the list of species in this reaction this is a relatively expensive method and calls to this should be minimized.
 
const std::string getReferencesAsString () const
 Getter method for getting cite keys formatted for LaTeX.
 
const std::vector< double > & functionParams () const
 Returns a reference to the function parameters if there is functional data.
 
const std::vector< TabulatedReactionData > & tabulatedData () const
 Retrurns a reference to the struct containing data read from a file.
 
int getStoicCoeffByName (const std::string &s_expression) const
 Get the stoiciometric coefficient for a species in this reaction by the name that represents it Ex: "Ar".
 
int getStoicCoeffById (const SpeciesId id) const
 Get the stoiciometric coefficient for a species in this reaction by its id.
 
bool operator== (const Reaction &other) const
 equality operator override and compares the reaction name the latex name of the reaction and the reaction number is the same
 
bool operator!= (const Reaction &other) const
 returns not == operator overload
 
double sampleData (const double T_e, const double T_g=0) const
 Samples data at the point T_e and T_g based on the provided parameters If the reaction object has tabulated data then the second parameter is ignored and a simple linear interpolation is utilized The function that this calls is based on the number parameters provided in the reaction input block.
 

Friends

class SpeciesFactory
 SpeciesFactor is a friend so that it can access the species in this reaction.
 
class NetworkParser
 

Detailed Description

Stores all of the data needed to perform calculations with a specific reaction.

Constructor & Destructor Documentation

◆ Reaction()

prism::Reaction::Reaction ( const YAML::Node & rxn_input,
const int rxn_id = 0,
const std::string & data_path = "",
const std::string & bib_file = "",
const bool check_refs = true,
const bool read_xsec_files = true,
const std::string & delimiter = " " )
Parameters
rxn_inputthe block of the input file that holds the data for a reaction
rxn_idan id number for the reaction
data_paththe folder where the reaction will search for a data file if it is requested
bib_filethe file which holds the reference data for this reaction
check_refswhether or not this reaction will verify that the references provided actually exist. The will never be false in real use
read_xsec_fileswhether or not this reaction will actually collect the data from the provided file. This will will never be false in real use
delimiterthe delimieter that seperates the columns in the data file
Exceptions
InvalidReactionif the user has provided a file where to find data and parameters for functional data
InvalidReactionif the user does not provide a file and does not provide function parameters
InvalidReactionif the user provides changes in energy for an elastic reaction
InvalidReactionif the first parameter in a functional form is zero (this is because we are only supporting arrhenius forms now)
InvalidReactionif the user provides a data file and the first column has data that is not in sorted order
InvalidReactionif the user has extra unused parameters in an input block

Member Function Documentation

◆ functionParams()

const vector< double > & prism::Reaction::functionParams ( ) const

Returns a reference to the function parameters if there is functional data.

Exceptions
invalid_argumentif this method is called on a reaction for which tabulated data was provided

◆ getStoicCoeffById()

int prism::Reaction::getStoicCoeffById ( const SpeciesId id) const

Get the stoiciometric coefficient for a species in this reaction by its id.

Parameters
idthe species id
Exceptions
invalid_argumentif the coefficient for a species that does not exist in this reaction requested

◆ getStoicCoeffByName()

int prism::Reaction::getStoicCoeffByName ( const std::string & s_expression) const

Get the stoiciometric coefficient for a species in this reaction by the name that represents it Ex: "Ar".

Parameters
s_expressionthe string that represents the species
Exceptions
invalid_argumentif the coefficient for a species that does not exist in this reaction requested

◆ sampleData()

double prism::Reaction::sampleData ( const double T_e,
const double T_g = 0 ) const
inline

Samples data at the point T_e and T_g based on the provided parameters If the reaction object has tabulated data then the second parameter is ignored and a simple linear interpolation is utilized The function that this calls is based on the number parameters provided in the reaction input block.

Parameters
T_ethe electron temperature
T_gthe gas temperature

◆ tabulatedData()

const std::vector< TabulatedReactionData > & prism::Reaction::tabulatedData ( ) const

Retrurns a reference to the struct containing data read from a file.

Exceptions
invalid_argumentif this method is called on a reaction that has a functional parameters provided

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