Setup a BC corresponding to hot/cold fluid injection.
40 std::string nm =
name();
47 obj_pars.
get<UserObjectName>(
"PorousFlowDictator"));
48 if (dictator.numVariables() != 2)
50 ": Number of porous flow variables in simulation is '",
51 dictator.numVariables(),
52 "', but this BC can be used only with pressure and temperature.");
54 if (obj_pars.isParamValid(
"porepressure_var"))
56 const std::vector<VariableName> & pressure_param =
57 obj_pars.get<std::vector<VariableName>>(
"porepressure_var");
58 if (pressure_param.size() != 1)
59 mooseError(
name(),
": 'porepressure_var' parameter can currently take only a single value");
61 const std::vector<BoundaryName> & boundary = obj_pars.get<std::vector<BoundaryName>>(
"boundary");
62 const UserObjectName & dictator_name = obj_pars.get<UserObjectName>(
"PorousFlowDictator");
63 const FunctionName & flux_fn_name = obj_pars.get<FunctionName>(
"flux_function");
66 _problem->getNonlinearSystemBase(0).getVariable(tid, 0);
68 _problem->getNonlinearSystemBase(0).getVariable(tid, 1);
70 bool has_fluid_phase = obj_pars.isParamValid(
"fluid_phase");
72 const std::string class_name =
"PorousFlowSink";
75 pars.
set<NonlinearVariableName>(
"variable") = {p_m_var.name()};
76 pars.
set<std::vector<BoundaryName>>(
"boundary") = boundary;
77 pars.
set<UserObjectName>(
"PorousFlowDictator") = dictator_name;
78 pars.
set<
bool>(
"use_mobility") =
false;
79 pars.
set<
bool>(
"use_relperm") =
false;
81 pars.
set<
unsigned int>(
"fluid_phase") = obj_pars.get<
unsigned int>(
"fluid_phase");
83 pars.
set<std::vector<VariableName>>(
"porepressure_var") =
84 obj_pars.get<std::vector<VariableName>>(
"porepressure_var");
85 pars.
set<FunctionName>(
"flux_function") = flux_fn_name;
86 _problem->addBoundaryCondition(class_name, nm +
"_p_bc", pars);
89 const std::string class_name =
"PorousFlowEnthalpySink";
92 pars.
set<NonlinearVariableName>(
"variable") = {T_m_var.
name()};
93 pars.
set<std::vector<BoundaryName>>(
"boundary") = boundary;
94 pars.
set<
Real>(
"T_in") = obj_pars.get<Real>(
"T_in");
95 pars.
set<UserObjectName>(
"fp") = obj_pars.get<UserObjectName>(
"fp");
96 pars.
set<UserObjectName>(
"PorousFlowDictator") = dictator_name;
98 pars.
set<
unsigned int>(
"fluid_phase") = obj_pars.get<
unsigned int>(
"fluid_phase");
100 pars.
set<std::vector<VariableName>>(
"porepressure_var") =
101 obj_pars.get<std::vector<VariableName>>(
"porepressure_var");
102 pars.
set<FunctionName>(
"flux_function") = flux_fn_name;
103 _problem->addBoundaryCondition(class_name, nm +
"_T_bc", pars);
InputParameters getValidParams(const std::string &name) const
const std::string & name() const override
void extractParams(const std::string &prefix, InputParameters &p)
virtual const std::string & name() const
InputParameters & getObjectParams()
Moose::Builder & builder()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
This holds maps between the nonlinear variables used in a PorousFlow simulation and the variable numb...
void mooseError(Args &&... args) const
std::shared_ptr< FEProblemBase > & _problem