https://mooseframework.inl.gov
Loading...
Searching...
No Matches
FlowJunction1Phase.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 "FlowJunction1Phase.h"
11#include "FlowChannel1Phase.h"
12
19
21
22void
24{
26
27 for (const auto i : index_range(_connections))
28 {
29 const std::string comp_name = _connections[i]._component_name;
30 if (hasComponentByName<FlowChannel1Phase>(comp_name))
31 {
32 const FlowChannel1Phase & comp =
34
36
37 if (i == 0)
38 _passives_names = comp.getParam<std::vector<VariableName>>("passives_names");
39 else if (comp.getParam<std::vector<VariableName>>("passives_names") != _passives_names)
40 logError("All connected channels must have the same 'passives_names' parameter.");
41 }
42 }
43}
44
45void
47{
49
50 for (const auto & comp_name : _connected_component_names)
51 checkComponentOfTypeExistsByName<FlowChannel1Phase>(comp_name);
52
53 if (_passives_names.size() > 0 && !supportsPassiveTransport())
54 logError("This Component type does not support passive transport.");
55}
std::vector< std::string > _connected_component_names
Vector of connected component names.
std::vector< Connection > _connections
Vector of connections of 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
const UserObjectName & getNumericalFluxUserObjectName() const
Gets the numerical flux user object name.
Single-component, single-phase flow channel.
FlowJunction1Phase(const InputParameters &params)
virtual bool supportsPassiveTransport() const
std::vector< UserObjectName > _numerical_flux_names
std::vector< VariableName > _passives_names
Passive transport variables on the connected flow channels.
virtual void check() const override
Check the component integrity.
virtual void init() override
Initializes the component.
static InputParameters validParams()
Base class for flow junctions.
static InputParameters validParams()
virtual void init() override
Initializes the component.
virtual void check() const override
Check the component integrity.
const T & getParam(const std::string &name) const
const T & getComponentByName(const std::string &name) const
Get component by its name.
Definition Simulation.h:504