https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
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 : FVQpFluxKernel(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
41{
42 ADReal coeff_interface;
44 coeff_interface,
48 true);
49
50 return -coeff_interface * (_diff_quant_neighbor[_qp] - _diff_quant_elem[_qp]) /
52}
DualNumber< Real, DNDerivativeType, true > ADReal
registerMooseObject("MooseApp", FVOrthogonalDiffusion)
const FaceInfo * _face_info
This is holds meta-data for geometric information relevant to the current face including elem+neighbo...
const unsigned int _qp
This class computes the intercell diffusion flux by taking the difference between neighboring cell ce...
const MooseArray< ADReal > & _diff_quant_neighbor
static InputParameters validParams()
FVOrthogonalDiffusion(const InputParameters &parameters)
const ADMaterialProperty< Real > & _coeff_elem
const MooseArray< ADReal > & _diff_quant_elem
const ADMaterialProperty< Real > & _coeff_neighbor
ADReal computeQpResidual() override
This is the primary function that must be implemented for flux kernel terms.
Base class for FV flux kernels that need qp-indexed solution values on both sides of a face.
static InputParameters validParams()
Real dCNMag() const
Definition FaceInfo.h:148
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
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.
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...
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 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...
@ Average
gc*elem+(1-gc)*neighbor