https://mooseframework.inl.gov
FCTFdisplacementIC.C
Go to the documentation of this file.
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 
18 {
20  params.addClassDescription(
21  "This class calculates the displacement of the duct for the areva FCTF");
22  return params;
23 }
24 
26  : TriSubChannelBaseIC(params), _subchannel_mesh(SCM::getConstMesh<SubChannelMesh>(_mesh))
27 {
28 }
29 
30 Real
31 FCTFdisplacementIC::value(const Point & p)
32 {
33  auto L = _mesh.getHeatedLength();
34  auto LIN = _mesh.getHeatedLengthEntry();
35  auto P = _mesh.getPitch();
36  auto Dmax = 0.001064;
37  auto Side = 0.05291;
39  auto subch_type = _mesh.getSubchannelType(i);
40  auto x = p(0);
41  auto y = p(1);
42  auto z = p(2);
43 
44  if (subch_type == EChannelType::EDGE)
45  {
46  if ((y > 2.0 * sqrt(3) * P) && ((LIN + L) >= z) && z >= LIN) // TOP
47  {
48  return ((Dmax / 2.0) * cos(x * pi / (Side / 2.0)) + Dmax / 2) * sin(((z - LIN) / (L)) * pi);
49  }
50  else if ((y < -2.0 * sqrt(3) * P) && ((LIN + L) >= z) && z >= LIN) // BOTTOM
51  {
52  return ((Dmax / 2.0) * cos(x * pi / (Side / 2.0)) + Dmax / 2) * sin(((z - LIN) / (L)) * pi);
53  }
54  else if (y > sqrt(3) * x + sqrt(3) * 4.0 * P && ((LIN + L) >= z) && z >= LIN) // TOP LEFT
55  {
56  auto xprime = x * cos(pi / 3.0) + y * sin(pi / 3.0);
57  return ((Dmax / 2.0) * cos(xprime * pi / (Side / 2.0)) + Dmax / 2) *
58  sin(((z - LIN) / (L)) * pi);
59  }
60  else if (y < -sqrt(3) * x - sqrt(3) * 4.0 * P && ((LIN + L) >= z) && z >= LIN) // BOTTOM LEFT
61  {
62  auto xprime = x * cos(2.0 * pi / 3.0) + y * sin(2.0 * pi / 3.0);
63  return ((Dmax / 2.0) * cos(xprime * pi / (Side / 2.0)) + Dmax / 2) *
64  sin(((z - LIN) / (L)) * pi);
65  }
66  else if (y < sqrt(3) * x - sqrt(3) * 4.0 * P && ((LIN + L) >= z) && z >= LIN) // BOTTOM RIGHT
67  {
68  auto xprime = x * cos(4.0 * pi / 3.0) + y * sin(4.0 * pi / 3.0);
69  return ((Dmax / 2.0) * cos(xprime * pi / (Side / 2.0)) + Dmax / 2) *
70  sin(((z - LIN) / (L)) * pi);
71  }
72  else if (y > -sqrt(3) * x + sqrt(3) * 4.0 * P && ((LIN + L) >= z) && z >= LIN) // TOP RIGHT
73  {
74  auto xprime = x * cos(5.0 * pi / 3.0) + y * sin(5.0 * pi / 3.0);
75  return ((Dmax / 2.0) * cos(xprime * pi / (Side / 2.0)) + Dmax / 2) *
76  sin(((z - LIN) / (L)) * pi);
77  }
78  else
79  {
80  return 0.0;
81  }
82  }
83  else if (subch_type == EChannelType::CORNER)
84  {
85  auto xprime = P + Side / 4.0;
86  return ((Dmax / 2.0) * cos(xprime * pi / (Side / 2.0)) + Dmax / 2) *
87  sin(((z - LIN) / (L)) * pi);
88  }
89  else
90  {
91  return 0.0;
92  }
93 }
virtual EChannelType getSubchannelType(unsigned int index) const override
Return the type of the subchannel for given subchannel index.
CTSub CT_OPERATOR_BINARY CTMul CTCompareLess CTCompareGreater CTCompareEqual _arg template * sin(_arg) *_arg.template D< dtag >()) CT_SIMPLE_UNARY_FUNCTION(tan
Real value(const Point &p) override
FCTFdisplacementIC(const InputParameters &params)
static InputParameters validParams()
virtual const Real & getPitch() const
Return the pitch between 2 subchannels.
virtual unsigned int getSubchannelIndexFromPoint(const Point &p) const override
Return a subchannel index for a given physical point p
const std::vector< double > y
An abstract class for ICs for hexagonal fuel assemblies.
CTSub CT_OPERATOR_BINARY CTMul CTCompareLess CTCompareGreater CTCompareEqual _arg template cos(_arg) *_arg.template D< dtag >()) CT_SIMPLE_UNARY_FUNCTION(cos
const std::vector< double > x
virtual const Real & getHeatedLength() const
Return heated length.
const T & getConstMesh(const MooseMesh &mesh)
function to cast const mesh
Definition: SCM.h:21
This class calculates the displacement of the duct for the areva FCTF facility https://www.osti.gov/servlets/purl/1346027/.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
CTSub CT_OPERATOR_BINARY CTMul CTCompareLess CTCompareGreater CTCompareEqual _arg template * sqrt(_arg)) *_arg.template D< dtag >()) CT_SIMPLE_UNARY_FUNCTION(tanh
const TriSubChannelMesh & _mesh
static InputParameters validParams()
void addClassDescription(const std::string &doc_string)
Base class for subchannel meshes.
registerMooseObject("SubChannelApp", FCTFdisplacementIC)
Definition: SCM.h:16
virtual const Real & getHeatedLengthEntry() const
Return unheated length at entry.
const Real pi