https://mooseframework.inl.gov
Loading...
Searching...
No Matches
FVDivergence.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
10#include "FVDivergence.h"
11
13
16{
18 params.addClassDescription("Computes the residual coming from the divergence of a vector field"
19 "that can be represented as a functor.");
20 params.addRequiredParam<MooseFunctorName>(
21 "vector_field", "The name of the vector field whose divergence is added to the residual.");
22 return params;
23}
24
26 : FVFluxKernel(params), _vector_field(getFunctor<ADRealVectorValue>("vector_field"))
27{
28}
29
32{
33 const auto face =
35 const auto vector = _vector_field(face, determineState());
36 return -1.0 * (vector * _normal);
37}
DualNumber< Real, DNDerivativeType, true > ADReal
registerMooseObject("MooseApp", FVDivergence)
FVDivergence implements a standard divergence term:
const Moose::Functor< ADRealVectorValue > & _vector_field
The vector field whose divergence is added to the residual.
FVDivergence(const InputParameters &params)
virtual ADReal computeQpResidual() override
This is the primary function that must be implemented for flux kernel terms.
static InputParameters validParams()
FVFluxKernel is used for calculating residual contributions from numerical fluxes from surface integr...
static InputParameters validParams()
RealVectorValue _normal
This is the outward unit normal vector for the face the kernel is currently operating on.
const FaceInfo * _face_info
This is holds meta-data for geometric information relevant to the current face including elem+neighbo...
Moose::FaceArg makeFace(const FaceInfo &fi, const Moose::FV::LimiterType limiter_type, const bool elem_is_upwind, const bool correct_skewness=false, const Moose::StateArg *state_limiter=nullptr) const
Create a functor face argument from provided component arguments.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
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...
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.
Moose::StateArg determineState() const
Create a functor state argument that corresponds to the implicit state of this object.
LimiterType limiterType(InterpMethod interp_method)
Return the limiter type associated with the supplied interpolation method.
Definition Limiter.C:63
@ Average
gc*elem+(1-gc)*neighbor