https://mooseframework.inl.gov
Outlet1Phase.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 "Outlet1Phase.h"
11 #include "FlowModelSinglePhase.h"
12 
13 registerMooseObject("ThermalHydraulicsApp", Outlet1Phase);
14 
17 {
19  params.addRequiredParam<Real>("p", "Prescribed pressure [Pa]");
20  params.declareControllable("p");
21  params.addClassDescription(
22  "Boundary condition with prescribed pressure for 1-phase flow channels.");
23  return params;
24 }
25 
27 
28 void
30 {
32 
33  auto fm = dynamic_cast<const FlowModelSinglePhase *>(_flow_model.get());
34  if (fm == nullptr)
35  logError("Incompatible flow model. Make sure you use this component with single phase flow "
36  "channel.");
37 }
38 
39 void
41 {
42  ExecFlagEnum userobject_execute_on(MooseUtils::getDefaultExecFlagEnum());
43  userobject_execute_on = {EXEC_INITIAL, EXEC_LINEAR, EXEC_NONLINEAR};
44 
45  // boundary flux user object
46  {
47  const std::string class_name = "ADBoundaryFlux3EqnGhostPressure";
48  InputParameters params = _factory.getValidParams(class_name);
49  params.set<Real>("p") = getParam<Real>("p");
50  params.set<Real>("normal") = _normal;
51  params.set<UserObjectName>("fluid_properties") = _fp_name;
52  params.set<UserObjectName>("numerical_flux") = _numerical_flux_name;
53  params.set<ExecFlagEnum>("execute_on") = userobject_execute_on;
54  getTHMProblem().addUserObject(class_name, _boundary_uo_name, params);
55  connectObject(params, _boundary_uo_name, "p");
56  }
57 
58  // BCs
59  addWeakBCs();
60 }
virtual void addMooseObjects() override
Definition: Outlet1Phase.C:40
Boundary condition with prescribed pressure for 1-phase flow channels.
Definition: Outlet1Phase.h:17
THMProblem & getTHMProblem() const
Gets the THM problem.
Definition: Component.C:135
virtual void check() const override
Check the component integrity.
Definition: Outlet1Phase.C:29
T & set(const std::string &name, bool quiet_mode=false)
Real _normal
Outward normal on this boundary.
static InputParameters validParams()
InputParameters getValidParams(const std::string &name) const
registerMooseObject("ThermalHydraulicsApp", Outlet1Phase)
void addRequiredParam(const std::string &name, const std::string &doc_string)
ExecFlagEnum getDefaultExecFlagEnum()
void logError(Args &&... args) const
Logs an error.
Definition: Component.h:215
const UserObjectName _boundary_uo_name
Name of boundary user object name.
static InputParameters validParams()
Definition: Outlet1Phase.C:16
const ExecFlagType EXEC_LINEAR
Outlet1Phase(const InputParameters &params)
Definition: Outlet1Phase.C:26
const ExecFlagType EXEC_NONLINEAR
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
UserObjectName _numerical_flux_name
Numerical flux user object name.
std::shared_ptr< const FlowModel > _flow_model
Flow model.
Definition: FlowBoundary.h:36
Factory & _factory
The Factory associated with the MooseApp.
Definition: Component.h:446
void connectObject(const InputParameters &params, const std::string &mooseName, const std::string &name) const
Connect with control logic.
Definition: Component.C:98
virtual std::vector< std::shared_ptr< UserObject > > addUserObject(const std::string &user_object_name, const std::string &name, InputParameters &parameters)
virtual void check() const override
Check the component integrity.
void addClassDescription(const std::string &doc_string)
Flow model for a single-component, single-phase fluid using the Euler equations.
UserObjectName _fp_name
Fluid property user object name.
Definition: FlowBoundary.h:38
virtual void addWeakBCs()
Creates the boundary condition objects for 1-phase flow.
Base class for boundary components connected to FlowChannel1Phase components.
void declareControllable(const std::string &name, std::set< ExecFlagType > execute_flags={})
const ExecFlagType EXEC_INITIAL