https://mooseframework.inl.gov
FVOrthogonalDiffusion.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 "FVOrthogonalDiffusion.h"
11 
13 
16 {
18  params.addClassDescription("Imposes an orthogonal diffusion term.");
19  params.addRequiredParam<MaterialPropertyName>("coeff", "diffusion coefficient");
20  params.addParam<MaterialPropertyName>(
21  "diffusing_quantity",
22  "The quantity that is diffusing. By default, the 'variable' solution value will be used.");
23  return params;
24 }
25 
27  : FVFluxKernel(parameters),
28  _coeff_elem(getADMaterialProperty<Real>("coeff")),
29  _coeff_neighbor(getNeighborADMaterialProperty<Real>("coeff")),
30  _diff_quant_elem(isParamValid("diffusing_quantity")
31  ? getADMaterialProperty<Real>("diffusing_quantity").get()
32  : _u_elem),
33  _diff_quant_neighbor(isParamValid("diffusing_quantity")
34  ? getNeighborADMaterialProperty<Real>("diffusing_quantity").get()
35  : _u_neighbor)
36 {
37 }
38 
39 ADReal
41 {
42  ADReal coeff_interface;
44  coeff_interface,
47  *_face_info,
48  true);
49 
50  return -coeff_interface * (_diff_quant_neighbor[_qp] - _diff_quant_elem[_qp]) /
51  _face_info->dCNMag();
52 }
gc*elem+(1-gc)*neighbor
static InputParameters validParams()
const MooseArray< ADReal > & _diff_quant_elem
const FaceInfo * _face_info
This is holds meta-data for geometric information relevant to the current face including elem+neighbo...
Definition: FVFluxKernel.h:89
registerMooseObject("MooseApp", FVOrthogonalDiffusion)
T * get(const std::unique_ptr< T > &u)
The MooseUtils::get() specializations are used to support making forwards-compatible code changes fro...
Definition: MooseUtils.h:1155
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
This class computes the intercell diffusion flux by taking the difference between neighboring cell ce...
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...
static InputParameters validParams()
Definition: FVFluxKernel.C:22
FVOrthogonalDiffusion(const InputParameters &parameters)
const unsigned int _qp
Definition: FVFluxKernel.h:75
Real dCNMag() const
Definition: FaceInfo.h:144
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
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...
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an optional parameter and a documentation string to the InputParameters object...
const ADMaterialProperty< Real > & _coeff_elem
const MooseArray< ADReal > & _diff_quant_neighbor
ADReal computeQpResidual() override
This is the primary function that must be implemented for flux kernel terms.
void interpolate(InterpMethod m, T &result, const T2 &value1, const T3 &value2, const FaceInfo &fi, const bool one_is_elem)
Provides interpolation of face values for non-advection-specific purposes (although it can/will still...
Definition: MathFVUtils.h:282
FVFluxKernel is used for calculating residual contributions from numerical fluxes from surface integr...
Definition: FVFluxKernel.h:30
const ADMaterialProperty< Real > & _coeff_neighbor