OGS
ChemistryLib::SelfContainedSolverData Namespace Reference

Classes

struct  ChemicalReaction
 
struct  FirstOrderReaction
 First-order reaction. More...
 
class  SelfContainedSolver
 

Functions

std::vector< std::unique_ptr< ChemicalReaction > > createChemicalReactionData (BaseLib::ConfigTree const &config)
 

Function Documentation

◆ createChemicalReactionData()

std::vector< std::unique_ptr< ChemicalReaction > > ChemistryLib::SelfContainedSolverData::createChemicalReactionData ( BaseLib::ConfigTree const & config)
Input File Parameter
prj__chemical_system__chemical_reactions__chemical_reaction
Input File Parameter
prj__chemical_system__chemical_reactions__chemical_reaction__stoichiometric_coefficients
Input File Parameter
prj__chemical_system__chemical_reactions__chemical_reaction__reaction_type
Input File Parameter
prj__chemical_system__chemical_reactions__chemical_reaction__first_order_rate_constant

Definition at line 22 of file CreateChemicalReactionData.cpp.

24{
25 std::vector<std::unique_ptr<ChemicalReaction>> chemical_reactions;
26
27 for (
28 auto const& reaction_config :
30 config.getConfigSubtreeList("chemical_reaction"))
31 {
32 auto const stoichiometric_vector =
34 reaction_config.getConfigParameter<std::vector<double>>(
35 "stoichiometric_coefficients");
36
37 auto const reaction_type =
39 reaction_config.getConfigParameter<std::string>("reaction_type");
40 if (boost::iequals(reaction_type, "FirstOrderReaction"))
41 {
42 chemical_reactions.emplace_back(std::make_unique<
44 stoichiometric_vector,
46 reaction_config.getConfigParameter<double>(
47 "first_order_rate_constant")));
48 }
49 }
50
51 return chemical_reactions;
52}

References BaseLib::ConfigTree::getConfigSubtreeList().