11 using namespace Input::Type;
14 =
Record(
"RadioactiveDecayProduct",
"A record describing a product of a radioactive decay.")
17 "The name of the product.")
19 "Not used at the moment! The released energy in MeV from the decay of the radionuclide into the product.")
21 "The branching ratio of the product when there is more than one."
22 "Considering only one product, the default ratio 1.0 is used."
23 "Its value must be positive. Further, the branching ratios of all products are normalized"
24 "by their sum, so the sum then gives 1.0 (this also resolves possible rounding errors).");
27 =
Record(
"Decay",
"A model of a radioactive decay.")
29 "The name of the parent radionuclide.")
31 "The half life of the parent radionuclide in seconds.")
33 "An array of the decay products (daughters).");
36 =
Record(
"RadioactiveDecay",
"A model of a radioactive decay and possibly of a decay chain.")
39 "An array of radioactive decays.")
41 "Numerical solver for the system of first order ordinary differential equations coming from the model.");
66 dec_it != decay_array.
end(); ++dec_it, ++i_decay)
69 half_lives_[i_decay] = dec_it->val<
double>(
"half_life");
72 string radionuclide = dec_it->val<
string>(
"radionuclide");
81 unsigned int i_product = 0;
83 prod_it != product_array.end(); ++prod_it, ++i_product)
85 string product_name = prod_it->val<
string>(
"name");
89 else THROW(ReactionTerm::ExcUnknownSubstance()
90 << ReactionTerm::EI_Substance(product_name)
91 << (*prod_it).ei_address());
93 bifurcation_[i_decay][i_product] = prod_it->val<
double>(
"branching_ratio");
100 else THROW(ReactionTerm::ExcUnknownSubstance()
101 << ReactionTerm::EI_Substance(radionuclide)
102 << (*dec_it).ei_address());
120 unsigned int reactant_index, product_index;
122 for (
unsigned int i_decay = 0; i_decay <
half_lives_.size(); i_decay++) {
127 for (
unsigned int i_product = 1; i_product <
substance_ids_[i_decay].size(); ++i_product){
void assemble_ode_matrix(void) override
Implements the assembly of the system matrix of the ODEs.
SubstanceList substances_
Names belonging to substances.
static Input::Type::AbstractRecord input_type
~RadioactiveDecay(void)
Destructor.
unsigned int find_subst_name(const std::string &name)
Base class for linear reactions and decay chain.
unsigned int size() const
void initialize_from_input() override
Initializes private members of sorption from the input record.
static Input::Type::AbstractRecord input_type
Global macros to enhance readability and debugging, general constants.
arma::mat reaction_matrix_
Reaction matrix.
static Input::Type::Record input_type_single_decay
Input record which defines particular decay step.
static Input::Type::Record input_type_product
Input record for a product of a radioactive decay.
Input::Record input_record_
std::vector< double > half_lives_
Half-lives of the substances.
static Input::Type::Record input_type
Input record for class RadioactiveDecay.
std::vector< std::vector< unsigned int > > substance_ids_
RadioactiveDecay(Mesh &mesh, Input::Record in_rec)
Constructor.
unsigned int n_substances_
Number of all transported substances. It is the dimension of the reaction matrix. ...
#define THROW(whole_exception_expr)
Wrapper for throw. Saves the throwing point.
std::vector< std::vector< double > > bifurcation_