Loading [MathJax]/extensions/tex2jax.js
https://mooseframework.inl.gov
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
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 
30 ADReal
32 {
33  const auto face =
35  const auto vector = _vector_field(face, determineState());
36  return -1.0 * (vector * _normal);
37 }
gc*elem+(1-gc)*neighbor
virtual ADReal computeQpResidual() override
This is the primary function that must be implemented for flux kernel terms.
Definition: FVDivergence.C:31
const FaceInfo * _face_info
This is holds meta-data for geometric information relevant to the current face including elem+neighbo...
Definition: FVFluxKernel.h:89
Moose::StateArg determineState() const
Create a functor state argument that corresponds to the implicit state of this object.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
RealVectorValue _normal
This is the outward unit normal vector for the face the kernel is currently operating on...
Definition: FVFluxKernel.h:85
DualNumber< Real, DNDerivativeType, true > ADReal
Definition: ADRealForward.h:47
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...
registerMooseObject("MooseApp", FVDivergence)
static InputParameters validParams()
Definition: FVFluxKernel.C:22
LimiterType limiterType(InterpMethod interp_method)
Return the limiter type associated with the supplied interpolation method.
Definition: Limiter.C:63
const Moose::Functor< ADRealVectorValue > & _vector_field
The vector field whose divergence is added to the residual.
Definition: FVDivergence.h:32
FVDivergence(const InputParameters &params)
Definition: FVDivergence.C:25
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...
FVDivergence implements a standard divergence term:
Definition: FVDivergence.h:22
FVFluxKernel is used for calculating residual contributions from numerical fluxes from surface integr...
Definition: FVFluxKernel.h:30
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.
static InputParameters validParams()
Definition: FVDivergence.C:15