https://mooseframework.inl.gov
SCMTriFlowAreaIC.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 "SCMTriFlowAreaIC.h"
11 #include "TriSubChannelMesh.h"
12 #include "SCM.h"
13 
14 registerMooseObject("SubChannelApp", SCMTriFlowAreaIC);
15 registerMooseObjectRenamed("SubChannelApp", TriFlowAreaIC, "06/30/2025 24:00", SCMTriFlowAreaIC);
16 
19 {
21  params.addClassDescription(
22  "Computes flow area of subchannels in a triangular lattice arrangement");
23  return params;
24 }
25 
27  : TriSubChannelBaseIC(params), _subchannel_mesh(SCM::getConstMesh<SubChannelMesh>(_mesh))
28 {
29 }
30 
31 Real
32 SCMTriFlowAreaIC::value(const Point & p)
33 {
34  Real standard_area, rod_area, wire_area, additional_area;
35  auto pitch = _mesh.getPitch();
36  auto pin_diameter = _mesh.getPinDiameter();
37  auto wire_diameter = _mesh.getWireDiameter();
38  auto wire_lead_length = _mesh.getWireLeadLength();
39  auto gap = _mesh.getDuctToPinGap();
40  auto z_blockage = _mesh.getZBlockage();
41  auto index_blockage = _mesh.getIndexBlockage();
42  auto reduction_blockage = _mesh.getReductionBlockage();
43  auto theta = std::acos(wire_lead_length /
44  std::sqrt(std::pow(wire_lead_length, 2) +
45  std::pow(libMesh::pi * (pin_diameter + wire_diameter), 2)));
47  // given the channel number, i, it computes the flow area of the subchannel
48  // based on the subchannel type: CENTER, EDGE or CORNER.
49  auto subch_type = _mesh.getSubchannelType(i);
50 
51  if (subch_type == EChannelType::CENTER)
52  {
53  standard_area = std::pow(pitch, 2) * std::sqrt(3.0) / 4.0;
54  rod_area = libMesh::pi * std::pow(pin_diameter, 2.0) / 8.0;
55  additional_area = 0.0;
56  wire_area = libMesh::pi * std::pow(wire_diameter, 2.0) / 8.0 / std::cos(theta);
57  }
58  else if (subch_type == EChannelType::EDGE)
59  {
60  standard_area = pitch * (pin_diameter / 2.0 + gap);
61  rod_area = libMesh::pi * std::pow(pin_diameter, 2.0) / 8.0;
62  additional_area = 0.0;
63  wire_area = libMesh::pi * std::pow(wire_diameter, 2.0) / 8.0 / std::cos(theta);
64  }
65  else
66  {
67  standard_area = 1.0 / std::sqrt(3.0) * std::pow((pin_diameter / 2.0 + gap), 2.0);
68  rod_area = libMesh::pi * std::pow(pin_diameter, 2.0) / 24.0;
69  additional_area = 0.0;
70  wire_area = libMesh::pi * std::pow(wire_diameter, 2.0) / 24.0 / std::cos(theta);
71  }
72 
74  auto subchannel_area = standard_area + additional_area - rod_area - wire_area;
75 
77  auto index = 0;
78  for (const auto & i_blockage : index_blockage)
79  {
80  if (i == i_blockage && (p(2) >= z_blockage.front() && p(2) <= z_blockage.back()))
81  {
82  return reduction_blockage[index] * subchannel_area;
83  }
84  index++;
85  }
86 
87  return subchannel_area;
88 }
virtual EChannelType getSubchannelType(unsigned int index) const override
Return the type of the subchannel for given subchannel index.
virtual const Real & getPinDiameter() const
Return Pin diameter.
virtual const Real & getDuctToPinGap() const
Return the the gap thickness between the duct and peripheral fuel pins.
Real value(const Point &p) override
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
This class calculates the area of the triangular, edge, and corner subchannels for hexagonal fuel ass...
SCMTriFlowAreaIC(const InputParameters &params)
static InputParameters validParams()
An abstract class for ICs for hexagonal fuel assemblies.
registerMooseObjectRenamed("SubChannelApp", TriFlowAreaIC, "06/30/2025 24:00", SCMTriFlowAreaIC)
static const std::string pitch
const T & getConstMesh(const MooseMesh &mesh)
function to cast const mesh
Definition: SCM.h:21
virtual const std::vector< Real > & getReductionBlockage() const
Get area reduction of blocked subchannels.
registerMooseObject("SubChannelApp", SCMTriFlowAreaIC)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual const std::vector< Real > & getZBlockage() const
Get axial location of blockage (in,out) [m].
const TriSubChannelMesh & _mesh
static InputParameters validParams()
virtual const Real & getWireLeadLength() const
Return the wire lead length.
void addClassDescription(const std::string &doc_string)
virtual const std::vector< unsigned int > & getIndexBlockage() const
Get index of blocked subchannels.
Base class for subchannel meshes.
MooseUnits pow(const MooseUnits &, int)
Definition: SCM.h:16
const Real pi
virtual const Real & getWireDiameter() const
Return wire diameter.