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).")
71 "An array of first order chemical reactions.")
73 "Numerical solver for the system of first order ordinary differential equations coming from the model.")
78 Input::register_class< FirstOrderReaction, Mesh &, Input::Record >(
"FirstOrderReaction") +
95 unsigned int reactant_index, product_index;
97 for (
unsigned int i_reaction = 0; i_reaction <
reaction_rates_.size(); i_reaction++) {
102 for (
unsigned int i_product = 1; i_product <
substance_ids_[i_reaction].size(); ++i_product){
122 react_it != reactions_array.
end(); ++react_it, ++i_reaction)
135 if(reactant_array.size() != 1)
136 xprintf(
UsrErr,
"More than one reactant is not available at the moment.");
141 string reactant_name = reactant_it->val<
string>(
"name");
145 else THROW(ReactionTerm::ExcUnknownSubstance()
146 << ReactionTerm::EI_Substance(reactant_name)
147 << (*reactant_it).ei_address());
151 unsigned int i_product = 0;
153 product_it != product_array.end(); ++product_it, i_product++)
155 string product_name = product_it->val<
string>(
"name");
159 else THROW(ReactionTerm::ExcUnknownSubstance()
160 << ReactionTerm::EI_Substance(product_name)
161 << product_array.ei_address());
163 bifurcation_[i_reaction][i_product] = product_it->val<
double>(
"branching_ratio");
static Input::Type::Abstract & get_input_type()
SubstanceList substances_
Names belonging to substances.
unsigned int find_subst_name(const std::string &name)
Base class for linear reactions and decay chain.
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 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.
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_