https://mooseframework.inl.gov
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
ProductionWell Class Reference

Adds the components and controls for a production well. More...

#include <ProductionWell.h>

Inheritance diagram for ProductionWell:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 ProductionWell (const InputParameters &params)
 
virtual void act () override final
 
const std::vector< MeshGeneratorName > & meshGeneratorNames () const
 
MeshGeneratorName getCurrentTopLevelMeshGeneratorName () const
 
void setCurrentTopLevelMeshGeneratorName (const MeshGeneratorName &mg_name)
 
const std::vector< SubdomainName > & blocks () const
 
virtual const std::vector< BoundaryName > & outerSurfaceBoundaries () const
 
virtual Real volume () const
 
virtual Real outerSurfaceArea () const
 
unsigned int dimension () const
 
void addConnectedComponent (ActionComponent &component)
 
const std::set< ActionComponent *> & getConnectedComponents () const
 
void timedAct ()
 
virtual void addRelationshipManagers (Moose::RelationshipManagerType when_type)
 
MooseObjectName uniqueActionName () const
 
const std::string & specificTaskName () const
 
const std::set< std::string > & getAllTasks () const
 
void appendTask (const std::string &task)
 
MooseAppgetMooseApp () const
 
const std::string & type () const
 
const std::string & name () const
 
std::string typeAndName () const
 
MooseObjectParameterName uniqueParameterName (const std::string &parameter_name) const
 
MooseObjectName uniqueName () const
 
const InputParametersparameters () const
 
const hit::Node * getHitNode () const
 
bool hasBase () const
 
const std::string & getBase () const
 
const TgetParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const TqueryParam (const std::string &name) const
 
const TgetRenamedParam (const std::string &old_name, const std::string &new_name) const
 
T getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 
bool haveParameter (const std::string &name) const
 
bool isParamValid (const std::string &name) const
 
bool isParamSetByUser (const std::string &name) const
 
void connectControllableParams (const std::string &parameter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
 
void paramError (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramInfo (const std::string &param, Args... args) const
 
std::string messagePrefix (const bool hit_prefix=true) const
 
std::string errorPrefix (const std::string &) const
 
void mooseError (Args &&... args) const
 
void mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
 
void mooseErrorNonPrefixed (Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseDeprecatedNoTrace (Args &&... args) const
 
void mooseInfo (Args &&... args) const
 
void callMooseError (std::string msg, const bool with_prefix, const hit::Node *node=nullptr, const bool show_trace=true) const
 
std::string getDataFileName (const std::string &param) const
 
std::string getDataFileNameByName (const std::string &relative_path) const
 
std::string getDataFilePath (const std::string &relative_path) const
 
PerfGraphperfGraph ()
 
void assertParamDefined (const std::string &libmesh_dbg_var(param)) const
 
const Parallel::Communicator & comm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 

Static Public Member Functions

static InputParameters validParams ()
 
static void callMooseError (MooseApp *const app, const InputParameters &params, std::string msg, const bool with_prefix, const hit::Node *node, const bool show_trace=true)
 

Public Attributes

 usingCombinedWarningSolutionWarnings
 
const ConsoleStream _console
 

Static Public Attributes

static const std::string unique_action_name_param
 
static const std::string type_param
 
static const std::string name_param
 
static const std::string unique_name_param
 
static const std::string app_param
 
static const std::string moose_base_param
 
static const std::string kokkos_object_param
 
static constexpr auto SYSTEM
 
static constexpr auto NAME
 

Protected Member Functions

virtual void addTHMComponents () override
 
virtual void addControlLogic () override
 
void addOutlet ()
 Adds outlet component. More...
 
std::string outletName () const
 Outlet component name. More...
 
virtual void addClosures () override
 
void addWellBaseComponents (bool is_production)
 Adds the components common to both injection and production. More...
 
void addFlowChannel (unsigned int i, bool is_production)
 Adds a flow channel. More...
 
void addWall (bool is_production)
 Adds a wall at the end of a well. More...
 
void addJunction (unsigned int i, bool is_production)
 Adds a junction. More...
 
void addJunctionFlux (unsigned int i)
 Adds a junction coupling. More...
 
std::string flowChannelName (unsigned int i) const
 Name of a flow channel. More...
 
std::string volumeJunctionName (unsigned int i) const
 Name of a volume junction. More...
 
virtual void actOnAdditionalTasks () override
 
void addTHMComponent (const std::string &class_name, const std::string &obj_name, InputParameters &params)
 Adds a THM component. More...
 
void addClosuresObject (const std::string &class_name, const std::string &obj_name, InputParameters &params)
 Adds a Closures object. More...
 
void addControlLogicObject (const std::string &class_name, const std::string &obj_name, InputParameters &params)
 Adds a ControlLogic object. More...
 
THMProblemgetTHMProblem ()
 Gets the THM problem. More...
 
bool addRelationshipManagers (Moose::RelationshipManagerType when_type, const InputParameters &moose_object_pars)
 
void assertParamDefined (const std::string &param) const
 
virtual void addMeshGenerators ()
 
virtual void addPositionsObject ()
 
virtual void addUserObjects ()
 
virtual void setupComponent ()
 
virtual void addSolverVariables ()
 
virtual void addPhysics ()
 
virtual void addMaterials ()
 
virtual void checkIntegrity ()
 
void addRequiredTask (const std::string &task)
 
void checkRequiredTasks () const
 
FEProblemBasegetProblem ()
 
FactorygetFactory () const
 
void associateWithParameter (const std::string &param_name, InputParameters &params) const
 
void associateWithParameter (const InputParameters &from_params, const std::string &param_name, InputParameters &params) const
 
const TgetMeshProperty (const std::string &data_name, const std::string &prefix)
 
const TgetMeshProperty (const std::string &data_name)
 
bool hasMeshProperty (const std::string &data_name, const std::string &prefix) const
 
bool hasMeshProperty (const std::string &data_name, const std::string &prefix) const
 
bool hasMeshProperty (const std::string &data_name) const
 
bool hasMeshProperty (const std::string &data_name) const
 
std::string meshPropertyName (const std::string &data_name) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level, const std::string &live_message, const bool print_dots=true) const
 
std::string timedSectionName (const std::string &section_name) const
 
void flagInvalidSolutionInternal (const InvalidSolutionID invalid_solution_id) const
 
InvalidSolutionID registerInvalidSolutionInternal (const std::string &message, const bool warning) const
 
void checkParamsBothSetOrNotSet (const std::string &param1, const std::string &param2) const
 
void checkSecondParamSetOnlyIfFirstOneTrue (const std::string &param1, const std::string &param2) const
 
void checkSecondParamSetOnlyIfFirstOneSet (const std::string &param1, const std::string &param2) const
 
void checkSecondParamNotSetIfFirstOneSet (const std::string &param1, const std::string &param2) const
 
void checkVectorParamsSameLength (const std::string &param1, const std::string &param2) const
 
void checkVectorParamAndMultiMooseEnumLength (const std::string &param1, const std::string &param2) const
 
void checkTwoDVectorParamsSameLength (const std::string &param1, const std::string &param2) const
 
void checkVectorParamsNoOverlap (const std::vector< std::string > &param_vecs) const
 
void checkTwoDVectorParamsNoRespectiveOverlap (const std::vector< std::string > &param_vecs) const
 
void checkTwoDVectorParamInnerSameLengthAsOneDVector (const std::string &param1, const std::string &param2) const
 
void checkTwoDVectorParamMultiMooseEnumSameLength (const std::string &param1, const std::string &param2, const bool error_for_param2) const
 
void checkVectorParamNotEmpty (const std::string &param1) const
 
void checkVectorParamsSameLengthIfSet (const std::string &param1, const std::string &param2, const bool ignore_empty_default_param2=false) const
 
void checkVectorParamLengthSameAsCombinedOthers (const std::string &param1, const std::string &param2, const std::string &param3) const
 
void checkBlockwiseConsistency (const std::string &block_param_name, const std::vector< std::string > &parameter_names) const
 
bool parameterConsistent (const InputParameters &other_param, const std::string &param_name) const
 
void warnInconsistent (const InputParameters &parameters, const std::string &param_name) const
 
void errorDependentParameter (const std::string &param1, const std::string &value_not_set, const std::vector< std::string > &dependent_params) const
 
void errorInconsistentDependentParameter (const std::string &param1, const std::string &value_set, const std::vector< std::string > &dependent_params) const
 

Static Protected Member Functions

static std::string meshPropertyName (const std::string &data_name, const std::string &prefix)
 

Protected Attributes

const Point & _surface_point
 Surface point. More...
 
const std::vector< Point > & _junction_points
 Junction points. More...
 
const std::vector< unsigned int > & _section_n_elems
 Number of elements in each flow channel. More...
 
const unsigned int _n_sections
 Number of flow channels. More...
 
const std::vector< Real > & _junction_coupling_areas
 Coupled flow area of each junction. More...
 
const std::string _closures_name
 Closures name. More...
 
std::vector< Point > _all_points
 Surface point, junction points, and optional end point. More...
 
unsigned int _dimension
 
std::vector< MeshGeneratorName > _mg_names
 
MeshGeneratorName _top_mg_name
 
std::vector< SubdomainName > _blocks
 
std::vector< BoundaryName > _outer_boundaries
 
const bool _verbose
 
std::set< std::string > _required_tasks
 
std::shared_ptr< std::set< ActionComponent *> > _connected_components
 
std::string _registered_identifier
 
std::string _specific_task_name
 
std::set< std::string > _all_tasks
 
ActionWarehouse_awh
 
const std::string & _current_task
 
std::shared_ptr< MooseMesh > & _mesh
 
std::shared_ptr< MooseMesh > & _displaced_mesh
 
std::shared_ptr< FEProblemBase > & _problem
 
PerfID _act_timer
 
MooseApp_app
 
Factory_factory
 
ActionFactory_action_factory
 
const std::string & _type
 
const std::string & _name
 
const InputParameters_pars
 
MooseApp_pg_moose_app
 
const std::string _prefix
 
const Parallel::Communicator & _communicator
 

Detailed Description

Adds the components and controls for a production well.

Definition at line 17 of file ProductionWell.h.

Constructor & Destructor Documentation

◆ ProductionWell()

ProductionWell::ProductionWell ( const InputParameters params)

Definition at line 27 of file ProductionWell.C.

27 : WellBase(params) {}
WellBase(const InputParameters &params)
Definition: WellBase.C:45

Member Function Documentation

◆ actOnAdditionalTasks()

void THMActionComponent::actOnAdditionalTasks ( )
overrideprotectedvirtualinherited

Reimplemented from ActionComponent.

Definition at line 23 of file THMActionComponent.C.

24 {
25  if (_current_task == "THM:add_component")
27  if (_current_task == "THM:add_closures")
28  addClosures();
29  if (_current_task == "THM:add_control_logic")
31 }
virtual void addControlLogic()
virtual void addTHMComponents()
const std::string & _current_task
virtual void addClosures()

◆ addClosures()

void WellBase::addClosures ( )
overrideprotectedvirtualinherited

Reimplemented from THMActionComponent.

Definition at line 65 of file WellBase.C.

66 {
67  const std::string class_name = "Closures1PhaseSimple";
68  auto params = _factory.getValidParams(class_name);
69  addClosuresObject(class_name, _closures_name, params);
70 }
Factory & _factory
const std::string _closures_name
Closures name.
Definition: WellBase.h:53
InputParameters getValidParams(const std::string &name) const
void addClosuresObject(const std::string &class_name, const std::string &obj_name, InputParameters &params)
Adds a Closures object.

◆ addClosuresObject()

void THMActionComponent::addClosuresObject ( const std::string &  class_name,
const std::string &  obj_name,
InputParameters params 
)
protectedinherited

Adds a Closures object.

Definition at line 55 of file THMActionComponent.C.

Referenced by WellBase::addClosures().

58 {
59  auto & thm_problem = getTHMProblem();
60  params.set<THMProblem *>("_thm_problem") = &thm_problem;
61  params.set<Logger *>("_logger") = &(thm_problem.log());
62  thm_problem.addClosures(class_name, obj_name, params);
63 }
Keeps the error and warning messages.
Definition: Logger.h:17
Specialization of FEProblem to run with component subsystem.
Definition: THMProblem.h:18
T & set(const std::string &name, bool quiet_mode=false)
THMProblem & getTHMProblem()
Gets the THM problem.

◆ addControlLogic()

void ProductionWell::addControlLogic ( )
overrideprotectedvirtual

Reimplemented from THMActionComponent.

Definition at line 37 of file ProductionWell.C.

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 }
void addControlLogicObject(const std::string &class_name, const std::string &obj_name, InputParameters &params)
Adds a ControlLogic object.
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
const std::string & name() const
const Point & _surface_point
Surface point.
Definition: WellBase.h:43

◆ addControlLogicObject()

void THMActionComponent::addControlLogicObject ( const std::string &  class_name,
const std::string &  obj_name,
InputParameters params 
)
protectedinherited

Adds a ControlLogic object.

Definition at line 66 of file THMActionComponent.C.

Referenced by InjectionWell::addControlLogic(), and addControlLogic().

69 {
70  auto & thm_problem = getTHMProblem();
71  params.set<FEProblemBase *>("_fe_problem_base") = _problem.get();
72  params.set<THMProblem *>("_thm_problem") = &thm_problem;
73  std::shared_ptr<Control> control = _factory.create<Control>(class_name, obj_name, params);
74  thm_problem.getControlWarehouse().addObject(control);
75 }
Specialization of FEProblem to run with component subsystem.
Definition: THMProblem.h:18
Factory & _factory
T & set(const std::string &name, bool quiet_mode=false)
std::shared_ptr< MooseObject > create(const std::string &obj_name, const std::string &name, const InputParameters &parameters, THREAD_ID tid=0, bool print_deprecated=true)
THMProblem & getTHMProblem()
Gets the THM problem.
std::shared_ptr< FEProblemBase > & _problem

◆ addFlowChannel()

void WellBase::addFlowChannel ( unsigned int  i,
bool  is_production 
)
protectedinherited

Adds a flow channel.

Definition at line 90 of file WellBase.C.

Referenced by WellBase::addWellBaseComponents().

91 {
92  Point start_position, end_position;
93  if (is_production)
94  {
95  start_position = _all_points[i + 1];
96  end_position = _all_points[i];
97  }
98  else
99  {
100  start_position = _all_points[i];
101  end_position = _all_points[i + 1];
102  }
103 
104  const RealVectorValue translation = end_position - start_position;
105 
106  const std::string class_name = "FlowChannel1Phase";
107  auto params = _factory.getValidParams(class_name);
108  params.set<Point>("position") = start_position;
109  params.set<RealVectorValue>("orientation") = translation;
110  params.set<std::vector<Real>>("length") = {translation.norm()};
111  params.set<std::vector<unsigned int>>("n_elems") = {_section_n_elems[i]};
112  params.set<FunctionName>("A") = getParam<FunctionName>("area");
113  params.set<FunctionName>("initial_p") = getParam<FunctionName>("initial_pressure");
114  params.set<FunctionName>("initial_T") = getParam<FunctionName>("initial_temperature");
115  params.set<FunctionName>("initial_vel") = "0.0";
116  params.set<RealVectorValue>("gravity_vector") = {
118  params.set<UserObjectName>("fp") = getParam<UserObjectName>("fluid_properties");
119  params.set<std::vector<std::string>>("closures") = {_closures_name};
120  params.set<FunctionName>("f") = getParam<FunctionName>("friction_factor");
121  params.set<MooseEnum>("rdg_slope_reconstruction") = "full";
122  params.set<std::vector<Real>>("scaling_factor_1phase") = {1.0, 1.0, 1e-5};
123  params.set<std::vector<VariableName>>("vpp_vars") = {"p"};
124  params.set<bool>("create_flux_vpp") = true;
125  addTHMComponent(class_name, flowChannelName(i), params);
126 }
const auto acceleration_of_gravity
auto norm() const
Factory & _factory
T & set(const std::string &name, bool quiet_mode=false)
const std::string _closures_name
Closures name.
Definition: WellBase.h:53
InputParameters getValidParams(const std::string &name) const
std::vector< Point > _all_points
Surface point, junction points, and optional end point.
Definition: WellBase.h:56
std::string flowChannelName(unsigned int i) const
Name of a flow channel.
Definition: WellBase.C:179
void addTHMComponent(const std::string &class_name, const std::string &obj_name, InputParameters &params)
Adds a THM component.
const std::vector< unsigned int > & _section_n_elems
Number of elements in each flow channel.
Definition: WellBase.h:47

◆ addJunction()

void WellBase::addJunction ( unsigned int  i,
bool  is_production 
)
protectedinherited

Adds a junction.

Definition at line 140 of file WellBase.C.

Referenced by WellBase::addWellBaseComponents().

141 {
142  const std::string first_end = is_production ? ":in" : ":out";
143  const std::string second_end = is_production ? ":out" : ":in";
144  std::vector<BoundaryName> connections;
145  connections.push_back(flowChannelName(i) + first_end);
146  if (i + 1 <= _n_sections - 1)
147  connections.push_back(flowChannelName(i + 1) + second_end);
148 
149  const std::string class_name = "VolumeJunction1Phase";
150  auto params = _factory.getValidParams(class_name);
151  params.set<Point>("position") = _junction_points[i];
152  params.set<std::vector<BoundaryName>>("connections") = connections;
153  params.set<FunctionName>("initial_p") = getParam<FunctionName>("initial_pressure");
154  params.set<FunctionName>("initial_T") = getParam<FunctionName>("initial_temperature");
155  params.set<FunctionName>("initial_vel_x") = "0.0";
156  params.set<FunctionName>("initial_vel_y") = "0.0";
157  params.set<FunctionName>("initial_vel_z") = "0.0";
158  params.set<Real>("volume") = getParam<Real>("junction_volume");
159  params.set<Real>("scaling_factor_rhoEV") = 1e-5;
160  addTHMComponent(class_name, volumeJunctionName(i), params);
161 }
std::string volumeJunctionName(unsigned int i) const
Name of a volume junction.
Definition: WellBase.C:185
const std::vector< Point > & _junction_points
Junction points.
Definition: WellBase.h:45
Factory & _factory
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
const unsigned int _n_sections
Number of flow channels.
Definition: WellBase.h:49
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
void addTHMComponent(const std::string &class_name, const std::string &obj_name, InputParameters &params)
Adds a THM component.

◆ addJunctionFlux()

void WellBase::addJunctionFlux ( unsigned int  i)
protectedinherited

Adds a junction coupling.

Definition at line 164 of file WellBase.C.

Referenced by WellBase::addWellBaseComponents().

165 {
166  const std::string class_name = "VolumeJunctionCoupledFlux1Phase";
167  auto params = _factory.getValidParams(class_name);
168  params.set<Real>("A_coupled") = _junction_coupling_areas[i];
169  params.set<RealVectorValue>("normal_from_junction") =
170  getParam<RealVectorValue>("fracture_direction");
171  params.set<std::string>("volume_junction") = volumeJunctionName(i);
172  params.set<std::string>("pp_suffix") = name() + std::to_string(i + 1);
173  if (isParamValid("multi_app"))
174  params.set<MultiAppName>("multi_app") = getParam<MultiAppName>("multi_app");
175  addTHMComponent(class_name, volumeJunctionName(i) + "_flux", params);
176 }
std::string volumeJunctionName(unsigned int i) const
Name of a volume junction.
Definition: WellBase.C:185
Factory & _factory
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
const std::string & name() const
const std::vector< Real > & _junction_coupling_areas
Coupled flow area of each junction.
Definition: WellBase.h:51
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
bool isParamValid(const std::string &name) const
void addTHMComponent(const std::string &class_name, const std::string &obj_name, InputParameters &params)
Adds a THM component.

◆ addOutlet()

void ProductionWell::addOutlet ( )
protected

Adds outlet component.

Definition at line 58 of file ProductionWell.C.

Referenced by addTHMComponents().

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 }
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
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
void addTHMComponent(const std::string &class_name, const std::string &obj_name, InputParameters &params)
Adds a THM component.

◆ addTHMComponent()

void THMActionComponent::addTHMComponent ( const std::string &  class_name,
const std::string &  obj_name,
InputParameters params 
)
protectedinherited

Adds a THM component.

Definition at line 45 of file THMActionComponent.C.

Referenced by WellBase::addFlowChannel(), InjectionWell::addInlet(), WellBase::addJunction(), WellBase::addJunctionFlux(), addOutlet(), and WellBase::addWall().

48 {
49  auto & thm_problem = getTHMProblem();
50  params.set<THMProblem *>("_thm_problem") = &thm_problem;
51  thm_problem.addComponent(class_name, obj_name, params);
52 }
Specialization of FEProblem to run with component subsystem.
Definition: THMProblem.h:18
T & set(const std::string &name, bool quiet_mode=false)
THMProblem & getTHMProblem()
Gets the THM problem.
virtual void addComponent(const std::string &type, const std::string &name, InputParameters params)
Add a component into this simulation.
Definition: Simulation.C:991

◆ addTHMComponents()

void ProductionWell::addTHMComponents ( )
overrideprotectedvirtual

Reimplemented from THMActionComponent.

Definition at line 30 of file ProductionWell.C.

31 {
33  addOutlet();
34 }
void addOutlet()
Adds outlet component.
void addWellBaseComponents(bool is_production)
Adds the components common to both injection and production.
Definition: WellBase.C:73

◆ addWall()

void WellBase::addWall ( bool  is_production)
protectedinherited

Adds a wall at the end of a well.

Definition at line 129 of file WellBase.C.

Referenced by WellBase::addWellBaseComponents().

130 {
131  const std::string in_or_out = is_production ? ":in" : ":out";
132 
133  const std::string class_name = "SolidWall1Phase";
134  auto params = _factory.getValidParams(class_name);
135  params.set<BoundaryName>("input") = flowChannelName(_n_sections - 1) + in_or_out;
136  addTHMComponent(class_name, name() + "_wall", params);
137 }
Factory & _factory
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
const std::string & name() const
const unsigned int _n_sections
Number of flow channels.
Definition: WellBase.h:49
std::string flowChannelName(unsigned int i) const
Name of a flow channel.
Definition: WellBase.C:179
void addTHMComponent(const std::string &class_name, const std::string &obj_name, InputParameters &params)
Adds a THM component.

◆ addWellBaseComponents()

void WellBase::addWellBaseComponents ( bool  is_production)
protectedinherited

Adds the components common to both injection and production.

Definition at line 73 of file WellBase.C.

Referenced by InjectionWell::addTHMComponents(), and addTHMComponents().

74 {
75  for (const auto i : index_range(_all_points))
76  if (i != 0)
77  addFlowChannel(i - 1, is_production);
78 
79  if (isParamValid("end_point"))
80  addWall(is_production);
81 
82  for (const auto i : index_range(_junction_points))
83  {
84  addJunction(i, is_production);
85  addJunctionFlux(i);
86  }
87 }
const std::vector< Point > & _junction_points
Junction points.
Definition: WellBase.h:45
void addFlowChannel(unsigned int i, bool is_production)
Adds a flow channel.
Definition: WellBase.C:90
std::vector< Point > _all_points
Surface point, junction points, and optional end point.
Definition: WellBase.h:56
void addWall(bool is_production)
Adds a wall at the end of a well.
Definition: WellBase.C:129
void addJunction(unsigned int i, bool is_production)
Adds a junction.
Definition: WellBase.C:140
void addJunctionFlux(unsigned int i)
Adds a junction coupling.
Definition: WellBase.C:164
bool isParamValid(const std::string &name) const
auto index_range(const T &sizable)

◆ flowChannelName()

std::string WellBase::flowChannelName ( unsigned int  i) const
protectedinherited

Name of a flow channel.

Definition at line 179 of file WellBase.C.

Referenced by WellBase::addFlowChannel(), InjectionWell::addInlet(), WellBase::addJunction(), addOutlet(), and WellBase::addWall().

180 {
181  return name() + std::to_string(i + 1);
182 }
const std::string & name() const

◆ getTHMProblem()

THMProblem & THMActionComponent::getTHMProblem ( )
protectedinherited

Gets the THM problem.

Definition at line 34 of file THMActionComponent.C.

Referenced by THMActionComponent::addClosuresObject(), THMActionComponent::addControlLogicObject(), and THMActionComponent::addTHMComponent().

35 {
36  THMProblem * thm_problem = dynamic_cast<THMProblem *>(_problem.get());
37  if (thm_problem)
38  return *thm_problem;
39  else
40  mooseError("The Problem must derive from THMProblem to use THMActionComponents. Please include "
41  "a [Components] block in your input file, even if empty.");
42 }
Specialization of FEProblem to run with component subsystem.
Definition: THMProblem.h:18
void mooseError(Args &&... args) const
std::shared_ptr< FEProblemBase > & _problem

◆ outletName()

std::string ProductionWell::outletName ( ) const
protected

Outlet component name.

Definition at line 68 of file ProductionWell.C.

Referenced by addControlLogic(), and addOutlet().

69 {
70  return name() + "_outlet";
71 }
const std::string & name() const

◆ validParams()

InputParameters ProductionWell::validParams ( )
static

Definition at line 16 of file ProductionWell.C.

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 }
void addRequiredParam(const std::string &name, const std::string &doc_string)
static InputParameters validParams()
Definition: WellBase.C:14
void addClassDescription(const std::string &doc_string)

◆ volumeJunctionName()

std::string WellBase::volumeJunctionName ( unsigned int  i) const
protectedinherited

Name of a volume junction.

Definition at line 185 of file WellBase.C.

Referenced by WellBase::addJunction(), and WellBase::addJunctionFlux().

186 {
187  return name() + "_junc" + std::to_string(i + 1);
188 }
const std::string & name() const

Member Data Documentation

◆ _all_points

std::vector<Point> WellBase::_all_points
protectedinherited

Surface point, junction points, and optional end point.

Definition at line 56 of file WellBase.h.

Referenced by WellBase::addFlowChannel(), WellBase::addWellBaseComponents(), and WellBase::WellBase().

◆ _closures_name

const std::string WellBase::_closures_name
protectedinherited

Closures name.

Definition at line 53 of file WellBase.h.

Referenced by WellBase::addClosures(), and WellBase::addFlowChannel().

◆ _junction_coupling_areas

const std::vector<Real>& WellBase::_junction_coupling_areas
protectedinherited

Coupled flow area of each junction.

Definition at line 51 of file WellBase.h.

Referenced by WellBase::addJunctionFlux().

◆ _junction_points

const std::vector<Point>& WellBase::_junction_points
protectedinherited

Junction points.

Definition at line 45 of file WellBase.h.

Referenced by WellBase::addJunction(), WellBase::addWellBaseComponents(), and WellBase::WellBase().

◆ _n_sections

const unsigned int WellBase::_n_sections
protectedinherited

Number of flow channels.

Definition at line 49 of file WellBase.h.

Referenced by WellBase::addJunction(), and WellBase::addWall().

◆ _section_n_elems

const std::vector<unsigned int>& WellBase::_section_n_elems
protectedinherited

Number of elements in each flow channel.

Definition at line 47 of file WellBase.h.

Referenced by WellBase::addFlowChannel().

◆ _surface_point

const Point& WellBase::_surface_point
protectedinherited

Surface point.

Definition at line 43 of file WellBase.h.

Referenced by InjectionWell::addControlLogic(), addControlLogic(), and WellBase::WellBase().


The documentation for this class was generated from the following files: