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.")
79 Input::register_class< FirstOrderReaction, Mesh &, Input::Record >(
"FirstOrderReaction") +
96 unsigned int reactant_index, product_index;
98 for (
unsigned int i_reaction = 0; i_reaction <
reaction_rates_.size(); i_reaction++) {
103 for (
unsigned int i_product = 1; i_product <
substance_ids_[i_reaction].size(); ++i_product){
123 react_it != reactions_array.
end(); ++react_it, ++i_reaction)
136 if(reactant_array.size() != 1)
137 THROW( ExcTooManyReactants() );
142 string reactant_name = reactant_it->val<
string>(
"name");
144 if (idx < eq_data_base_->substances_.size())
146 else THROW(ReactionTerm::ExcUnknownSubstance()
147 << ReactionTerm::EI_Substance(reactant_name)
148 << (*reactant_it).ei_address());
152 unsigned int i_product = 0;
154 product_it != product_array.end(); ++product_it, i_product++)
156 string product_name = product_it->val<
string>(
"name");
158 if (idx < eq_data_base_->substances_.size())
160 else THROW(ReactionTerm::ExcUnknownSubstance()
161 << ReactionTerm::EI_Substance(product_name)
162 << product_array.ei_address());
164 bifurcation_[i_reaction][i_product] = product_it->val<
double>(
"branching_ratio");
Input::Record input_record_
Base class for linear reactions and decay chain.
unsigned int n_substances_
Number of all transported substances. It is the dimension of the reaction matrix.
std::vector< std::vector< unsigned int > > substance_ids_
arma::mat reaction_matrix_
Reaction matrix.
std::vector< std::vector< double > > bifurcation_
unsigned int find_subst_name(const std::string &name)
static const Input::Type::Record & get_input_type_product()
Input record for a product of a reaction.
static const Input::Type::Record & get_input_type_single_reaction()
Input record which defines particular reaction.
static const Input::Type::Record & get_input_type()
Input record for class FirstOrderReaction.
~FirstOrderReaction(void)
Destructor.
void initialize_from_input() override
Initializes private members of sorption from the input record.
static const int registrar
Registrar of class to factory.
std::vector< double > reaction_rates_
Vector of reaction rates of the transported substances.
FirstOrderReaction(Mesh &init_mesh, Input::Record in_rec)
Constructor.
void assemble_ode_matrix(void) override
Implements the assembly of the system matrix of the ODEs.
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 Input::Type::Abstract & it_abstract_term()
static Input::Type::Abstract & it_abstract_reaction()
static Input::Type::Abstract & it_abstract_mobile_term()
Global macros to enhance readability and debugging, general constants.
#define FLOW123D_FORCE_LINK_IN_CHILD(x)
#define THROW(whole_exception_expr)
Wrapper for throw. Saves the throwing point.
Class ReactionTerm is an abstract class representing reaction term in transport.