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