https://mooseframework.inl.gov
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 
15 class ClosuresBase;
16 
23 {
24 public:
25  FlowChannelBase(const InputParameters & params);
26 
29  {
30  PIPE,
33  };
35  enum EPipeType
36  {
40  };
43  {
47  };
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 
190 protected:
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 
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;
233  bool _has_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 
257 public:
258  static InputParameters validParams();
259 };
260 
261 namespace THM
262 {
263 template <>
265 
266 template <>
267 FlowChannelBase::EPipeType stringToEnum(const std::string & s);
268 
269 template <>
270 FlowChannelBase::EPipeLocation stringToEnum(const std::string & s);
271 }
EPipeLocation _pipe_location
Pipe location within the bundle.
unsigned int FlowModelID
const FunctionName & getAreaFunctionName() const
Get the name of the function describing the flow channel area.
EConvHeatTransGeom _HT_geometry
Convective Heat transfer geometry.
virtual void init() override
Initializes the component.
virtual const Real & getGravityAngle() const
Gets the gravity angle for this component.
const Real _gravity_angle
Angle between orientation vector and gravity vector, in degrees.
Component1DConnection::EEndType stringToEnum(const std::string &s)
std::vector< VariableName > getHeatedPerimeterNames() const
Gets heated perimeter names for connected heat transfers.
bool _has_PoD
True if user provides PoD.
static InputParameters validParams()
std::shared_ptr< FlowModel > _flow_model
The flow model used by this flow channel.
virtual std::shared_ptr< FlowModel > buildFlowModel()=0
EPipeLocation
Pipe location.
std::vector< VariableName > _P_hf_names
heated perimeter names for connected heat transfers
EConvHeatTransGeom getHeatTransferGeometry() const
Gets heat transfer geometry.
std::vector< std::shared_ptr< ClosuresBase > > getClosuresObjects() const
Get the used closures object(s)
unsigned int getNumberOfHeatTransferConnections() const
Gets the number of heat transfer connections.
hexagonal array rod bundle geometry
const bool & _pipe_pars_transferred
bool _temperature_mode
True if there is one or more sources specified by wall temperature.
std::vector< MaterialPropertyName > _Hw_vapor_names
vapor wall heat transfer coefficient names for connected heat transfers
const Real & _PoD
Pitch to diameter ratio for parallel bundle heat transfer.
Interface for specifying gravity at the component level.
static const std::map< std::string, EPipeType > _pipe_type_to_enum
Map of pipe type to enum.
A base class for flow channels.
std::vector< VariableName > getWallTemperatureNames() const
Gets wall temperature names for connected heat transfers.
EPipeType
Pipe type.
static MooseEnum getPipeType(const std::string &name)
Gets a MooseEnum for pipe type.
std::vector< MaterialPropertyName > getWallHeatFluxNames() const
Gets wall heat flux names for connected heat transfers.
virtual const std::string & name() const
virtual std::shared_ptr< const FlowModel > getFlowModel() const
std::vector< MaterialPropertyName > _q_wall_names
wall heat flux names for connected heat transfers
Base class for closures implementations.
Definition: ClosuresBase.h:28
EConvHeatTransGeom
Type of convective heat transfer geometry.
std::vector< std::string > _heat_transfer_names
Names of the heat transfer components connected to this component.
unsigned int _n_heat_transfer_connections
Number of connected heat transfer components.
std::vector< MaterialPropertyName > getWallTemperatureMatNames() const
std::vector< std::string > getHeatTransferNames() const
Gets the names of all connected heat transfer components.
void addHeatTransferName(const std::string &ht_name) const
Adds the name of a heat transfer component to the flow channel&#39;s list.
EPipeLocation getPipeLocation() const
Gets the pipe location.
Base class for 1D components.
Definition: Component1D.h:18
virtual void getHeatTransferVariableNames()
Populates heat connection variable names lists.
FunctionName _area_function
Function describing the flow channel area.
const UserObjectName & _fp_name
Name of fluid properties user object.
virtual void addVariables() override
std::vector< std::shared_ptr< ClosuresBase > > _closures_objects
Closures object(s)
virtual void addMooseObjects() override
std::vector< VariableName > _T_wall_names
wall temperature auxvariable names for connected heat transfers
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const std::map< std::string, EPipeLocation > _pipe_location_to_enum
Map of pipe location to enum.
virtual void check() const override
Check the component integrity.
std::vector< MaterialPropertyName > _Hw_liquid_names
liquid wall heat transfer coefficient names for connected heat transfers
std::vector< MaterialPropertyName > _T_wall_mat_names
wall temperature material names for connected heat transfers
std::string getHeatTransferNamesSuffix(const std::string &ht_name) const
Gets suffix to add to heat-transfer-related names in a heat transfer component.
FlowChannelBase(const InputParameters &params)
static MooseEnum getConvHeatTransGeometry(const std::string &name)
Gets a MooseEnum for convective heat transfer geometry type.
std::vector< MaterialPropertyName > _Hw_1phase_names
1-phase wall heat transfer coefficient names for connected heat transfers
virtual void initSecondary() override
Perform secondary initialization, which relies on init() being called for all components.
bool getTemperatureMode() const
Gets temperature mode flag.
square array rod bundle geometry
virtual FunctionName createAreaFunctionAndGetName()
Creates the area function if needed and then stores the name.
virtual void addCommonObjects()
Adds objects which are common for single- and two-phase flow.
const Real & _roughness
Roughness of flow channel surface, [m].
virtual const THM::FlowModelID & getFlowModelID() const =0
Gets the flow model ID.
static const std::map< std::string, EConvHeatTransGeom > _heat_transfer_geom_to_enum
Map of convective heat transfer geometry type to enum.
const UserObjectName & getFluidPropertiesName() const
Gets the name of the fluid properties user object for this component.