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 "INSFVMixingLengthTKEDBC.h" 11 : #include "NavierStokesMethods.h" 12 : #include "NS.h" 13 : 14 : registerMooseObject("NavierStokesApp", INSFVMixingLengthTKEDBC); 15 : 16 : InputParameters 17 21 : INSFVMixingLengthTKEDBC::validParams() 18 : { 19 21 : InputParameters params = FVDirichletBCBase::validParams(); 20 21 : params.addClassDescription("Adds inlet boundary condition for the turbulent kinetic energy " 21 : "dissipation rate based on characteristic length."); 22 42 : params.addParam<MooseFunctorName>("C_mu", 0.09, "Coupled turbulent kinetic energy closure."); 23 21 : params.addRequiredParam<MooseFunctorName>(NS::TKE, "The turbulent kinetic energy."); 24 42 : params.addRequiredParam<MooseFunctorName>("characteristic_length", 25 : "Characteristic length of the inlet in the problem."); 26 21 : return params; 27 0 : } 28 : 29 12 : INSFVMixingLengthTKEDBC::INSFVMixingLengthTKEDBC(const InputParameters & params) 30 : : FVDirichletBCBase(params), 31 12 : _C_mu(getFunctor<ADReal>("C_mu")), 32 12 : _k(getFunctor<ADReal>(NS::TKE)), 33 36 : _characteristic_length(getFunctor<ADReal>("characteristic_length")) 34 : { 35 12 : } 36 : 37 : ADReal 38 1940 : INSFVMixingLengthTKEDBC::boundaryValue(const FaceInfo & fi, const Moose::StateArg & state) const 39 : { 40 1940 : const auto boundary_face = singleSidedFaceArg(&fi); 41 : 42 1940 : return std::pow(_C_mu(boundary_face, state), 0.75) * std::pow(_k(boundary_face, state), 1.5) / 43 1940 : (0.07 * _characteristic_length(boundary_face, state)); 44 : }