https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
13registerActionComponent("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
31void
37
38void
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
78void
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
89std::string
91{
92 return name() + "_inlet";
93}
registerTHMActionComponentTasks("ThermalHydraulicsApp", InjectionWell)
registerActionComponent("ThermalHydraulicsApp", InjectionWell)
InputParameters getValidParams(const std::string &name) const
Adds the components and controls for an injection well.
virtual void addControlLogic() override
void addInlet()
Adds inlet component.
std::string inletName() const
Inlet component name.
static InputParameters validParams()
virtual void addTHMComponents() override
InjectionWell(const InputParameters &params)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
T & set(const std::string &name, bool quiet_mode=false)
const std::string & name() const
Factory & _factory
void addControlLogicObject(const std::string &class_name, const std::string &obj_name, InputParameters &params)
Adds a ControlLogic object.
void addTHMComponent(const std::string &class_name, const std::string &obj_name, InputParameters &params)
Adds a THM component.
Base class for injection and production wells.
Definition WellBase.h:18
std::string flowChannelName(unsigned int i) const
Name of a flow channel.
Definition WellBase.C:179
static InputParameters validParams()
Definition WellBase.C:14
const Point & _surface_point
Surface point.
Definition WellBase.h:43
void addWellBaseComponents(bool is_production)
Adds the components common to both injection and production.
Definition WellBase.C:73