LCOV - code coverage report
Current view: top level - src/mesh - HexagonalSubchannelMeshBase.C (source / functions) Hit Total Coverage
Test: neams-th-coe/cardinal: be601f Lines: 28 28 100.0 %
Date: 2025-07-15 20:50:38 Functions: 3 3 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /********************************************************************/
       2             : /*                  SOFTWARE COPYRIGHT NOTIFICATION                 */
       3             : /*                             Cardinal                             */
       4             : /*                                                                  */
       5             : /*                  (c) 2021 UChicago Argonne, LLC                  */
       6             : /*                        ALL RIGHTS RESERVED                       */
       7             : /*                                                                  */
       8             : /*                 Prepared by UChicago Argonne, LLC                */
       9             : /*               Under Contract No. DE-AC02-06CH11357               */
      10             : /*                With the U. S. Department of Energy               */
      11             : /*                                                                  */
      12             : /*             Prepared by Battelle Energy Alliance, LLC            */
      13             : /*               Under Contract No. DE-AC07-05ID14517               */
      14             : /*                With the U. S. Department of Energy               */
      15             : /*                                                                  */
      16             : /*                 See LICENSE for full restrictions                */
      17             : /********************************************************************/
      18             : 
      19             : #include "HexagonalSubchannelMeshBase.h"
      20             : 
      21             : const Real HexagonalSubchannelMeshBase::COS30 = std::sqrt(3.0) / 2.0;
      22             : const Real HexagonalSubchannelMeshBase::SIN30 = 0.5;
      23             : const unsigned int HexagonalSubchannelMeshBase::NODES_PER_PRISM = 6;
      24             : const unsigned int HexagonalSubchannelMeshBase::NUM_SIDES = 6;
      25             : 
      26             : InputParameters
      27         368 : HexagonalSubchannelMeshBase::validParams()
      28             : {
      29         368 :   InputParameters params = MooseMesh::validParams();
      30         736 :   params.addRequiredRangeCheckedParam<Real>(
      31             :       "bundle_pitch", "bundle_pitch > 0", "Bundle pitch, or flat-to-flat distance across bundle");
      32         736 :   params.addRequiredRangeCheckedParam<Real>(
      33             :       "pin_pitch", "pin_pitch > 0", "Pin pitch, or distance between pin centers");
      34         736 :   params.addRequiredRangeCheckedParam<Real>(
      35             :       "pin_diameter", "pin_diameter > 0", "Pin outer diameter");
      36         736 :   params.addRequiredRangeCheckedParam<unsigned int>(
      37             :       "n_rings", "n_rings >= 1", "Number of pin rings, including the centermost pin as a 'ring'");
      38             : 
      39         736 :   MooseEnum directions("x y z", "z");
      40         736 :   params.addParam<MooseEnum>(
      41             :       "axis", directions, "vertical axis of the reactor (x, y, or z) along which pins are aligned");
      42         368 :   return params;
      43         368 : }
      44             : 
      45         184 : HexagonalSubchannelMeshBase::HexagonalSubchannelMeshBase(const InputParameters & parameters)
      46             :   : MooseMesh(parameters),
      47         184 :     _bundle_pitch(getParam<Real>("bundle_pitch")),
      48         368 :     _pin_pitch(getParam<Real>("pin_pitch")),
      49         368 :     _pin_diameter(getParam<Real>("pin_diameter")),
      50         368 :     _n_rings(getParam<unsigned int>("n_rings")),
      51         184 :     _axis(parameters.get<MooseEnum>("axis")),
      52         184 :     _hex_lattice(HexagonalLatticeUtils(
      53         184 :         _bundle_pitch,
      54         184 :         _pin_pitch,
      55         184 :         _pin_diameter,
      56             :         0.0 /* wire diameter not needed for subchannel mesh, use dummy value */,
      57             :         1.0 /* wire pitch not needed for subchannel mesh, use dummy value */,
      58         184 :         _n_rings,
      59             :         _axis)),
      60         184 :     _pin_centers(_hex_lattice.pinCenters())
      61             : {
      62         184 : }
      63             : 
      64             : const Point
      65      213912 : HexagonalSubchannelMeshBase::rotatePoint(const Point & p, const Real & theta) const
      66             : {
      67      213912 :   Real x = p(0);
      68      213912 :   Real y = p(1);
      69             :   Point rotation(
      70      213912 :       x * std::cos(theta) - y * std::sin(theta), x * std::sin(theta) + y * std::cos(theta), 0.0);
      71      213912 :   return rotation;
      72             : }

Generated by: LCOV version 1.14