https://mooseframework.inl.gov
LayeredSideDiffusiveFluxAverage.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 
14  LayeredSideFluxAverage,
15  "06/30/2021 24:00",
17 
20 {
22  params.addClassDescription("Computes the diffusive flux of a variable on layers alongside "
23  "a boundary.");
24  params.addRequiredParam<std::string>(
25  "diffusivity",
26  "The name of the diffusivity material property that will be used in the flux computation.");
27  return params;
28 }
29 
31  : LayeredSideAverage(parameters),
32  _diffusivity(parameters.get<std::string>("diffusivity")),
33  _diffusion_coef(getMaterialProperty<Real>(_diffusivity))
34 {
35 }
36 
37 Real
39 {
40  if (_fv)
41  {
42  // Get the face info
43  const FaceInfo * const fi = _mesh.faceInfo(_current_elem, _current_side);
44  mooseAssert(fi, "We should have a face info");
45 
46  // Get the gradient of the variable on the face
47  const auto & grad_u = _fv_variable->adGradSln(*fi, determineState());
48 
49  // FIXME Get the diffusion coefficient on the face, see #16809
51  }
52  else
53  return -_diffusion_coef[_qp] * _grad_u[_qp] * _normals[_qp];
54 }
const unsigned int & _current_side
current side of the current element
LayeredSideDiffusiveFluxAverage(const InputParameters &parameters)
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
Moose::StateArg determineState() const
Create a functor state argument that corresponds to the implicit state of this object.
auto raw_value(const Eigen::Map< T > &in)
Definition: EigenADReal.h:73
registerMooseObjectRenamed("MooseApp", LayeredSideFluxAverage, "06/30/2021 24:00", LayeredSideDiffusiveFluxAverage)
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
MooseVariableFV< Real > * _fv_variable
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...
This UserObject computes side averages of a variable storing partial sums for the specified number of...
static InputParameters validParams()
This UserObject computes side averages of a flux storing partial sums for the specified number of int...
This data structure is used to store geometric and variable related metadata about each cell face in ...
Definition: FaceInfo.h:36
const std::vector< const FaceInfo * > & faceInfo() const
Accessor for local FaceInfo objects.
Definition: MooseMesh.h:2173
const bool _fv
Whether FV variables are used.
const MaterialProperty< Real > & _diffusion_coef
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
MooseMesh & _mesh
const MooseArray< Point > & _normals
const VariableGradient & _grad_u
Holds the solution gradient at the current quadrature points.
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...
registerMooseObject("MooseApp", LayeredSideDiffusiveFluxAverage)
const Elem *const & _current_elem
const ADTemplateVariableGradient< OutputType > & adGradSln() const override
AD grad solution getter.