https://mooseframework.inl.gov
InjectionWell.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #include "InjectionWell.h"
11 
12 registerTHMActionComponentTasks("ThermalHydraulicsApp", InjectionWell);
13 registerActionComponent("ThermalHydraulicsApp", InjectionWell);
14 
17 {
19 
20  params.addRequiredParam<FunctionName>("inlet_mass_flow_rate",
21  "Inlet mass flow rate function [kg/s]");
22  params.addRequiredParam<FunctionName>("inlet_temperature", "Inlet temperature function [K]");
23 
24  params.addClassDescription("Adds the components and controls for an injection well.");
25 
26  return params;
27 }
28 
30 
31 void
33 {
34  addWellBaseComponents(false);
35  addInlet();
36 }
37 
38 void
40 {
41  // m_dot
42  const std::string get_mdot_fn_name = name() + "_get_inlet_mdot_ctrl";
43  {
44  const std::string class_name = "GetFunctionValueControl";
45  auto params = _factory.getValidParams(class_name);
46  params.set<FunctionName>("function") = getParam<FunctionName>("inlet_mass_flow_rate");
47  params.set<Point>("point") = _surface_point;
48  addControlLogicObject(class_name, get_mdot_fn_name, params);
49  }
50  {
51  const std::string class_name = "SetComponentRealValueControl";
52  auto params = _factory.getValidParams(class_name);
53  params.set<std::string>("component") = inletName();
54  params.set<std::string>("parameter") = "m_dot";
55  params.set<std::string>("value") = get_mdot_fn_name + ":value";
56  addControlLogicObject(class_name, name() + "_set_inlet_mdot_ctrl", params);
57  }
58 
59  // T
60  const std::string get_T_fn_name = name() + "_get_inlet_T_ctrl";
61  {
62  const std::string class_name = "GetFunctionValueControl";
63  auto params = _factory.getValidParams(class_name);
64  params.set<FunctionName>("function") = getParam<FunctionName>("inlet_temperature");
65  params.set<Point>("point") = _surface_point;
66  addControlLogicObject(class_name, get_T_fn_name, params);
67  }
68  {
69  const std::string class_name = "SetComponentRealValueControl";
70  auto params = _factory.getValidParams(class_name);
71  params.set<std::string>("component") = inletName();
72  params.set<std::string>("parameter") = "T";
73  params.set<std::string>("value") = get_T_fn_name + ":value";
74  addControlLogicObject(class_name, name() + "_set_inlet_T_ctrl", params);
75  }
76 }
77 
78 void
80 {
81  const std::string class_name = "InletMassFlowRateTemperature1Phase";
82  auto params = _factory.getValidParams(class_name);
83  params.set<BoundaryName>("input") = flowChannelName(0) + ":in";
84  params.set<Real>("m_dot") = 0.0; // arbitrary placeholder value; this gets controlled
85  params.set<Real>("T") = 300.0; // arbitrary placeholder value; this gets controlled
86  addTHMComponent(class_name, inletName(), params);
87 }
88 
89 std::string
91 {
92  return name() + "_inlet";
93 }
void addControlLogicObject(const std::string &class_name, const std::string &obj_name, InputParameters &params)
Adds a ControlLogic object.
Factory & _factory
T & set(const std::string &name, bool quiet_mode=false)
registerActionComponent("ThermalHydraulicsApp", InjectionWell)
InputParameters getValidParams(const std::string &name) const
void addRequiredParam(const std::string &name, const std::string &doc_string)
const std::string & name() const
Base class for injection and production wells.
Definition: WellBase.h:17
void addWellBaseComponents(bool is_production)
Adds the components common to both injection and production.
Definition: WellBase.C:73
const Point & _surface_point
Surface point.
Definition: WellBase.h:43
static InputParameters validParams()
Definition: WellBase.C:14
void addInlet()
Adds inlet component.
Definition: InjectionWell.C:79
std::string flowChannelName(unsigned int i) const
Name of a flow channel.
Definition: WellBase.C:179
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static InputParameters validParams()
Definition: InjectionWell.C:16
InjectionWell(const InputParameters &params)
Definition: InjectionWell.C:29
std::string inletName() const
Inlet component name.
Definition: InjectionWell.C:90
void addClassDescription(const std::string &doc_string)
Adds the components and controls for an injection well.
Definition: InjectionWell.h:17
virtual void addTHMComponents() override
Definition: InjectionWell.C:32
void addTHMComponent(const std::string &class_name, const std::string &obj_name, InputParameters &params)
Adds a THM component.
registerTHMActionComponentTasks("ThermalHydraulicsApp", InjectionWell)
virtual void addControlLogic() override
Definition: InjectionWell.C:39