32 #ifdef GRINS_HAVE_CANTERA
36 #ifdef GRINS_HAVE_ANTIOCH
43 #if defined(GRINS_HAVE_ANTIOCH) || defined(GRINS_HAVE_CANTERA)
44 SharedPtr<NeumannBCAbstract>
46 (
const GetPot& input,
const std::string& reaction,SharedPtr<CatalycityBase>& gamma_ptr,
47 const std::vector<VariableIndex>& species_vars,
const std::string& material,
48 VariableIndex T_var,libMesh::Real p0,
const std::string& thermochem_lib )
50 SharedPtr<NeumannBCAbstract>
52 (
const GetPot& ,
const std::string& reaction,SharedPtr<CatalycityBase>& ,
53 const std::vector<VariableIndex>& ,
const std::string& ,
54 VariableIndex ,libMesh::Real ,
const std::string& thermochem_lib )
57 std::string gas_reactant;
58 std::string solid_reactant;
60 this->parse_reactants_and_product(reaction,gas_reactant,solid_reactant,product);
63 SharedPtr<NeumannBCAbstract> catalytic_wall;
67 if( thermochem_lib ==
"cantera" )
69 #ifdef GRINS_HAVE_CANTERA
70 libMesh::UniquePtr<CanteraMixture> chem_uptr;
74 SharedPtr<CanteraMixture> chem_ptr(chem_uptr.release());
76 this->build_wall_ptr<CanteraMixture>(chem_ptr,gamma_ptr,gas_reactant,solid_reactant,
77 product,species_vars,T_var,p0,catalytic_wall);
79 libmesh_error_msg(
"Error: Cantera not enabled in this configuration. Reconfigure using --with-cantera option.");
82 else if( thermochem_lib ==
"antioch" )
84 #ifdef GRINS_HAVE_ANTIOCH
85 libMesh::UniquePtr<AntiochChemistry> chem_uptr;
89 SharedPtr<AntiochChemistry> chem_ptr(chem_uptr.release());
91 this->build_wall_ptr<AntiochChemistry>(chem_ptr,gamma_ptr,gas_reactant,solid_reactant,
92 product,species_vars,T_var,p0,catalytic_wall);
94 libmesh_error_msg(
"Error: Antioch not enabled in this configuration. Reconfigure using --with-antioch option.");
98 libmesh_error_msg(
"ERROR: Invalid thermochemistry library "+thermochem_lib+
"!");
100 return catalytic_wall;
104 std::string& gas_reactant,
105 std::string& solid_reactant,
106 std::string& product )
const
113 std::vector<std::string> partners;
116 const std::string pre_split_reactants = partners[0];
117 product = partners[1];
119 std::vector<std::string> split_reactants;
123 if( split_reactants.size() != 2 )
125 std::string error_msg =
"ERROR: Currently, GasSolidCatalyticWall boundary condition only supports\n";
126 error_msg +=
" reactions of the form X+Y(s)->Z or Y(s)+X->X. Found ";
127 error_msg += StringUtilities::T_to_string<unsigned int>(split_reactants.size())+
" reactants.\n";
128 libmesh_error_msg(error_msg);
133 if( split_reactants[0].find(
"(s)") == split_reactants[0].npos )
136 if( split_reactants[1].find(
"(s)") == split_reactants[1].npos )
138 std::string error_msg =
"ERROR: could not find solid reactant for GasSolidCatalyticWall!\n";
139 error_msg +=
" Found reactants "+split_reactants[0]+
", "+split_reactants[1]+
"\n";
140 libmesh_error_msg(error_msg);
144 gas_reactant = split_reactants[0];
145 solid_reactant = split_reactants[1].substr(0,split_reactants[1].find(
"(s)"));
152 if( split_reactants[1].find(
"(s)") != split_reactants[1].npos )
154 std::string error_msg =
"ERROR: can have only one solid reactant for GasSolidCatalyticWall!\n";
155 error_msg +=
" Found reactants "+split_reactants[0]+
", "+split_reactants[1]+
"\n";
156 libmesh_error_msg(error_msg);
159 gas_reactant = split_reactants[1];
160 solid_reactant = split_reactants[0].substr(0,split_reactants[0].find(
"(s)"));
unsigned int VariableIndex
More descriptive name of the type used for variable indices.
SharedPtr< NeumannBCAbstract > build_catalytic_wall(const GetPot &input, const std::string &reaction, SharedPtr< CatalycityBase > &gamma_ptr, const std::vector< VariableIndex > &species_vars, const std::string &material, VariableIndex T_var, libMesh::Real p0, const std::string &thermochem_lib)
void parse_reactants_and_product(const std::string &reaction, std::string &gas_reactant, std::string &solid_reactant, std::string &product) const
void build_chemistry(const GetPot &input, const std::string &material, libMesh::UniquePtr< ChemistryType > &chem_ptr)
void split_string(const std::string &input, const std::string &delimiter, std::vector< std::string > &results)