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 |
Stores all of the data needed to perform calculations with a specific 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 = " " ) |
rxn_input | the block of the input file that holds the data for a reaction |
rxn_id | an id number for the reaction |
data_path | the folder where the reaction will search for a data file if it is requested |
bib_file | the file which holds the reference data for this reaction |
check_refs | whether or not this reaction will verify that the references provided actually exist. The will never be false in real use |
read_xsec_files | whether or not this reaction will actually collect the data from the provided file. This will will never be false in real use |
delimiter | the delimieter that seperates the columns in the data file |
InvalidReaction | if the user has provided a file where to find data and parameters for functional data |
InvalidReaction | if the user does not provide a file and does not provide function parameters |
InvalidReaction | if the user provides changes in energy for an elastic reaction |
InvalidReaction | if the first parameter in a functional form is zero (this is because we are only supporting arrhenius forms now) |
InvalidReaction | if the user provides a data file and the first column has data that is not in sorted order |
InvalidReaction | if the user has extra unused parameters in an input block |
const vector< double > & prism::Reaction::functionParams | ( | ) | const |
Returns a reference to the function parameters if there is functional data.
invalid_argument | if this method is called on a reaction for which tabulated data was provided |
int prism::Reaction::getStoicCoeffById | ( | const SpeciesId | id | ) | const |
Get the stoiciometric coefficient for a species in this reaction by its id.
id | the species id |
invalid_argument | if the coefficient for a species that does not exist in this reaction requested |
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".
s_expression | the string that represents the species |
invalid_argument | if the coefficient for a species that does not exist in this reaction requested |
|
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.
T_e | the electron temperature |
T_g | the gas temperature |
const std::vector< TabulatedReactionData > & prism::Reaction::tabulatedData | ( | ) | const |
Retrurns a reference to the struct containing data read from a file.
invalid_argument | if this method is called on a reaction that has a functional parameters provided |