https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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}
DualNumber< Real, DNDerivativeType, true > ADReal
const double mu
registerMooseObject("NavierStokesApp", ReynoldsNumberFunctorMaterial)
static InputParameters validParams()
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
Class responsible for generating functor for computing the Reynolds number.
ReynoldsNumberFunctorMaterial(const InputParameters &parameters)
const Moose::Functor< Real > & _characteristic_length
Functor for the characteristic length.
const Moose::Functor< ADReal > & _speed
Speed (velocity magnitude) of the fluid.
const Moose::Functor< ADReal > & _rho
Functor for the density.
const Moose::Functor< ADReal > & _mu
Functor for the dynamic viscosity.
static const std::string density
Definition NS.h:34
static const std::string mu
Definition NS.h:127
static const std::string speed
Definition NS.h:147
static const std::string Reynolds
Definition NS.h:143