https://mooseframework.inl.gov
FlowBoundary1Phase.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 "FlowBoundary1Phase.h"
11 #include "FlowChannel1Phase.h"
12 #include "FlowModelSinglePhase.h"
13 #include "THMNames.h"
14 
17 {
19  return params;
20 }
21 
23  : FlowBoundary1PhaseBase(params)
24 {
25 }
26 
27 void
29 {
31 
32  if (hasComponentByName<FlowChannel1Phase>(_connected_component_name))
33  {
34  auto flow_model_1phase = dynamic_cast<const FlowModelSinglePhase *>(_flow_model.get());
35  mooseAssert(flow_model_1phase, "Incompatible flow model");
36  _passives_times_area = flow_model_1phase->passiveTransportSolutionVariableNames();
37  }
38 }
39 
40 void
42 {
44 
45  checkComponentOfTypeExistsByName<FlowChannel1Phase>(_connected_component_name);
46 
48  logError("Passive transport has not been implemented for this Component type.");
49 }
50 
51 void
53 {
54  const std::string class_name = "ADBoundaryFlux3EqnBC";
55  InputParameters params = _factory.getValidParams(class_name);
56  params.set<std::vector<BoundaryName>>("boundary") = getBoundaryNames();
57  params.set<Real>("normal") = _normal;
58  params.set<UserObjectName>("boundary_flux") = _boundary_uo_name;
59  params.set<std::vector<VariableName>>("A_linear") = {THM::AREA_LINEAR};
60  params.set<std::vector<VariableName>>("rhoA") = {THM::RHOA};
61  params.set<std::vector<VariableName>>("rhouA") = {THM::RHOUA};
62  params.set<std::vector<VariableName>>("rhoEA") = {THM::RHOEA};
63  params.set<std::vector<VariableName>>("passives_times_area") = _passives_times_area;
64  params.set<bool>("implicit") = getTHMProblem().getImplicitTimeIntegrationFlag();
65 
66  auto flow_model_1phase = dynamic_cast<const FlowModelSinglePhase *>(_flow_model.get());
67  for (const auto & var : flow_model_1phase->solutionVariableNames())
68  {
69  params.set<NonlinearVariableName>("variable") = var;
71  class_name, genName(name(), var, "bnd_flux_3eqn_bc"), params);
72  }
73 }
static InputParameters validParams()
std::string genName(const std::string &prefix, unsigned int id, const std::string &suffix="") const
Build a name from a prefix, number and possible suffix.
static const std::string RHOEA
Definition: THMNames.h:30
THMProblem & getTHMProblem() const
Gets the THM problem.
Definition: Component.C:135
T & set(const std::string &name, bool quiet_mode=false)
const std::vector< BoundaryName > & getBoundaryNames() const
Gets the boundary names for this component.
Real _normal
Outward normal on this boundary.
static InputParameters validParams()
InputParameters getValidParams(const std::string &name) const
virtual void init() override
Initializes the component.
virtual void addBoundaryCondition(const std::string &bc_name, const std::string &name, InputParameters &parameters)
void logError(Args &&... args) const
Logs an error.
Definition: Component.h:226
std::vector< VariableName > _passives_times_area
Passive transport variables on the connected flow channel.
static const std::string AREA_LINEAR
Definition: THMNames.h:15
const std::string & name() const
const UserObjectName _boundary_uo_name
Name of boundary user object name.
virtual void check() const override
Check the component integrity.
Definition: FlowBoundary.C:43
FlowBoundary1Phase(const InputParameters &params)
std::string _connected_component_name
Name of the connected component.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Base class for boundary components connected to FlowChannel1PhaseBase components. ...
std::shared_ptr< const FlowModel > _flow_model
Flow model.
Definition: FlowBoundary.h:36
Factory & _factory
The Factory associated with the MooseApp.
Definition: Component.h:497
virtual void check() const override
Check the component integrity.
const bool & getImplicitTimeIntegrationFlag()
Gets the flag indicating whether an implicit time integration scheme is being used.
Definition: Simulation.h:329
virtual bool supportsPassiveTransport() const
True if the component supports passive transport variables.
Flow model for a single-component, single-phase fluid using the Euler equations.
virtual void init() override
Initializes the component.
static const std::string RHOUA
Definition: THMNames.h:31
virtual void addWeakBCs()
Creates the boundary condition objects for 1-phase flow.
static const std::string RHOA
Definition: THMNames.h:29