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 : // MOOSE includes 13 : #include "ActionComponent.h" 14 : #include "ComponentPhysicsInterface.h" 15 : #include "ComponentMaterialPropertyInterface.h" 16 : #include "ComponentInitialConditionInterface.h" 17 : #include "ComponentBoundaryConditionInterface.h" 18 : #include "ComponentMeshTransformHelper.h" 19 : 20 : /** 21 : * Cylinder on which one can define a Physics. The mesh is automatically created 22 : */ 23 : class CylinderComponent : public virtual ActionComponent, 24 : public ComponentPhysicsInterface, 25 : public ComponentMaterialPropertyInterface, 26 : public ComponentInitialConditionInterface, 27 : public ComponentBoundaryConditionInterface, 28 : public ComponentMeshTransformHelper 29 : { 30 : public: 31 : static InputParameters validParams(); 32 : CylinderComponent(const InputParameters & params); 33 : 34 : protected: 35 : virtual void addMeshGenerators() override; 36 : virtual void setupComponent() override; 37 : virtual void checkIntegrity() override; 38 : 39 : /// Radius of the cylinder 40 : const Real _radius; 41 : /// Height of the cylinder 42 : const Real _height; 43 : 44 0 : virtual Real volume() const override { return _height * libMesh::pi * Utility::pow<2>(_radius); } 45 0 : virtual Real outerSurfaceArea() const override 46 : { 47 0 : return 2 * libMesh::pi * (Utility::pow<2>(_radius) + _radius * _height); 48 : } 49 : };