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 227 : 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 : virtual Convergence * getNonlinearConvergence() const override; 55 : 56 : void 57 : loadMaterial(InputParameters & pars, const std::string & par, const std::string & material_name); 58 : 59 : /// Adds a PP for the average element size on a block 60 : void addAverageElementSizePostprocessor(const SubdomainName & block); 61 : /// Adds a residual norm PP for a block 62 : void addResidualNormPostprocessor(const SubdomainName & block, 63 : const UserObjectName & sp_name, 64 : Real T_ref); 65 : 66 : /** 67 : * Adds a ADConstantDensityThermalSolidPropertiesMaterial for a heat structure region 68 : * 69 : * @param[in] sp_name Solid properties object name 70 : * @param[in] T_ref Constant density reference temperature 71 : * @param[in] i_region Heat structure region index 72 : */ 73 : void addConstantDensitySolidPropertiesMaterial(const UserObjectName & sp_name, 74 : const Real & T_ref, 75 : unsigned int i_region) const; 76 : 77 : /// Map from block name to block index 78 : std::map<std::string, unsigned int> _name_index; 79 : /// The number of rods represented by this heat structure 80 : Real _num_rods; 81 : 82 : // This reference should be deleted after applications start using _n_regions: 83 : unsigned int & _number_of_hs; 84 : 85 : public: 86 : static InputParameters validParams(); 87 : };