30 using namespace
Input::Type;
33 return Record(
"FirstOrderReactionReactant",
"A record describing a reactant of a reaction.")
36 "The name of the reactant.")
42 return Record(
"FirstOrderReactionProduct",
"A record describing a product of a reaction.")
45 "The name of the product.")
48 "The branching ratio of the product when there are more products.\n" 49 "The value must be positive. Further, the branching ratios of all products are normalized " 50 "in order to sum to one.\n" 51 "The default value 1.0, should only be used in the case of single product.")
56 return Record(
"Reaction",
"Describes a single first order chemical reaction.")
58 "An array of reactants. Do not use array, reactions with only one reactant (decays) are implemented at the moment!")
60 "The reaction rate coefficient of the first order reaction.")
62 "An array of products.")
68 return Record(
"FirstOrderReaction",
"A model of first order chemical reactions (decompositions of a reactant into products).")
74 "An array of first order chemical reactions.")
76 "Numerical solver for the system of first order ordinary differential equations coming from the model.")
81 Input::register_class< FirstOrderReaction, Mesh &, Input::Record >(
"FirstOrderReaction") +
98 unsigned int reactant_index, product_index;
100 for (
unsigned int i_reaction = 0; i_reaction <
reaction_rates_.size(); i_reaction++) {
105 for (
unsigned int i_product = 1; i_product <
substance_ids_[i_reaction].size(); ++i_product){
125 react_it != reactions_array.
end(); ++react_it, ++i_reaction)
138 if(reactant_array.size() != 1)
139 xprintf(
UsrErr,
"More than one reactant is not available at the moment.");
144 string reactant_name = reactant_it->val<
string>(
"name");
148 else THROW(ReactionTerm::ExcUnknownSubstance()
149 << ReactionTerm::EI_Substance(reactant_name)
150 << (*reactant_it).ei_address());
154 unsigned int i_product = 0;
156 product_it != product_array.end(); ++product_it, i_product++)
158 string product_name = product_it->val<
string>(
"name");
162 else THROW(ReactionTerm::ExcUnknownSubstance()
163 << ReactionTerm::EI_Substance(product_name)
164 << product_array.ei_address());
166 bifurcation_[i_reaction][i_product] = product_it->val<
double>(
"branching_ratio");
SubstanceList substances_
Names belonging to substances.
unsigned int find_subst_name(const std::string &name)
Base class for linear reactions and decay chain.
static Input::Type::Abstract & it_abstract_mobile_term()
static Input::Type::Abstract & it_abstract_reaction()
unsigned int size() const
Class ReactionTerm is an abstract class representing reaction term in transport.
~FirstOrderReaction(void)
Destructor.
Global macros to enhance readability and debugging, general constants.
arma::mat reaction_matrix_
Reaction matrix.
static const Input::Type::Record & get_input_type()
static const Input::Type::Record & get_input_type_reactant()
Input record for a reactant of a reaction.
static Input::Type::Abstract & it_abstract_immobile_term()
static const Input::Type::Record & get_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.
static Input::Type::Abstract & it_abstract_term()
Input::Record input_record_
static const Input::Type::Record & get_input_type()
Input record for class FirstOrderReaction.
static const Input::Type::Record & get_input_type_single_reaction()
Input record which defines particular reaction.
FirstOrderReaction(Mesh &init_mesh, Input::Record in_rec)
Constructor.
static const int registrar
Registrar of class to factory.
std::vector< std::vector< unsigned int > > substance_ids_
Class implements the linear reactions.
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.
#define FLOW123D_FORCE_LINK_IN_CHILD(x)
std::vector< std::vector< double > > bifurcation_