https://mooseframework.inl.gov
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
RZSymmetry Class Reference

Interface class for enabling objects to be RZ symmetric about arbitrary axis. More...

#include <RZSymmetry.h>

Inheritance diagram for RZSymmetry:
[legend]

Public Member Functions

 RZSymmetry (const MooseObject *moose_object, const InputParameters &parameters)
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Member Functions

virtual Real computeCircumference (const RealVectorValue &pt)
 

Protected Attributes

RealVectorValue _axis_point
 A point on the axis of symmetry. More...
 
const RealVectorValue_axis_dir
 The direction of the axis of symmetry. More...
 
const Real_offset
 Radial offset of the axis of symmetry. More...
 

Detailed Description

Interface class for enabling objects to be RZ symmetric about arbitrary axis.

Definition at line 19 of file RZSymmetry.h.

Constructor & Destructor Documentation

◆ RZSymmetry()

RZSymmetry::RZSymmetry ( const MooseObject moose_object,
const InputParameters parameters 
)

Definition at line 26 of file RZSymmetry.C.

27  : _axis_point(0., 0., 0.),
28  _axis_dir(parameters.get<RealVectorValue>("axis_dir")),
29  _offset(parameters.get<Real>("offset"))
30 {
31  const FEProblemBase * fe_problem =
32  moose_object->isParamValid("_fe_problem_base")
33  ? moose_object->getParam<FEProblemBase *>("_fe_problem_base")
34  : nullptr;
35  if (fe_problem != nullptr)
36  {
37  const MooseMesh & mesh = fe_problem->mesh();
38 
39  const BlockRestrictable * blk_restr = dynamic_cast<const BlockRestrictable *>(moose_object);
40  const BoundaryRestrictable * bnd_restr =
41  dynamic_cast<const BoundaryRestrictable *>(moose_object);
42 
43  if (blk_restr != nullptr)
44  {
45  const std::set<SubdomainID> & blks = blk_restr->meshBlockIDs();
46 
47  for (auto & b : blks)
48  {
49  if (fe_problem->getCoordSystem(b) != Moose::COORD_XYZ)
50  mooseError(
51  moose_object->name(),
52  ": This is a THM-specific object can be applied only on subdomains with Cartesian "
53  "coordinate system. If your domain has RZ cooridnate system associated with it, you "
54  "need to use the object without the RZ suffix to obtain the desired result.");
55  }
56  }
57  if (bnd_restr != nullptr)
58  {
59  std::set<SubdomainID> blks;
60  const std::set<BoundaryID> & bnds = bnd_restr->boundaryIDs();
61  for (auto & bid : bnds)
62  {
63  std::set<SubdomainID> conn_blks = mesh.getBoundaryConnectedBlocks(bid);
64  for (auto & cb : conn_blks)
65  blks.insert(cb);
66  }
67 
68  for (auto & b : blks)
69  {
70  if (fe_problem->getCoordSystem(b) != Moose::COORD_XYZ)
71  mooseError(
72  moose_object->name(),
73  ": This is a THM-specific object can be applied only on subdomains with Cartesian "
74  "coordinate system. If your domain has RZ cooridnate system associated with it, you "
75  "need to use the object without the RZ suffix to obtain the desired result.");
76  }
77  }
78  }
79 
80  const Point pt = parameters.get<Point>("axis_point");
81  _axis_point = Point(pt(0), pt(1), pt(2));
82 }
const Real & _offset
Radial offset of the axis of symmetry.
Definition: RZSymmetry.h:32
void mooseError(Args &&... args)
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
MeshBase & mesh
virtual const std::string & name() const
bool isParamValid(const std::string &name) const
RealVectorValue _axis_point
A point on the axis of symmetry.
Definition: RZSymmetry.h:28
const T & getParam(const std::string &name) const
const RealVectorValue & _axis_dir
The direction of the axis of symmetry.
Definition: RZSymmetry.h:30
const std::set< SubdomainID > & meshBlockIDs() const
virtual MooseMesh & mesh() override
Moose::CoordinateSystemType getCoordSystem(SubdomainID sid) const
virtual const std::set< BoundaryID > & boundaryIDs() const

Member Function Documentation

◆ computeCircumference()

Real RZSymmetry::computeCircumference ( const RealVectorValue pt)
protectedvirtual

Definition at line 85 of file RZSymmetry.C.

Referenced by LayeredAverageRZ::computeIntegral(), ADHeatStructureEnergyRZ::computeQpIntegral(), HeatRateConvectionRZ::computeQpIntegral(), FunctionElementIntegralRZ::computeQpIntegral(), FunctionSideIntegralRZ::computeQpIntegral(), HeatRateRadiationRZ::computeQpIntegral(), HeatStructureEnergyRZ::computeQpIntegral(), HeatRateExternalAppConvectionRZ::computeQpIntegral(), ADSideFluxIntegralRZ::computeQpIntegral(), SideFluxIntegralRZ::computeQpIntegral(), HeatRateConductionRZ::computeQpIntegral(), HeatRateHeatFluxRZ::computeQpIntegral(), ADElementIntegralMaterialPropertyRZ::computeQpIntegral(), ConvectionHeatTransferRZBC::computeQpJacobian(), RadiativeHeatFluxRZBC::computeQpJacobian(), CoupledForceRZ::computeQpJacobian(), ExternalAppConvectionHeatTransferRZBC::computeQpJacobian(), CoupledForceRZ::computeQpOffDiagJacobian(), ADConvectionHeatTransferRZBC::computeQpResidual(), HeatStructure2DRadiationCouplerRZBC::computeQpResidual(), CoupledForceRZ::computeQpResidual(), ADRadiativeHeatFluxRZBC::computeQpResidual(), RadiativeHeatFluxRZBC::computeQpResidual(), ConvectionHeatTransferRZBC::computeQpResidual(), HeatStructure2DCouplerRZBC::computeQpResidual(), ADHSHeatFluxRZBC::computeQpResidual(), ADHeatStructureHeatSourceRZ::computeQpResidual(), ADExternalAppConvectionHeatTransferRZBC::computeQpResidual(), ExternalAppConvectionHeatTransferRZBC::computeQpResidual(), HSCoupler2D2DRadiationRZBC::computeQpResidual(), LayeredAverageRZ::execute(), ADHeatConductionTimeDerivativeRZ::precomputeQpResidual(), and ADHeatConductionRZ::precomputeQpResidual().

86 {
87  RealVectorValue v = (pt - _axis_point);
88  const Real r = v.cross(_axis_dir).norm() / _axis_dir.norm();
89  return 2 * libMesh::pi * (r + _offset);
90 }
auto norm() const -> decltype(std::norm(Real()))
const Real & _offset
Radial offset of the axis of symmetry.
Definition: RZSymmetry.h:32
RealVectorValue _axis_point
A point on the axis of symmetry.
Definition: RZSymmetry.h:28
const RealVectorValue & _axis_dir
The direction of the axis of symmetry.
Definition: RZSymmetry.h:30
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const std::string v
Definition: NS.h:84
const Real pi

◆ validParams()

InputParameters RZSymmetry::validParams ( )
static

Definition at line 17 of file RZSymmetry.C.

Referenced by ADSideFluxIntegralRZ::validParams(), HeatRateConductionRZ::validParams(), HeatRateHeatFluxRZ::validParams(), SideFluxIntegralRZ::validParams(), ADElementIntegralMaterialPropertyRZ::validParams(), HSCoupler2D2DRadiationRZBC::validParams(), ADConvectionHeatTransferRZBC::validParams(), HeatRateConvectionRZ::validParams(), ADRadiativeHeatFluxRZBC::validParams(), ADHeatStructureEnergyRZ::validParams(), FunctionElementIntegralRZ::validParams(), FunctionSideIntegralRZ::validParams(), ADHeatStructureHeatSourceRZ::validParams(), HeatStructure2DCouplerRZBC::validParams(), ADHeatConductionRZ::validParams(), ADHeatConductionTimeDerivativeRZ::validParams(), HeatStructureEnergyRZ::validParams(), HeatRateRadiationRZ::validParams(), ADHSHeatFluxRZBC::validParams(), ADExternalAppConvectionHeatTransferRZBC::validParams(), RadiativeHeatFluxRZBC::validParams(), ConvectionHeatTransferRZBC::validParams(), CoupledForceRZ::validParams(), ExternalAppConvectionHeatTransferRZBC::validParams(), LayeredAverageRZ::validParams(), HeatRateExternalAppConvectionRZ::validParams(), and HeatStructure2DRadiationCouplerRZBC::validParams().

18 {
20  params.addRequiredParam<Point>("axis_point", "A point on the axis of RZ symmetry.");
21  params.addRequiredParam<RealVectorValue>("axis_dir", "The direction of the axis of RZ symmetry.");
22  params.addParam<Real>("offset", 0., "Radial offset of the axis of RZ symmetry.");
23  return params;
24 }
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
InputParameters emptyInputParameters()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

Member Data Documentation

◆ _axis_dir

const RealVectorValue& RZSymmetry::_axis_dir
protected

The direction of the axis of symmetry.

Definition at line 30 of file RZSymmetry.h.

Referenced by computeCircumference().

◆ _axis_point

RealVectorValue RZSymmetry::_axis_point
protected

A point on the axis of symmetry.

Definition at line 28 of file RZSymmetry.h.

Referenced by computeCircumference(), and RZSymmetry().

◆ _offset

const Real& RZSymmetry::_offset
protected

Radial offset of the axis of symmetry.

Definition at line 32 of file RZSymmetry.h.

Referenced by computeCircumference().


The documentation for this class was generated from the following files: