https://mooseframework.inl.gov
ReynoldsNumberAux.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 "ReynoldsNumberAux.h"
12 #include "Numerics.h"
13 
14 registerMooseObject("ThermalHydraulicsApp", ReynoldsNumberAux);
15 
18 {
20  params.addClassDescription("Computes the Reynolds number.");
21  params.addCoupledVar("alpha", 1, "Volume fraction of the phase");
22  params.addRequiredCoupledVar("rho", "Density of the phase");
23  params.addRequiredCoupledVar("vel", "Component of phase velocity aligned with the flow");
24  params.addRequiredCoupledVar("D_h", "Hydraulic diameter");
25  params.addRequiredCoupledVar("v", "Specific volume");
26  params.addRequiredCoupledVar("e", "Specific internal energy");
27  params.addRequiredParam<UserObjectName>("fp",
28  "The name of the user object with fluid properties");
29  return params;
30 }
31 
33  : AuxKernel(parameters),
34  _alpha(coupledValue("alpha")),
35  _rho(coupledValue("rho")),
36  _vel(coupledValue("vel")),
37  _D_h(coupledValue("D_h")),
38  _v(coupledValue("v")),
39  _e(coupledValue("e")),
40  _fp(getUserObject<SinglePhaseFluidProperties>("fp"))
41 {
42 }
43 
44 Real
46 {
47  Real visc = _fp.mu_from_v_e(_v[_qp], _e[_qp]);
48  return THM::Reynolds(_alpha[_qp], _rho[_qp], _vel[_qp], _D_h[_qp], visc);
49 }
const VariableValue & _vel
Velocity of the phase.
auto Reynolds(const T1 &volume_fraction, const T2 &rho, const T3 &vel, const T4 &D_h, const T5 &mu)
Compute Reynolds number.
Definition: Numerics.h:118
const VariableValue & _D_h
Hydraulic diameter.
void addRequiredParam(const std::string &name, const std::string &doc_string)
const VariableValue & _alpha
Volume fraction.
Common class for single phase fluid properties.
ReynoldsNumberAux(const InputParameters &parameters)
const SinglePhaseFluidProperties & _fp
const VariableValue & _v
Specific volume.
void addCoupledVar(const std::string &name, const std::string &doc_string)
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const VariableValue & _rho
Density of the phase.
static InputParameters validParams()
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
virtual Real computeValue()
Computes Reynolds number.
registerMooseObject("ThermalHydraulicsApp", ReynoldsNumberAux)
const VariableValue & _e
Specific internal energy.