https://mooseframework.inl.gov
FVConstantScalarOutflowBC.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(
19  "Constant velocity scalar advection boundary conditions for finite volume method.");
20  params.addRequiredParam<RealVectorValue>("velocity", "Constant advection velocity");
21  return params;
22 }
23 
25  : FVFluxBC(parameters), _velocity(getParam<RealVectorValue>("velocity"))
26 {
27 }
28 
29 ADReal
31 {
32  mooseAssert(_normal * _velocity >= 0,
33  "This boundary condition is for outflow but the flow is in the opposite direction of "
34  "the boundary normal");
35 
36  const auto boundary_face = singleSidedFaceArg();
37  const auto state = determineState();
38 
39  // This will either be second or first order accurate depending on whether the user has asked
40  // for a two term expansion in their input file
41  return _normal * _velocity * _var(boundary_face, state);
42 }
const ADRealVectorValue _velocity
static InputParameters validParams()
Definition: FVFluxBC.C:17
Moose::StateArg determineState() const
Create a functor state argument that corresponds to the implicit state of this object.
FVConstantScalarOutflowBC(const InputParameters &parameters)
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
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
Determine the single sided face argument when evaluating a functor on a face.
MooseVariableFV< Real > & _var
DualNumber< Real, DNDerivativeType, true > ADReal
Definition: ADRealForward.h:46
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
ADRealVectorValue _normal
Definition: FVFluxBC.h:49
Provides an interface for computing residual contributions from finite volume numerical fluxes comput...
Definition: FVFluxBC.h:23
static InputParameters validParams()
registerMooseObject("MooseApp", FVConstantScalarOutflowBC)
Constant velocity scalar advection boundary conditions.
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump...
virtual ADReal computeQpResidual() override