https://mooseframework.inl.gov
Loading...
Searching...
No Matches
FlowChannelBase.h
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#pragma once
11
12#include "Component1D.h"
13#include "GravityInterface.h"
14
15class ClosuresBase;
16
24public:
25 FlowChannelBase(const InputParameters & params);
49 static const std::map<std::string, EConvHeatTransGeom> _heat_transfer_geom_to_enum;
51 static const std::map<std::string, EPipeType> _pipe_type_to_enum;
53 static const std::map<std::string, EPipeLocation> _pipe_location_to_enum;
54
55 virtual void addVariables() override;
56 virtual void addMooseObjects() override;
57
63 virtual const Real & getGravityAngle() const { return _gravity_angle; }
64
68 const UserObjectName & getFluidPropertiesName() const { return _fp_name; }
69
73 virtual const THM::FlowModelID & getFlowModelID() const = 0;
74
81 static MooseEnum getConvHeatTransGeometry(const std::string & name);
82
89 static MooseEnum getPipeType(const std::string & name);
90
97 static MooseEnum getPipeLocation(const std::string & name);
98
99 // Flow channel specific interface ----
100 virtual std::shared_ptr<const FlowModel> getFlowModel() const;
101
107 const FunctionName & getAreaFunctionName() const;
108
112 virtual FunctionName createAreaFunctionAndGetName();
113
118
123
127 std::vector<std::string> getHeatTransferNames() const;
128
132 bool getTemperatureMode() const { return _temperature_mode; }
133
138
142 std::vector<VariableName> getHeatedPerimeterNames() const { return _P_hf_names; }
143
147 std::vector<VariableName> getWallTemperatureNames() const { return _T_wall_names; }
148 std::vector<MaterialPropertyName> getWallTemperatureMatNames() const { return _T_wall_mat_names; }
149
153 std::vector<MaterialPropertyName> getWallHeatFluxNames() const { return _q_wall_names; }
154
164 void addHeatTransferName(const std::string & ht_name) const;
165
178 std::string getHeatTransferNamesSuffix(const std::string & ht_name) const;
179
185 std::vector<std::shared_ptr<ClosuresBase>> getClosuresObjects() const
186 {
187 return _closures_objects;
188 }
189
190protected:
191 virtual std::shared_ptr<FlowModel> buildFlowModel() = 0;
192 virtual void init() override;
193 virtual void initSecondary() override;
194 virtual void check() const override;
195
199 virtual void addCommonObjects();
200
204 virtual void getHeatTransferVariableNames();
205
207 std::shared_ptr<FlowModel> _flow_model;
208
210 const UserObjectName & _fp_name;
211
213 const Real _gravity_angle;
214
216 FunctionName _area_function;
217
219 std::vector<std::shared_ptr<ClosuresBase>> _closures_objects;
220
222
224 const Real & _roughness;
225
231 const Real & _PoD;
234
238 mutable std::vector<std::string> _heat_transfer_names;
240 mutable unsigned int _n_heat_transfer_connections;
241
243 std::vector<MaterialPropertyName> _Hw_1phase_names;
245 std::vector<MaterialPropertyName> _Hw_liquid_names;
247 std::vector<MaterialPropertyName> _Hw_vapor_names;
249 std::vector<VariableName> _P_hf_names;
251 std::vector<VariableName> _T_wall_names;
253 std::vector<MaterialPropertyName> _T_wall_mat_names;
255 std::vector<MaterialPropertyName> _q_wall_names;
256
257public:
259};
260
261namespace THM
262{
263template <>
265
266template <>
268
269template <>
271}
const std::string name
Definition Setup.h:21
Base class for closures implementations.
Base class for 1D components.
Definition Component1D.h:19
A base class for flow channels.
virtual void check() const override
Check the component integrity.
std::vector< VariableName > getHeatedPerimeterNames() const
Gets heated perimeter names for connected heat transfers.
static MooseEnum getConvHeatTransGeometry(const std::string &name)
Gets a MooseEnum for convective heat transfer geometry type.
std::vector< VariableName > _P_hf_names
heated perimeter names for connected heat transfers
std::vector< std::shared_ptr< ClosuresBase > > getClosuresObjects() const
Get the used closures object(s)
FunctionName _area_function
Function describing the flow channel area.
std::vector< MaterialPropertyName > getWallHeatFluxNames() const
Gets wall heat flux names for connected heat transfers.
virtual void init() override
Initializes the component.
EPipeLocation _pipe_location
Pipe location within the bundle.
virtual std::shared_ptr< FlowModel > buildFlowModel()=0
std::vector< std::shared_ptr< ClosuresBase > > _closures_objects
Closures object(s)
EConvHeatTransGeom
Type of convective heat transfer geometry.
@ ROD_BUNDLE
square array rod bundle geometry
@ HEX_ROD_BUNDLE
hexagonal array rod bundle geometry
@ PIPE
pipe geometry
const FunctionName & getAreaFunctionName() const
Get the name of the function describing the flow channel area.
EPipeLocation getPipeLocation() const
Gets the pipe location.
EConvHeatTransGeom _HT_geometry
Convective Heat transfer geometry.
std::shared_ptr< FlowModel > _flow_model
The flow model used by this flow channel.
virtual FunctionName createAreaFunctionAndGetName()
Creates the area function if needed and then stores the name.
static MooseEnum getPipeType(const std::string &name)
Gets a MooseEnum for pipe type.
const bool & _pipe_pars_transferred
std::vector< MaterialPropertyName > getWallTemperatureMatNames() const
std::vector< std::string > getHeatTransferNames() const
Gets the names of all connected heat transfer components.
std::vector< MaterialPropertyName > _q_wall_names
wall heat flux names for connected heat transfers
unsigned int getNumberOfHeatTransferConnections() const
Gets the number of heat transfer connections.
unsigned int _n_heat_transfer_connections
Number of connected heat transfer components.
const UserObjectName & getFluidPropertiesName() const
Gets the name of the fluid properties user object for this component.
void addHeatTransferName(const std::string &ht_name) const
Adds the name of a heat transfer component to the flow channel's list.
std::vector< MaterialPropertyName > _Hw_liquid_names
liquid wall heat transfer coefficient names for connected heat transfers
std::vector< VariableName > _T_wall_names
wall temperature auxvariable names for connected heat transfers
virtual const Real & getGravityAngle() const
Gets the gravity angle for this component.
virtual void initSecondary() override
Perform secondary initialization, which relies on init() being called for all components.
static const std::map< std::string, EPipeLocation > _pipe_location_to_enum
Map of pipe location to enum.
std::vector< MaterialPropertyName > _Hw_1phase_names
1-phase wall heat transfer coefficient names for connected heat transfers
std::vector< VariableName > getWallTemperatureNames() const
Gets wall temperature names for connected heat transfers.
EConvHeatTransGeom getHeatTransferGeometry() const
Gets heat transfer geometry.
static const std::map< std::string, EConvHeatTransGeom > _heat_transfer_geom_to_enum
Map of convective heat transfer geometry type to enum.
EPipeLocation
Pipe location.
std::string getHeatTransferNamesSuffix(const std::string &ht_name) const
Gets suffix to add to heat-transfer-related names in a heat transfer component.
const Real & _roughness
Roughness of flow channel surface, [m].
virtual void addCommonObjects()
Adds objects which are common for single- and two-phase flow.
static InputParameters validParams()
virtual void addVariables() override
virtual std::shared_ptr< const FlowModel > getFlowModel() const
virtual const THM::FlowModelID & getFlowModelID() const =0
Gets the flow model ID.
static const std::map< std::string, EPipeType > _pipe_type_to_enum
Map of pipe type to enum.
const Real _gravity_angle
Angle between orientation vector and gravity vector, in degrees.
bool getTemperatureMode() const
Gets temperature mode flag.
std::vector< MaterialPropertyName > _T_wall_mat_names
wall temperature material names for connected heat transfers
std::vector< std::string > _heat_transfer_names
Names of the heat transfer components connected to this component.
const UserObjectName & _fp_name
Name of fluid properties user object.
virtual void addMooseObjects() override
bool _temperature_mode
True if there is one or more sources specified by wall temperature.
bool _has_PoD
True if user provides PoD.
virtual void getHeatTransferVariableNames()
Populates heat connection variable names lists.
const Real & _PoD
Pitch to diameter ratio for parallel bundle heat transfer.
std::vector< MaterialPropertyName > _Hw_vapor_names
vapor wall heat transfer coefficient names for connected heat transfers
Interface for specifying gravity at the component level.
Component1DConnection::EEndType stringToEnum(const std::string &s)
unsigned int FlowModelID