Line data Source code
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 "ReynoldsNumberFunctorMaterial.h" 11 : #include "MooseMesh.h" 12 : #include "NS.h" 13 : 14 : registerMooseObject("NavierStokesApp", ReynoldsNumberFunctorMaterial); 15 : 16 : InputParameters 17 265 : ReynoldsNumberFunctorMaterial::validParams() 18 : { 19 265 : InputParameters params = FunctorMaterial::validParams(); 20 265 : params.addClassDescription("Computes a Reynolds number."); 21 265 : params.addRequiredParam<MooseFunctorName>(NS::speed, "The velocity magnitude of the fluid."); 22 265 : params.addRequiredParam<MooseFunctorName>(NS::density, "The density of the fluid."); 23 265 : params.addRequiredParam<MooseFunctorName>(NS::mu, "The dynamic viscosity of the fluid."); 24 530 : params.addRequiredParam<MooseFunctorName>("characteristic_length", 25 : "The characteristic length of the geometry."); 26 : 27 265 : return params; 28 0 : } 29 : 30 143 : ReynoldsNumberFunctorMaterial::ReynoldsNumberFunctorMaterial(const InputParameters & parameters) 31 : : FunctorMaterial(parameters), 32 143 : _speed(getFunctor<ADReal>(NS::speed)), 33 143 : _mu(getFunctor<ADReal>(NS::mu)), 34 143 : _rho(getFunctor<ADReal>(NS::density)), 35 429 : _characteristic_length(getFunctor<Real>("characteristic_length")) 36 : { 37 429 : addFunctorProperty<ADReal>( 38 : NS::Reynolds, 39 511440 : [this](const auto & r, const auto & t) -> ADReal 40 511440 : { return _rho(r, t) * _speed(r, t) * _characteristic_length(r, t) / _mu(r, t); }); 41 286 : }