https://mooseframework.inl.gov
WCNSFVSwitchableInletVelocityBC.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 "INSFVVelocityVariable.h"
12 #include "NS.h"
13 
15 
18 {
20 
21  params.addClassDescription("Adds switchable inlet-velocity boundary condition"
22  "for weakly compressible flows.");
23 
24  params.addParam<bool>(
25  "switch_bc", true, "Switch on (true) / off (false) for boundary condition.");
26  params.declareControllable("switch_bc");
27 
28  params.addParam<Real>("face_limiter", 1.0, "Face flux limiter.");
29  params.declareControllable("face_limiter");
30 
31  return params;
32 }
33 
35  : WCNSFVInletVelocityBC(params),
36  _switch_bc(getParam<bool>("switch_bc")),
37  _face_limiter(getParam<Real>("face_limiter"))
38 {
39 }
40 
41 ADReal
43  const Moose::StateArg & state) const
44 {
45  if (_switch_bc)
47  else
48  // The two-term expansion = false piece is critical as it prevents infinite recursion that would
49  // occur with a Green-Gauss gradient calculation which would call back to this "Dirichlet"
50  // object
52  /*two_term_expansion=*/false,
53  /*correct_skewness=*/false,
54  fi.elemPtr(),
55  state) *
57 }
ADReal boundaryValue(const FaceInfo &fi, const Moose::StateArg &state) const override
WCNSFVSwitchableInletVelocityBC(const InputParameters &params)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
MooseVariableFV< Real > & _var
Dirichlet boundary conditions for the velocity, set from either a velocity postprocessor or a mass fl...
DualNumber< Real, DNDerivativeType, true > ADReal
registerMooseObject("NavierStokesApp", WCNSFVSwitchableInletVelocityBC)
const bool & _switch_bc
Boolean switch to turn boundary condition on/off.
ADReal boundaryValue(const FaceInfo &fi, const Moose::StateArg &state) const override
virtual ADReal getExtrapolatedBoundaryFaceValue(const FaceInfo &fi, bool two_term_expansion, bool correct_skewness, const Elem *elem_side_to_extrapolate_from, const StateArg &state) const
const Elem * elemPtr() const
Dirichlet boundary conditions for the velocity, set from either a velocity postprocessor The class is...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
void declareControllable(const std::string &name, std::set< ExecFlagType > execute_flags={})