LCOV - code coverage report
Current view: top level - src/ics - FCTFdisplacementIC.C (source / functions) Hit Total Coverage
Test: idaholab/moose subchannel: #33187 (5aa0b2) with base d7c4bd Lines: 41 42 97.6 %
Date: 2026-06-30 12:24:57 Functions: 3 3 100.0 %
Legend: Lines: hit not hit

          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             : #include "FCTFdisplacementIC.h"
      11             : #include "TriSubChannelMesh.h"
      12             : #include "SCM.h"
      13             : 
      14             : registerMooseObject("SubChannelApp", FCTFdisplacementIC);
      15             : 
      16             : InputParameters
      17          12 : FCTFdisplacementIC::validParams()
      18             : {
      19          12 :   InputParameters params = TriSubChannelBaseIC::validParams();
      20          12 :   params.addClassDescription(
      21             :       "This class calculates the displacement of the duct for the areva FCTF");
      22          12 :   return params;
      23           0 : }
      24             : 
      25           6 : FCTFdisplacementIC::FCTFdisplacementIC(const InputParameters & params)
      26           6 :   : TriSubChannelBaseIC(params), _subchannel_mesh(SCM::getConstMesh<SubChannelMesh>(_mesh))
      27             : {
      28           6 : }
      29             : 
      30             : Real
      31       10080 : FCTFdisplacementIC::value(const Point & p)
      32             : {
      33       10080 :   auto L = _mesh.getHeatedLength();
      34       10080 :   auto LIN = _mesh.getHeatedLengthEntry();
      35       10080 :   auto P = _mesh.getPitch();
      36             :   auto Dmax = 0.001064;
      37             :   auto Side = 0.05291;
      38       10080 :   auto i = _mesh.getSubchannelIndexFromPoint(p);
      39       10080 :   auto subch_type = _mesh.getSubchannelType(i);
      40       10080 :   auto x = p(0);
      41       10080 :   auto y = p(1);
      42       10080 :   auto z = p(2);
      43             : 
      44       10080 :   if (subch_type == EChannelType::EDGE)
      45             :   {
      46        1920 :     if ((y > 2.0 * sqrt(3) * P) && ((LIN + L) >= z) && z >= LIN) // TOP
      47             :     {
      48         128 :       return ((Dmax / 2.0) * cos(x * pi / (Side / 2.0)) + Dmax / 2) * sin(((z - LIN) / (L)) * pi);
      49             :     }
      50        1792 :     else if ((y < -2.0 * sqrt(3) * P) && ((LIN + L) >= z) && z >= LIN) // BOTTOM
      51             :     {
      52         128 :       return ((Dmax / 2.0) * cos(x * pi / (Side / 2.0)) + Dmax / 2) * sin(((z - LIN) / (L)) * pi);
      53             :     }
      54        1664 :     else if (y > sqrt(3) * x + sqrt(3) * 4.0 * P && ((LIN + L) >= z) && z >= LIN) // TOP LEFT
      55             :     {
      56         128 :       auto xprime = x * cos(pi / 3.0) + y * sin(pi / 3.0);
      57         128 :       return ((Dmax / 2.0) * cos(xprime * pi / (Side / 2.0)) + Dmax / 2) *
      58         128 :              sin(((z - LIN) / (L)) * pi);
      59             :     }
      60        1536 :     else if (y < -sqrt(3) * x - sqrt(3) * 4.0 * P && ((LIN + L) >= z) && z >= LIN) // BOTTOM LEFT
      61             :     {
      62         128 :       auto xprime = x * cos(2.0 * pi / 3.0) + y * sin(2.0 * pi / 3.0);
      63         128 :       return ((Dmax / 2.0) * cos(xprime * pi / (Side / 2.0)) + Dmax / 2) *
      64         128 :              sin(((z - LIN) / (L)) * pi);
      65             :     }
      66        1408 :     else if (y < sqrt(3) * x - sqrt(3) * 4.0 * P && ((LIN + L) >= z) && z >= LIN) // BOTTOM RIGHT
      67             :     {
      68         128 :       auto xprime = x * cos(4.0 * pi / 3.0) + y * sin(4.0 * pi / 3.0);
      69         128 :       return ((Dmax / 2.0) * cos(xprime * pi / (Side / 2.0)) + Dmax / 2) *
      70         128 :              sin(((z - LIN) / (L)) * pi);
      71             :     }
      72        1280 :     else if (y > -sqrt(3) * x + sqrt(3) * 4.0 * P && ((LIN + L) >= z) && z >= LIN) // TOP RIGHT
      73             :     {
      74         128 :       auto xprime = x * cos(5.0 * pi / 3.0) + y * sin(5.0 * pi / 3.0);
      75         128 :       return ((Dmax / 2.0) * cos(xprime * pi / (Side / 2.0)) + Dmax / 2) *
      76         128 :              sin(((z - LIN) / (L)) * pi);
      77             :     }
      78             :     else
      79             :     {
      80             :       return 0.0;
      81             :     }
      82             :   }
      83        8160 :   else if (subch_type == EChannelType::CORNER)
      84             :   {
      85         480 :     auto xprime = P + Side / 4.0;
      86         480 :     return ((Dmax / 2.0) * cos(xprime * pi / (Side / 2.0)) + Dmax / 2) *
      87         480 :            sin(((z - LIN) / (L)) * pi);
      88             :   }
      89             :   else
      90             :   {
      91             :     return 0.0;
      92             :   }
      93             : }

Generated by: LCOV version 1.14