https://mooseframework.inl.gov
ReynoldsNumberFunctorMaterial.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 
11 #include "MooseMesh.h"
12 #include "NS.h"
13 
15 
18 {
20  params.addClassDescription("Computes a Reynolds number.");
21  params.addRequiredParam<MooseFunctorName>(NS::speed, "The velocity magnitude of the fluid.");
22  params.addRequiredParam<MooseFunctorName>(NS::density, "The density of the fluid.");
23  params.addRequiredParam<MooseFunctorName>(NS::mu, "The dynamic viscosity of the fluid.");
24  params.addRequiredParam<MooseFunctorName>("characteristic_length",
25  "The characteristic length of the geometry.");
26 
27  return params;
28 }
29 
31  : FunctorMaterial(parameters),
32  _speed(getFunctor<ADReal>(NS::speed)),
33  _mu(getFunctor<ADReal>(NS::mu)),
34  _rho(getFunctor<ADReal>(NS::density)),
35  _characteristic_length(getFunctor<Real>("characteristic_length"))
36 {
37  addFunctorProperty<ADReal>(
39  [this](const auto & r, const auto & t) -> ADReal
40  { return _rho(r, t) * _speed(r, t) * _characteristic_length(r, t) / _mu(r, t); });
41 }
const Moose::Functor< ADReal > & _mu
Functor for the dynamic viscosity.
static const std::string speed
Definition: NS.h:143
static InputParameters validParams()
static const std::string Reynolds
Definition: NS.h:139
static const std::string density
Definition: NS.h:33
DualNumber< Real, DNDerivativeType, true > ADReal
void addRequiredParam(const std::string &name, const std::string &doc_string)
const Moose::Functor< ADReal > & _speed
Speed (velocity magnitude) of the fluid.
ReynoldsNumberFunctorMaterial(const InputParameters &parameters)
const Moose::Functor< Real > & _characteristic_length
Functor for the characteristic length.
registerMooseObject("NavierStokesApp", ReynoldsNumberFunctorMaterial)
static const std::string mu
Definition: NS.h:123
Class responsible for generating functor for computing the Reynolds number.
const Moose::Functor< ADReal > & _rho
Functor for the density.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)