https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
37Real
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
50 return -MetaPhysicL::raw_value(_diffusion_coef[_qp] * grad_u * _normals[_qp]);
51 }
52 else
53 return -_diffusion_coef[_qp] * _grad_u[_qp] * _normals[_qp];
54}
registerMooseObject("MooseApp", LayeredSideDiffusiveFluxAverage)
registerMooseObjectRenamed("MooseApp", LayeredSideFluxAverage, "06/30/2021 24:00", LayeredSideDiffusiveFluxAverage)
This data structure is used to store geometric and variable related metadata about each cell face in ...
Definition FaceInfo.h:38
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
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.
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...
LayeredSideDiffusiveFluxAverage(const InputParameters &parameters)
const MaterialProperty< Real > & _diffusion_coef
auto raw_value(const Eigen::Map< T > &in)