https://mooseframework.inl.gov
Loading...
Searching...
No Matches
INSFVInletIntensityTKEBC.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
13
16{
18 params.addClassDescription("Adds inlet boudnary conditon for the turbulent kinetic energy based "
19 "on turbulent intensity.");
20 params.addRequiredParam<MooseFunctorName>("u", "The velocity in the x direction.");
21 params.addParam<MooseFunctorName>("v", "The velocity in the y direction.");
22 params.addParam<MooseFunctorName>("w", "The velocity in the z direction.");
23 params.addRequiredParam<MooseFunctorName>("intensity", "Turbulent intensity.");
24 return params;
25}
26
28 : FVDirichletBCBase(params),
29 _u(getFunctor<ADReal>("u")),
30 _v(isParamValid("v") ? &getFunctor<ADReal>("v") : nullptr),
31 _w(isParamValid("w") ? &getFunctor<ADReal>("w") : nullptr),
32 _intensity(getFunctor<ADReal>("intensity")),
33 _dim(_subproblem.mesh().dimension())
34{
35 if (_dim >= 2 && !_v)
37 "In two or more dimensions, the v velocity must be supplied using the 'v' parameter");
38 if (_dim >= 3 && !_w)
39 mooseError("In threedimensions, the w velocity must be supplied using the 'w' parameter");
40}
41
44{
45 const auto boundary_face = singleSidedFaceArg(&fi);
46
47 ADRealVectorValue velocity(_u(boundary_face, state));
48 if (_v)
49 velocity(1) = (*_v)(boundary_face, state);
50 if (_w)
51 velocity(2) = (*_w)(boundary_face, state);
52
53 const auto velocity_normal = fi.normal() * velocity;
54
55 return 1.5 * Utility::pow<2>(_intensity(boundary_face, state) * velocity_normal);
56}
DualNumber< Real, DNDerivativeType, true > ADReal
registerMooseObject("NavierStokesApp", INSFVInletIntensityTKEBC)
Moose::FaceArg singleSidedFaceArg(const FaceInfo *fi=nullptr, Moose::FV::LimiterType limiter_type=Moose::FV::LimiterType::CentralDifference, bool correct_skewness=false, const Moose::StateArg *state_limiter=nullptr) const
static InputParameters validParams()
const Point & normal() const
A class for turbulent kinetic energy inlet boundary conditions.
static InputParameters validParams()
ADReal boundaryValue(const FaceInfo &fi, const Moose::StateArg &state) const override
const unsigned int _dim
the dimension of the domain
const Moose::Functor< ADReal > *const _v
y-velocity
INSFVInletIntensityTKEBC(const InputParameters &params)
const Moose::Functor< ADReal > & _intensity
turbulent intensity
const Moose::Functor< ADReal > & _u
x-velocity
const Moose::Functor< ADReal > *const _w
z-velocity
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
void mooseError(Args &&... args) const
MeshBase & mesh