https://mooseframework.inl.gov
ProductionWell.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 "ProductionWell.h"
11 
12 registerTHMActionComponentTasks("ThermalHydraulicsApp", ProductionWell);
13 registerActionComponent("ThermalHydraulicsApp", ProductionWell);
14 
17 {
19 
20  params.addRequiredParam<FunctionName>("outlet_pressure", "Outlet pressure function [Pa]");
21 
22  params.addClassDescription("Adds the components and controls for a production well.");
23 
24  return params;
25 }
26 
28 
29 void
31 {
33  addOutlet();
34 }
35 
36 void
38 {
39  const std::string get_fn_name = name() + "_get_outlet_p_ctrl";
40  {
41  const std::string class_name = "GetFunctionValueControl";
42  auto params = _factory.getValidParams(class_name);
43  params.set<FunctionName>("function") = getParam<FunctionName>("outlet_pressure");
44  params.set<Point>("point") = _surface_point;
45  addControlLogicObject(class_name, get_fn_name, params);
46  }
47  {
48  const std::string class_name = "SetComponentRealValueControl";
49  auto params = _factory.getValidParams(class_name);
50  params.set<std::string>("component") = outletName();
51  params.set<std::string>("parameter") = "p";
52  params.set<std::string>("value") = get_fn_name + ":value";
53  addControlLogicObject(class_name, name() + "_set_outlet_p_ctrl", params);
54  }
55 }
56 
57 void
59 {
60  const std::string class_name = "Outlet1Phase";
61  auto params = _factory.getValidParams(class_name);
62  params.set<BoundaryName>("input") = flowChannelName(0) + ":out";
63  params.set<Real>("p") = 1e5; // arbitrary placeholder value; this gets controlled
64  addTHMComponent(class_name, outletName(), params);
65 }
66 
67 std::string
69 {
70  return name() + "_outlet";
71 }
void addControlLogicObject(const std::string &class_name, const std::string &obj_name, InputParameters &params)
Adds a ControlLogic object.
registerActionComponent("ThermalHydraulicsApp", ProductionWell)
Factory & _factory
std::string outletName() const
Outlet component name.
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
Adds the components and controls for a production well.
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addOutlet()
Adds outlet component.
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
static InputParameters validParams()
registerTHMActionComponentTasks("ThermalHydraulicsApp", ProductionWell)
std::string flowChannelName(unsigned int i) const
Name of a flow channel.
Definition: WellBase.C:179
virtual void addTHMComponents() override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual void addControlLogic() override
void addClassDescription(const std::string &doc_string)
ProductionWell(const InputParameters &params)
void addTHMComponent(const std::string &class_name, const std::string &obj_name, InputParameters &params)
Adds a THM component.