https://mooseframework.inl.gov
SCMFrictionMATRA.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 "SCMFrictionMATRA.h"
11 
12 #include <cmath>
13 
14 registerMooseObject("SubChannelApp", SCMFrictionMATRA);
15 
16 namespace
17 {
18 const Real matra_transition_start = std::pow(64.0 / 0.316, 4.0 / 3.0);
19 const Real matra_transition_end = 5000.0;
20 
21 Real
22 smoothStep(const Real x)
23 {
24  return x * x * (3.0 - 2.0 * x);
25 }
26 
27 Real
28 matraQuadLatticeFrictionFactor(const Real Re)
29 {
30  if (Re < 1)
31  return 64.0;
32  else if (Re < matra_transition_start)
33  return 64.0 / Re;
34  else if (Re < matra_transition_end)
35  {
36  const auto weight =
37  smoothStep((Re - matra_transition_start) / (matra_transition_end - matra_transition_start));
38  const auto laminar_friction = 64.0 / Re;
39  const auto matra_friction = 0.316 * std::pow(Re, -0.25);
40  return (1.0 - weight) * laminar_friction + weight * matra_friction;
41  }
43  else if (Re >= 5000 and Re < 30000)
44  return 0.316 * std::pow(Re, -0.25);
45  else if (Re >= 30000 and Re < 1000000)
46  return 0.184 * std::pow(Re, -0.20);
47  else
48  // currently unreachable
49  return 0.0;
50 }
51 }
52 
55 {
57  params.addClassDescription(
58  "Class that computes the axial friction factor using the MATRA correlation.");
59  return params;
60 }
61 
63  : SCMFrictionClosureBase(parameters),
64  _is_quad_lattice(dynamic_cast<const QuadSubChannelMesh *>(&_subchannel_mesh) != nullptr),
65  _quad_sch_mesh(dynamic_cast<const QuadSubChannelMesh *>(&_subchannel_mesh))
66 {
67 }
68 
69 Real
71 {
72  if (_is_quad_lattice)
73  return computeQuadLatticeFrictionFactor(friction_args);
74  else
75  mooseError(name(),
76  ": This closure model applies only for assemblies with bare fuel pins in a square "
77  "lattice. ");
78 }
79 
80 Real
82 {
83  if (friction_args.Re >= 1000000)
84  {
85  flagInvalidSolution("MATRA correlation out of range");
86  return 0.0;
87  }
88 
89  return matraQuadLatticeFrictionFactor(friction_args.Re);
90 }
static InputParameters validParams()
Base class for friction closures used in SCM.
Creates the mesh of subchannels in a quadrilateral lattice.
structure with the needed information to compute the friction factor at a specific subchannel cell ...
Class that calculates the friction factor based on the MATRA correlation (Numerical study of void dri...
const std::string & name() const
const std::vector< double > x
dof_id_type weight(const MeshBase &mesh, const processor_id_type pid)
const double Re
SCMFrictionMATRA(const InputParameters &parameters)
bool _is_quad_lattice
Keep track of the lattice type.
Real computeQuadLatticeFrictionFactor(const FrictionStruct &friction_info) const
virtual Real computeFrictionFactor(const FrictionStruct &friction_info) const override
Computes the friction factor for the local conditions.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
registerMooseObject("SubChannelApp", SCMFrictionMATRA)
static InputParameters validParams()
void mooseError(Args &&... args) const
void addClassDescription(const std::string &doc_string)
MooseUnits pow(const MooseUnits &, int)