https://mooseframework.inl.gov
Loading...
Searching...
No Matches
FVInterfaceKernel.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// MOOSE
13#include "MooseObject.h"
14#include "SetupInterface.h"
15#include "ParallelUniqueId.h"
16#include "FunctionInterface.h"
18#include "UserObjectInterface.h"
19#include "TransientInterface.h"
25#include "TaggingInterface.h"
28#include "ADFunctorInterface.h"
30#include "FaceArgInterface.h"
31
32#include <set>
33
34class MooseMesh;
35class SubProblem;
36class FEProblemBase;
37class SystemBase;
38class Assembly;
39template <typename>
40class MooseVariableFV;
41
47 public SetupInterface,
48 public FunctionInterface,
51 public TransientInterface,
56 public TaggingInterface,
59 public ADFunctorInterface,
62{
63public:
69
71
76 const SubProblem & subProblem() const { return _subproblem; }
77
78 void computeResidual(const FaceInfo & fi) override;
79 void computeJacobian(const FaceInfo & fi) override;
80 void computeResidualAndJacobian(const FaceInfo & fi) override;
81
82 bool hasFaceSide(const FaceInfo & fi, bool fi_elem_side) const override;
83
84protected:
89
94 const std::set<SubdomainID> & sub1() const { return _subdomain1; }
95
100 const std::set<SubdomainID> & sub2() const { return _subdomain2; }
101
105 virtual bool elemIsOne() const { return _elem_is_one; }
106
110 const MooseVariableFV<Real> & var1() const { return _var1; }
111
115 const MooseVariableFV<Real> & var2() const { return _var2; }
116
120 const MooseMesh & mesh() const { return _mesh; }
121
125 void setupData(const FaceInfo & fi);
126
130 void addResidual(Real resid, unsigned int var_num, bool neighbor);
131
136 void addJacobian(const ADReal & resid, dof_id_type dof_index, Real scaling_factor);
137
142 Moose::ElemArg elemArg(bool correct_skewness = false) const;
143
148 Moose::ElemArg neighborArg(bool correct_skenewss = false) const;
149
160 const MooseVariableFV<Real> & variable,
161 const FaceInfo * fi = nullptr,
163 bool correct_skewness = false,
164 const Moose::StateArg * state_limiter = nullptr) const;
165
169 const unsigned int _qp = 0;
170
176
179 const FaceInfo * _face_info = nullptr;
180
183
186
189
192
195
196private:
197 std::set<SubdomainID> _subdomain1;
198 std::set<SubdomainID> _subdomain2;
199
201};
DualNumber< Real, DNDerivativeType, true > ADReal
unsigned int THREAD_ID
Definition MooseTypes.h:237
An interface for accessing Moose::Functors for systems that care about automatic differentiation,...
Keeps track of stuff related to assembling.
Definition Assembly.h:110
A class for requiring an object to be boundary restricted.
Interface for objects that need to use distributions.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
Interface class for a finite volume residual object whose residuals are based on faces.
Base class for creating kernels that interface physics between subdomains.
const THREAD_ID _tid
Thread id.
virtual bool elemIsOne() const
void computeResidual(const FaceInfo &fi) override
Compute the residual on the supplied face.
void addResidual(Real resid, unsigned int var_num, bool neighbor)
Process the provided residual given var_num and whether this is on the neighbor side.
std::set< SubdomainID > _subdomain1
Moose::ElemArg elemArg(bool correct_skewness=false) const
const MooseMesh & _mesh
void addJacobian(const ADReal &resid, dof_id_type dof_index, Real scaling_factor)
Process the derivatives for the provided residual and dof index.
ADRealVectorValue _normal
The normal.
MooseVariableFV< Real > & _var2
const unsigned int _qp
To be consistent with FE interfaces we introduce this quadrature point member.
static InputParameters validParams()
const FaceInfo * _face_info
The face that this object is currently operating on.
const std::set< SubdomainID > & sub2() const
const MooseMesh & mesh() const
MooseVariableFV< Real > & _var1
const std::set< SubdomainID > & sub1() const
Moose::ElemArg neighborArg(bool correct_skenewss=false) const
bool hasFaceSide(const FaceInfo &fi, bool fi_elem_side) const override
void computeResidualAndJacobian(const FaceInfo &fi) override
Compute the residual and Jacobian on the supplied face.
void setupData(const FaceInfo &fi)
setup data useful for this object
virtual ADReal computeQpResidual()=0
bool _elem_is_one
Whether the current element is associated with variable/subdomain 1 or 2.
const MooseVariableFV< Real > & var1() const
Moose::FaceArg singleSidedFaceArg(const MooseVariableFV< Real > &variable, 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.
Assembly & _assembly
The Assembly object.
void computeJacobian(const FaceInfo &fi) override
Compute the jacobian on the supplied face.
std::set< SubdomainID > _subdomain2
const SubProblem & subProblem() const
Get a reference to the subproblem.
SubProblem & _subproblem
The SubProblem.
const MooseVariableFV< Real > & var2() const
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
Interface for objects that need to use functions.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
Interface for notifications that the mesh has changed.
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition MooseMesh.h:95
Every object that can be built by the factory should be derived from this class.
Definition MooseObject.h:31
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...
Interface class for classes which interact with Postprocessors.
Generic class for solving transient nonlinear problems.
Definition SubProblem.h:79
Base class for a system (of equations)
Definition SystemBase.h:87
void addJacobian(Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, Real scaling_factor)
Add the provided residual derivatives into the Jacobian for the provided dof indices.
Interface for objects that needs transient capabilities.
This interface is designed for DGKernel, InternalSideUserObject, InterfaceUserObject,...
Interface for objects that need to use UserObjects.
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.