Line data Source code
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 "Component2D.h" 13 : #include "HeatStructureInterface.h" 14 : #include "HeatConductionModel.h" 15 : 16 : /** 17 : * Base class for 2D generated heat structures 18 : */ 19 : class HeatStructureBase : public Component2D, public HeatStructureInterface 20 : { 21 : public: 22 : HeatStructureBase(const InputParameters & params); 23 : 24 : virtual void addVariables() override; 25 : virtual void addMooseObjects() override; 26 : 27 : /** 28 : * Get index of the block from its name 29 : * @param name The name of the block 30 : * @return Index of the block with name 'name' 31 : */ 32 : const unsigned int & getIndexFromName(const std::string & name) const; 33 : 34 : /** 35 : * Gets the perimeter of one unit of this heat structure on the specified side 36 : * 37 : * @param[in] side Side of the heat structure corresponding to desired perimeter 38 : * @returns Perimeter of one unit of this heat structure on the specified side 39 : */ 40 : virtual Real getUnitPerimeter(const ExternalBoundaryType & side) const = 0; 41 : 42 : /** 43 : * Gets the number of units that heat structure represents 44 : * 45 : * @param[in] side Side of the heat structure corresponding to desired perimeter 46 : * @returns Perimeter of one unit of this heat structure on the specified side 47 : */ 48 488 : Real getNumberOfUnits() const { return _num_rods; } 49 : 50 : protected: 51 : virtual void init() override; 52 : virtual void check() const override; 53 : virtual bool usingSecondOrderMesh() const override; 54 : 55 : void 56 : loadMaterial(InputParameters & pars, const std::string & par, const std::string & material_name); 57 : 58 : /** 59 : * Adds a ADConstantDensityThermalSolidPropertiesMaterial for a heat structure region 60 : * 61 : * @param[in] sp_name Solid properties object name 62 : * @param[in] T_ref Constant density reference temperature 63 : * @param[in] i_region Heat structure region index 64 : */ 65 : void addConstantDensitySolidPropertiesMaterial(const UserObjectName & sp_name, 66 : const Real & T_ref, 67 : unsigned int i_region) const; 68 : 69 : /// Map from block name to block index 70 : std::map<std::string, unsigned int> _name_index; 71 : /// Material names 72 : std::vector<std::string> _material_names; 73 : /// The number of rods represented by this heat structure 74 : Real _num_rods; 75 : 76 : // This reference should be deleted after applications start using _n_regions: 77 : unsigned int & _number_of_hs; 78 : 79 : public: 80 : static InputParameters validParams(); 81 : };