https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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"
13#include "THMNames.h"
14
21
26
27void
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
40void
42{
44
45 checkComponentOfTypeExistsByName<FlowChannel1Phase>(_connected_component_name);
46
48 logError("Passive transport has not been implemented for this Component type.");
49}
50
51void
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}
const std::string name
Definition Setup.h:21
std::string _connected_component_name
Name of the connected component.
Real _normal
Outward normal on this boundary.
const std::vector< BoundaryName > & getBoundaryNames() const
Gets the boundary names for this component.
void logError(Args &&... args) const
Logs an error.
Definition Component.h:226
THMProblem & getTHMProblem() const
Gets the THM problem.
Definition Component.C:135
Factory & _factory
The Factory associated with the MooseApp.
Definition Component.h:497
virtual void check() const
Check the component integrity.
Definition Component.h:416
virtual void addBoundaryCondition(const std::string &bc_name, const std::string &name, InputParameters &parameters)
InputParameters getValidParams(const std::string &name) const
Base class for boundary components connected to FlowChannel1PhaseBase components.
static InputParameters validParams()
virtual void init() override
Initializes the component.
const UserObjectName _boundary_uo_name
Name of boundary user object name.
virtual bool supportsPassiveTransport() const
True if the component supports passive transport variables.
virtual void init() override
Initializes the component.
virtual void check() const override
Check the component integrity.
FlowBoundary1Phase(const InputParameters &params)
std::vector< VariableName > _passives_times_area
Passive transport variables on the connected flow channel.
static InputParameters validParams()
virtual void addWeakBCs()
Creates the boundary condition objects for 1-phase flow.
std::shared_ptr< const FlowModel > _flow_model
Flow model.
Flow model for a single-component, single-phase fluid using the Euler equations.
T & set(const std::string &name, bool quiet_mode=false)
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.
const bool & getImplicitTimeIntegrationFlag()
Gets the flag indicating whether an implicit time integration scheme is being used.
Definition Simulation.h:329
static const std::string RHOEA
Definition THMNames.h:30
static const std::string AREA_LINEAR
Definition THMNames.h:15
static const std::string RHOUA
Definition THMNames.h:31
static const std::string RHOA
Definition THMNames.h:29