11 =
Record(
"FirstOrderReactionReactant",
"A record describing a reactant of a reaction.")
14 "The name of the reactant.")
19 =
Record(
"FirstOrderReactionProduct",
"A record describing a product of a reaction.")
22 "The name of the product.")
25 "The branching ratio of the product when there are more products.\n"
26 "The value must be positive. Further, the branching ratios of all products are normalized "
27 "in order to sum to one.\n"
28 "The default value 1.0, should only be used in the case of single product.");
31 =
Record(
"Reaction",
"Describes a single first order chemical reaction.")
33 "An array of reactants. Do not use array, reactions with only one reactant (decays) are implemented at the moment!")
35 "The reaction rate coefficient of the first order reaction.")
37 "An array of products.")
42 =
Record(
"FirstOrderReaction",
"A model of first order chemical reactions (decompositions of a reactant into products).")
45 "An array of first order chemical reactions.")
47 "Numerical solver for the system of first order ordinary differential equations coming from the model.");
63 unsigned int reactant_index, product_index;
65 for (
unsigned int i_reaction = 0; i_reaction <
reaction_rates_.size(); i_reaction++) {
70 for (
unsigned int i_product = 1; i_product <
substance_ids_[i_reaction].size(); ++i_product){
90 react_it != reactions_array.
end(); ++react_it, ++i_reaction)
103 if(reactant_array.size() != 1)
104 xprintf(
UsrErr,
"More than one reactant is not available at the moment.");
109 string reactant_name = reactant_it->val<
string>(
"name");
113 else THROW(ReactionTerm::ExcUnknownSubstance()
114 << ReactionTerm::EI_Substance(reactant_name)
115 << (*reactant_it).ei_address());
119 unsigned int i_product = 0;
121 product_it != product_array.end(); ++product_it, i_product++)
123 string product_name = product_it->val<
string>(
"name");
127 else THROW(ReactionTerm::ExcUnknownSubstance()
128 << ReactionTerm::EI_Substance(product_name)
129 << product_array.ei_address());
131 bifurcation_[i_reaction][i_product] = product_it->val<
double>(
"branching_ratio");
static Input::Type::Record input_type_reactant
Input record for a reactant of a reaction.
SubstanceList substances_
Names belonging to substances.
static Input::Type::AbstractRecord input_type
unsigned int find_subst_name(const std::string &name)
Base class for linear reactions and decay chain.
static Input::Type::Record input_type
Input record for class FirstOrderReaction.
unsigned int size() const
~FirstOrderReaction(void)
Destructor.
static Input::Type::AbstractRecord input_type
static Input::Type::Record input_type_single_reaction
Input record which defines particular reaction.
Global macros to enhance readability and debugging, general constants.
arma::mat reaction_matrix_
Reaction matrix.
static Input::Type::Record input_type_product
Input record for a product of a reaction.
void initialize_from_input() override
Initializes private members of sorption from the input record.
Input::Record input_record_
FirstOrderReaction(Mesh &init_mesh, Input::Record in_rec)
Constructor.
std::vector< std::vector< unsigned int > > substance_ids_
unsigned int n_substances_
Number of all transported substances. It is the dimension of the reaction matrix. ...
std::vector< double > reaction_rates_
Vector of reaction rates of the transported substances.
#define THROW(whole_exception_expr)
Wrapper for throw. Saves the throwing point.
void assemble_ode_matrix(void) override
Implements the assembly of the system matrix of the ODEs.
std::vector< std::vector< double > > bifurcation_