https://mooseframework.inl.gov
ADReynoldsNumberMaterial.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 
12 #include "Numerics.h"
13 #include "FlowModelSinglePhase.h"
14 #include "MathUtils.h"
15 
16 registerMooseObject("ThermalHydraulicsApp", ADReynoldsNumberMaterial);
17 
20 {
22 
23  params.addParam<MaterialPropertyName>(
24  "Re", FlowModelSinglePhase::REYNOLDS_NUMBER, "Reynolds number property name");
25  params.addParam<MaterialPropertyName>(
26  "rho", FlowModelSinglePhase::DENSITY, "Density of the phase");
27  params.addParam<MaterialPropertyName>(
28  "vel", FlowModelSinglePhase::VELOCITY, "Velocity of the phase");
29  params.addParam<MaterialPropertyName>(
30  "D_h", FlowModelSinglePhase::HYDRAULIC_DIAMETER, "Hydraulic diameter");
31  params.addParam<MaterialPropertyName>(
32  "mu", FlowModelSinglePhase::DYNAMIC_VISCOSITY, "Dynamic viscosity of the phase");
33 
34  params.addClassDescription("Computes Reynolds number as a material property");
35 
36  return params;
37 }
38 
40  : Material(parameters),
41 
42  _Re_name(getParam<MaterialPropertyName>("Re")),
43 
44  _rho(getADMaterialProperty<Real>("rho")),
45 
46  _vel(getADMaterialProperty<Real>("vel")),
47 
48  _D_h(getADMaterialProperty<Real>("D_h")),
49 
50  _mu(getADMaterialProperty<Real>("mu")),
51 
52  _Re(declareADProperty<Real>(_Re_name))
53 
54 {
55 }
56 
57 void
59 {
60  _Re[_qp] = THM::Reynolds(1., _rho[_qp], _vel[_qp], _D_h[_qp], _mu[_qp]);
61 }
static const std::string DYNAMIC_VISCOSITY
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
static const std::string VELOCITY
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 ADMaterialProperty< Real > & _vel
Velocity of the phase.
static const std::string DENSITY
static InputParameters validParams()
const ADMaterialProperty< Real > & _D_h
Hydraulic diameter.
unsigned int _qp
const ADMaterialProperty< Real > & _rho
Density of the phase.
static InputParameters validParams()
ADReynoldsNumberMaterial(const InputParameters &parameters)
static const std::string REYNOLDS_NUMBER
ADMaterialProperty< Real > & _Re
Reynolds.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const std::string HYDRAULIC_DIAMETER
void addClassDescription(const std::string &doc_string)
const ADMaterialProperty< Real > & _mu
Dynamic viscosity of the phase.
Computes Reynolds number as a material property.
registerMooseObject("ThermalHydraulicsApp", ADReynoldsNumberMaterial)