https://mooseframework.inl.gov
ADMatDiffusionBase.h
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 #pragma once
11 
12 #include "ADKernelGrad.h"
13 
23 template <typename T>
25 {
26 public:
28 
30 
31 protected:
32  virtual ADRealVectorValue precomputeQpResidual() override;
33 
36 
39 };
40 
41 template <typename T>
43  : ADKernelGrad(parameters),
44  _diffusivity(getADMaterialProperty<T>("diffusivity")),
45  _grad_v(isCoupled("v") ? adCoupledGradient("v") : _grad_u)
46 {
47 }
48 
49 template <typename T>
52 {
53  return _diffusivity[_qp] * _grad_v[_qp];
54 }
55 
56 template <typename T>
59 {
61  params.addClassDescription("Diffusion kernel with a material property as diffusivity and "
62  "automatic differentiation to provide perfect Jacobians");
63  params.addParam<MaterialPropertyName>(
64  "diffusivity", "D", "The diffusivity value or material property");
65  params.addCoupledVar("v",
66  "Coupled concentration variable for kernel to operate on; if this "
67  "is not specified, the kernel's nonlinear variable will be used as "
68  "usual");
69  return params;
70 }
static InputParameters validParams()
Definition: ADKernelGrad.C:21
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
This class template implements a diffusion kernel with a mobility that can vary spatially and can dep...
const ADMaterialProperty< T > & _diffusivity
diffusion coefficient
void addCoupledVar(const std::string &name, const std::string &doc_string)
This method adds a coupled variable name pair.
forward declarations
const ADVariableGradient & _grad_v
Gradient of the concentration.
ADMatDiffusionBase(const InputParameters &parameters)
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...
const InputParameters & parameters() const
Get the parameters of the object.
virtual ADRealVectorValue precomputeQpResidual() override
Called before forming the residual for an element.
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...
static InputParameters validParams()