https://mooseframework.inl.gov
HeatStructurePlate.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 "HeatStructurePlate.h"
11 
12 registerMooseObject("ThermalHydraulicsApp", HeatStructurePlate);
13 
16 {
18 
19  params.addRequiredParam<std::vector<std::string>>("names", "Name of each transverse region");
20  params.addRequiredParam<std::vector<Real>>("widths", "Width of each transverse region [m]");
21  params.addRequiredParam<std::vector<unsigned int>>(
22  "n_part_elems", "Number of elements of each transverse region");
23  params.addDeprecatedParam<std::vector<std::string>>(
24  "materials",
25  "Material name for each transverse region",
26  "HeatStructureMaterials are deprecated. Please make corresponding SolidProperties objects "
27  "and replace the heat structure parameter 'materials' with the parameters 'solid_properties' "
28  "and 'solid_properties_T_ref'. See heat structure documentation for more information.");
29  params.addParam<std::vector<UserObjectName>>(
30  "solid_properties", "Solid properties object name for each radial region");
31  params.addParam<std::vector<Real>>(
32  "solid_properties_T_ref",
33  {},
34  "Density reference temperatures for each radial region. This is required if "
35  "'solid_properties' is provided. The density in each region will be a constant value "
36  "computed by evaluating the density function at the reference temperature.");
37  params.addParam<Real>("num_rods", 1.0, "Number of rods represented by this heat structure");
38  params.addRequiredParam<Real>("depth", "Dimension of plate fuel in the third direction [m]");
39 
40  params.addClassDescription("Plate heat structure");
41 
42  return params;
43 }
44 
46  : HeatStructureBase(params), _depth(getParam<Real>("depth"))
47 {
48  _names = getParam<std::vector<std::string>>("names");
49  _n_regions = _names.size();
50  for (unsigned int i = 0; i < _names.size(); i++)
51  _name_index[_names[i]] = i;
52 
53  _material_names = isParamValid("materials") ? getParam<std::vector<std::string>>("materials")
54  : std::vector<std::string>{};
55 
56  _width = getParam<std::vector<Real>>("widths");
57  _total_width = std::accumulate(_width.begin(), _width.end(), 0.0);
58 
59  _n_part_elems = getParam<std::vector<unsigned int>>("n_part_elems");
60  for (unsigned int i = 0; i < _n_part_elems.size(); i++)
62 
63  _num_rods = getParam<Real>("num_rods");
64 
65  if (_width.size() == _n_regions)
66  {
67  for (unsigned int i = 0; i < _n_regions; i++)
68  _volume.push_back(_num_rods * _width[i] * _depth * _length);
69  }
70 }
71 
72 void
74 {
76 
77  checkEqualSize<std::string, unsigned int>("names", "n_part_elems");
78  checkEqualSize<std::string, Real>("names", "widths");
79  if (isParamValid("materials"))
80  checkEqualSize<std::string, std::string>("names", "materials");
81  if (isParamValid("solid_properties"))
82  {
83  checkEqualSize<UserObjectName, std::string>("solid_properties", "names");
84  checkEqualSize<UserObjectName, Real>("solid_properties", "solid_properties_T_ref");
85  }
86  checkMutuallyExclusiveParameters({"materials", "solid_properties"}, false);
87 }
88 
89 Real
91 {
92  switch (side)
93  {
96  return _depth;
97 
100  return std::numeric_limits<Real>::quiet_NaN();
101  }
102 
103  mooseError(name(), ": Unknown value of 'side' parameter.");
104 }
105 
106 Real
107 HeatStructurePlate::computeRadialBoundaryArea(const Real & length, const Real & /*y*/) const
108 {
109  return length * _depth;
110 }
111 
112 Real
113 HeatStructurePlate::computeAxialBoundaryArea(const Real & y_min, const Real & y_max) const
114 {
115  return (y_max - y_min) * _depth;
116 }
void addDeprecatedParam(const std::string &name, const T &value, const std::string &doc_string, const std::string &deprecation_message)
std::vector< Real > _volume
Volume of each transverse region.
Definition: Component2D.h:165
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
const Real & _depth
plate fuel depth
std::vector< std::string > _material_names
Material names.
ExternalBoundaryType
External boundary type.
Definition: Component2D.h:18
Real _num_rods
The number of rods represented by this heat structure.
virtual const std::string & name() const
void addRequiredParam(const std::string &name, const std::string &doc_string)
bool isParamValid(const std::string &name) const
Real _total_width
Total width of all transverse regions.
Definition: Component2D.h:163
unsigned int _total_elem_number
Total number of transverse elements.
Definition: Component2D.h:169
unsigned int _n_regions
Number of transverse regions.
Definition: Component2D.h:157
virtual void check() const override
Check the component integrity.
std::vector< std::string > _names
Names of each transverse region.
Definition: Component2D.h:159
std::vector< unsigned int > _n_part_elems
Number of elements in each transverse region.
Definition: Component2D.h:167
HeatStructurePlate(const InputParameters &params)
virtual Real computeRadialBoundaryArea(const Real &length, const Real &y) const override
Computes the area of a radial boundary.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static InputParameters validParams()
std::vector< Real > _width
Width of each transverse region.
Definition: Component2D.h:161
static InputParameters validParams()
Component to model plate heat structure.
virtual void check() const override
Check the component integrity.
Base class for 2D generated heat structures.
void mooseError(Args &&... args) const
void addClassDescription(const std::string &doc_string)
virtual Real getUnitPerimeter(const ExternalBoundaryType &side) const override
Gets the perimeter of one unit of this heat structure on the specified side.
registerMooseObject("ThermalHydraulicsApp", HeatStructurePlate)
virtual Real computeAxialBoundaryArea(const Real &y_min, const Real &y_max) const override
Computes the area of an axial boundary.
std::map< std::string, unsigned int > _name_index
Map from block name to block index.
void checkMutuallyExclusiveParameters(const std::vector< std::string > &params, bool need_one_specified=true) const
Checks that exactly one parameter out of a list is provided.
Definition: Component.C:246