https://mooseframework.inl.gov
Loading...
Searching...
No Matches
FVFluxKernel.h
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#pragma once
11
12#include "FVKernel.h"
13#include "MathFVUtils.h"
14#include "NeighborCoupleable.h"
19#include "FaceArgInterface.h"
20
21class FaceInfo;
22
30class FVFluxKernel : public FVKernel,
36{
37public:
39 FVFluxKernel(const InputParameters & params);
40
41 void computeResidual() override;
42 void computeJacobian() override;
43 void computeResidualAndJacobian() override;
44 void computeResidual(const FaceInfo & fi) override;
45 void computeJacobian(const FaceInfo & fi) override;
46 void computeResidualAndJacobian(const FaceInfo & fi) override;
47
48 const MooseVariableFV<Real> & variable() const override { return _var; }
49
50 bool hasFaceSide(const FaceInfo & fi, const bool fi_elem_side) const override;
51
52protected:
58
62 virtual ADReal gradUDotNormal(const Moose::StateArg & time, const bool correct_skewness) const;
63
69 virtual bool skipForBoundary(const FaceInfo & fi) const;
70
71 const RealVectorValue & normal() const { return _normal; }
72
74
75 const unsigned int _qp = 0;
76
80 RealVectorValue _normal;
81
84 const FaceInfo * _face_info = nullptr;
85
88
92 bool onBoundary(const FaceInfo & fi) const;
93
97 Moose::ElemArg elemArg(bool correct_skewness = false) const;
98
102 Moose::ElemArg neighborArg(bool correct_skewness = false) const;
103
114 const FaceInfo * fi = nullptr,
116 bool correct_skewness = false,
117 const Moose::StateArg * state_limiter = nullptr) const;
118
123 bool avoidBoundary(const FaceInfo & fi) const;
124
126 std::unordered_set<BoundaryID> _boundaries_to_force;
127
128private:
131
133 std::unordered_set<BoundaryID> _boundaries_to_avoid;
134};
DualNumber< Real, DNDerivativeType, true > ADReal
Interface class for a finite volume residual object whose residuals are based on faces.
FVFluxKernel is used for calculating residual contributions from numerical fluxes from surface integr...
Moose::ElemArg neighborArg(bool correct_skewness=false) const
bool hasFaceSide(const FaceInfo &fi, const bool fi_elem_side) const override
virtual ADReal computeQpResidual()=0
This is the primary function that must be implemented for flux kernel terms.
const bool _force_boundary_execution
Whether to force execution of flux kernels on all external boundaries.
Moose::ElemArg elemArg(bool correct_skewness=false) const
static InputParameters validParams()
RealVectorValue _normal
This is the outward unit normal vector for the face the kernel is currently operating on.
const MooseVariableFV< Real > & variable() const override
Returns the variable that this object operates on.
void computeJacobian() override
Compute this object's contribution to the diagonal Jacobian entries.
virtual bool skipForBoundary(const FaceInfo &fi) const
Kernels are called even on boundaries in case one is for a variable with a dirichlet BC - in which ca...
bool onBoundary(const FaceInfo &fi) const
Return whether the supplied face is on a boundary of this object's execution.
MooseVariableFV< Real > & _var
bool avoidBoundary(const FaceInfo &fi) const
Returns whether to avoid execution on a boundary.
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.
virtual ADReal gradUDotNormal(const Moose::StateArg &time, const bool correct_skewness) const
Calculates and returns "grad_u dot normal" on the face to be used for diffusive terms.
void computeResidual() override
Compute this object's contribution to the residual.
std::unordered_set< BoundaryID > _boundaries_to_avoid
Which boundaries/sidesets to prevent the execution of flux kernels on.
void computeResidualAndJacobian() override
Compute this object's contribution to the residual and Jacobian simultaneously.
const FaceInfo * _face_info
This is holds meta-data for geometric information relevant to the current face including elem+neighbo...
const RealVectorValue & normal() const
const unsigned int _qp
std::unordered_set< BoundaryID > _boundaries_to_force
Which boundaries/sidesets to force the execution of flux kernels on.
FaceInfo::VarFaceNeighbors _face_type
The face type.
FVKernel is a base class for all finite volume method kernels.
Definition FVKernel.h:36
An interface for producers of functor face arguments, e.g.
This data structure is used to store geometric and variable related metadata about each cell face in ...
Definition FaceInfo.h:38
VarFaceNeighbors
This enum is used to indicate which side(s) of a face a particular variable is defined on.
Definition FaceInfo.h:53
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
This class provides variable solution values for other classes/objects to bind to when looping over f...
Intermediate base class that ties together all the interfaces for getting MooseVariables with the Moo...
Enhances MooseVariableInterface interface provide values from neighbor elements.
This interface is designed for DGKernel, InternalSideUserObject, InterfaceUserObject,...
A structure that is used to evaluate Moose functors logically at an element/cell center.
A structure defining a "face" evaluation calling argument for Moose functors.
State argument for evaluating functors.