/
ADMatReaction.h
44 lines (35 loc) · 1.1 KB
/
ADMatReaction.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//* This file is part of the MOOSE framework
//* https://www.mooseframework.org
//*
//* All rights reserved, see COPYRIGHT for full restrictions
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html
#pragma once
#include "ADKernel.h"
// Forward Declaration
template <ComputeStage>
class ADMatReaction;
declareADValidParams(ADMatReaction);
/**
* This kernel adds to the residual a contribution of \f$ -L*v \f$ where \f$ L \f$ is a material
* property and \f$ v \f$ is a variable (nonlinear or coupled).
*/
template <ComputeStage compute_stage>
class ADMatReaction : public ADKernel<compute_stage>
{
public:
ADMatReaction(const InputParameters & parameters);
protected:
virtual ADReal computeQpResidual();
/**
* Kernel variable (can be nonlinear or coupled variable)
* (For constrained Allen-Cahn problems, v = lambda
* where lambda is the Lagrange multiplier)
*/
const ADVariableValue & _v;
/// Reaction rate
const ADMaterialProperty(Real) & _mob;
usingKernelMembers;
};