36 "subdomain1",
"The subdomains on the 1st side of the boundary.");
38 "subdomain2",
"The subdomains on the 2nd side of the boundary.");
40 "variable1",
"The name of the first variable that this interface kernel applies to");
41 params.
addParam<NonlinearVariableName>(
43 "The name of the second variable that this interface kernel applies to. If not supplied, "
44 "variable1 will be used.");
45 params.
addParam<
bool>(
"use_displaced_mesh",
47 "Whether or not this object should use the "
48 "displaced mesh for computation. Note that "
49 "in the case this is true but no "
50 "displacements are provided in the Mesh block "
51 "the undisplaced mesh will still be used.");
53 params.
addParam<
unsigned short>(
"ghost_layers", 1,
"The number of layers of elements to ghost.");
54 params.
addParam<
bool>(
"use_point_neighbors",
56 "Whether to use point neighbors, which introduces additional ghosting to "
57 "that used for simple face neighbors.");
64 "ElementSideNeighborLayers",
69 rm_params.
set<
unsigned short>(
"layers") = obj_params.
get<
unsigned short>(
"ghost_layers");
70 rm_params.
set<
bool>(
"use_point_neighbors") = obj_params.
get<
bool>(
"use_point_neighbors");
78 params.
set<
bool>(
"_residual_object") =
true;
96 this, false, false, true),
100 _subproblem(*getCheckedPointerParam<
SubProblem *>(
"_subproblem")),
101 _var1(_subproblem.getVariable(_tid, getParam<NonlinearVariableName>(
"variable1"))
103 .getFVVariable<Real>(_tid, getParam<NonlinearVariableName>(
"variable1"))),
106 isParamValid(
"variable2") ? getParam<NonlinearVariableName>(
"variable2")
107 : getParam<NonlinearVariableName>(
"variable1"))
109 .getFVVariable<Real>(_tid,
110 isParamValid(
"variable2")
111 ? getParam<NonlinearVariableName>(
"variable2")
112 : getParam<NonlinearVariableName>(
"variable1"))),
113 _assembly(_subproblem.assembly(_tid, _var1.sys().number())),
114 _mesh(_subproblem.
mesh())
116 if (getParam<bool>(
"use_displaced_mesh"))
117 paramError(
"use_displaced_mesh",
"FV interface kernels do not yet support displaced mesh");
123 for (
const auto & sub_name : getParam<std::vector<SubdomainName>>(
"subdomain1"))
125 for (
const auto & sub_name : getParam<std::vector<SubdomainName>>(
"subdomain2"))
130 "variable1 does not exist on all the blocks specified by the subdomain1 parameter");
134 const std::string var_name = var2_provided ?
"variable2" :
"variable1";
137 " does not exist on all the blocks specified by the subdomain2 parameter",
139 :
".\nNote that you did not provide the variable2 parameter, "
140 "so variable1 was implicitly used on subdomain2");
158 (
_elem_is_one && (ft1 == ft_elem || ft1 == ft_both) && (ft2 == ft_neigh || ft2 == ft_both)) ||
159 (!
_elem_is_one && (ft1 == ft_neigh || ft1 == ft_both) &&
160 (ft2 == ft_elem || ft2 == ft_both)),
161 "Face type was not recognized. Check that the specified boundaries are interfaces.");
175 const dof_id_type dof_index,
176 const Real scaling_factor)
179 std::array<ADReal, 1>{{resid}},
180 std::array<dof_id_type, 1>{{dof_index}},
194 "The interface kernel should contribute to the system which variable1 belongs to!");
216 "The interface kernel should contribute to the system which variable1 belongs to!");
244 const bool correct_skewness,
250 const bool defined_on_elem_side = variable.
hasBlocks(fi->
elem().subdomain_id());
251 bool defined_on_neighbor_side =
false;
255 const Elem *
const elem = defined_on_elem_side && defined_on_neighbor_side
259 return {fi, limiter_type,
true, correct_skewness, elem, state_limiter};
DualNumber< Real, DNDerivativeType, true > ADReal
An interface for accessing Moose::Functors for systems that care about automatic differentiation,...
static InputParameters validParams()
A class for requiring an object to be boundary restricted.
static InputParameters validParams()
Interface for objects that need to use distributions.
static InputParameters validParams()
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
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
static InputParameters validParams()
FVInterfaceKernel(const InputParameters ¶meters)
Class constructor.
const FaceInfo * _face_info
The face that this object is currently operating on.
MooseVariableFV< Real > & _var1
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.
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
SubProblem & _subproblem
The SubProblem.
This data structure is used to store geometric and variable related metadata about each cell face in ...
const Point & normal() const
Returns the unit normal vector for the face oriented outward from the face's elem element.
VarFaceNeighbors faceType(const std::pair< unsigned int, unsigned int > &var_sys) const
Returns which side(s) the given variable-system number pair is defined on for this face.
const Elem & elem() const
const Elem * neighborPtr() const
Real faceArea() const
Returns the face area of face id.
Real & faceCoord()
Sets/gets the coordinate transformation factor (for e.g.
const Elem * elemPtr() const
const Elem & neighbor() const
Interface for objects that need to use functions.
static InputParameters validParams()
static InputParameters validParams()
Interface for notifications that the mesh has changed.
static InputParameters validParams()
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
SubdomainID getSubdomainID(const SubdomainName &subdomain_name) const
Get the associated subdomain ID for the subdomain name.
Every object that can be built by the factory should be derived from this class.
static InputParameters validParams()
void scalingFactor(const std::vector< Real > &factor)
Set the scaling factor for this variable.
SystemBase & sys()
Get the system this variable is part of.
unsigned int number() const
Get variable number coming from libMesh.
void addMooseVariableDependency(MooseVariableFieldBase *var)
Call this function to add the passed in MooseVariableFieldBase as a variable that this object depends...
This class provides variable solution values for other classes/objects to bind to when looping over f...
virtual const std::vector< dof_id_type > & dofIndices() const final
Get local DoF indices.
virtual const std::vector< dof_id_type > & dofIndicesNeighbor() const final
Get neighbor DOF indices for currently selected element.
bool hasBlocks(const SubdomainID id) const override
Returns whether the functor is defined on this block.
Interface class for classes which interact with Postprocessors.
static InputParameters validParams()
static InputParameters validParams()
Generic class for solving transient nonlinear problems.
virtual unsigned int currentNlSysNum() const =0
virtual void haveADObjects(bool have_ad_objects)
Method for setting whether we have any ad objects.
unsigned int number() const
Gets the number of this system.
static InputParameters validParams()
void accumulateTaggedLocalResidual()
Local residual blocks will be appended by adding the current local kernel residual.
void addResidualsAndJacobian(Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, Real scaling_factor)
Add the provided incoming residuals and derivatives for the Jacobian, corresponding to the provided d...
void prepareVectorTagNeighbor(Assembly &assembly, unsigned int ivar)
Prepare data for computing element residual the according to active tags for DG and interface kernels...
void prepareVectorTag(Assembly &assembly, unsigned int ivar)
Prepare data for computing element residual according to active tags.
DenseVector< Number > _local_re
Holds local residual entries as they are accumulated by this Kernel.
Interface for objects that needs transient capabilities.
static InputParameters validParams()
This interface is designed for DGKernel, InternalSideUserObject, InterfaceUserObject,...
static InputParameters validParams()
Interface for objects that need to use UserObjects.
static InputParameters validParams()
static InputParameters validParams()
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
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.