LCOV - code coverage report
Current view: top level - src/ics - FCTFdisplacementIC.C (source / functions) Hit Total Coverage
Test: idaholab/moose subchannel: #32971 (54bef8) with base c6cf66 Lines: 41 42 97.6 %
Date: 2026-05-29 20:40:47 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          15 : FCTFdisplacementIC::validParams()
      18             : {
      19          15 :   InputParameters params = TriSubChannelBaseIC::validParams();
      20          15 :   params.addClassDescription(
      21             :       "This class calculates the displacement of the duct for the areva FCTF");
      22          15 :   return params;
      23           0 : }
      24             : 
      25           8 : FCTFdisplacementIC::FCTFdisplacementIC(const InputParameters & params)
      26           8 :   : TriSubChannelBaseIC(params), _subchannel_mesh(SCM::getConstMesh<SubChannelMesh>(_mesh))
      27             : {
      28           8 : }
      29             : 
      30             : Real
      31       12600 : FCTFdisplacementIC::value(const Point & p)
      32             : {
      33       12600 :   auto L = _mesh.getHeatedLength();
      34       12600 :   auto LIN = _mesh.getHeatedLengthEntry();
      35       12600 :   auto P = _mesh.getPitch();
      36             :   auto Dmax = 0.001064;
      37             :   auto Side = 0.05291;
      38       12600 :   auto i = _mesh.getSubchannelIndexFromPoint(p);
      39       12600 :   auto subch_type = _mesh.getSubchannelType(i);
      40       12600 :   auto x = p(0);
      41       12600 :   auto y = p(1);
      42       12600 :   auto z = p(2);
      43             : 
      44       12600 :   if (subch_type == EChannelType::EDGE)
      45             :   {
      46        2400 :     if ((y > 2.0 * sqrt(3) * P) && ((LIN + L) >= z) && z >= LIN) // TOP
      47             :     {
      48         160 :       return ((Dmax / 2.0) * cos(x * pi / (Side / 2.0)) + Dmax / 2) * sin(((z - LIN) / (L)) * pi);
      49             :     }
      50        2240 :     else if ((y < -2.0 * sqrt(3) * P) && ((LIN + L) >= z) && z >= LIN) // BOTTOM
      51             :     {
      52         160 :       return ((Dmax / 2.0) * cos(x * pi / (Side / 2.0)) + Dmax / 2) * sin(((z - LIN) / (L)) * pi);
      53             :     }
      54        2080 :     else if (y > sqrt(3) * x + sqrt(3) * 4.0 * P && ((LIN + L) >= z) && z >= LIN) // TOP LEFT
      55             :     {
      56         160 :       auto xprime = x * cos(pi / 3.0) + y * sin(pi / 3.0);
      57         160 :       return ((Dmax / 2.0) * cos(xprime * pi / (Side / 2.0)) + Dmax / 2) *
      58         160 :              sin(((z - LIN) / (L)) * pi);
      59             :     }
      60        1920 :     else if (y < -sqrt(3) * x - sqrt(3) * 4.0 * P && ((LIN + L) >= z) && z >= LIN) // BOTTOM LEFT
      61             :     {
      62         160 :       auto xprime = x * cos(2.0 * pi / 3.0) + y * sin(2.0 * pi / 3.0);
      63         160 :       return ((Dmax / 2.0) * cos(xprime * pi / (Side / 2.0)) + Dmax / 2) *
      64         160 :              sin(((z - LIN) / (L)) * pi);
      65             :     }
      66        1760 :     else if (y < sqrt(3) * x - sqrt(3) * 4.0 * P && ((LIN + L) >= z) && z >= LIN) // BOTTOM RIGHT
      67             :     {
      68         160 :       auto xprime = x * cos(4.0 * pi / 3.0) + y * sin(4.0 * pi / 3.0);
      69         160 :       return ((Dmax / 2.0) * cos(xprime * pi / (Side / 2.0)) + Dmax / 2) *
      70         160 :              sin(((z - LIN) / (L)) * pi);
      71             :     }
      72        1600 :     else if (y > -sqrt(3) * x + sqrt(3) * 4.0 * P && ((LIN + L) >= z) && z >= LIN) // TOP RIGHT
      73             :     {
      74         160 :       auto xprime = x * cos(5.0 * pi / 3.0) + y * sin(5.0 * pi / 3.0);
      75         160 :       return ((Dmax / 2.0) * cos(xprime * pi / (Side / 2.0)) + Dmax / 2) *
      76         160 :              sin(((z - LIN) / (L)) * pi);
      77             :     }
      78             :     else
      79             :     {
      80             :       return 0.0;
      81             :     }
      82             :   }
      83       10200 :   else if (subch_type == EChannelType::CORNER)
      84             :   {
      85         600 :     auto xprime = P + Side / 4.0;
      86         600 :     return ((Dmax / 2.0) * cos(xprime * pi / (Side / 2.0)) + Dmax / 2) *
      87         600 :            sin(((z - LIN) / (L)) * pi);
      88             :   }
      89             :   else
      90             :   {
      91             :     return 0.0;
      92             :   }
      93             : }

Generated by: LCOV version 1.14