-
Notifications
You must be signed in to change notification settings - Fork 0
/
NewCoefDiffusion.C
34 lines (28 loc) · 969 Bytes
/
NewCoefDiffusion.C
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
//* Alan Chavez
//* Boise State University
//* 24 June 2021
#include "NewCoefDiffusion.h"
registerMooseObject("diffusion", NewCoefDiffusion);
InputParameters
NewCoefDiffusion::validParams()
{
InputParameters params = Kernel::validParams();
params.addClassDescription("Kernel for Magnetic Potential using Magnetization Saturation");
params.addRequiredParam<MaterialPropertyName>("m", "Base name of the Magnetization Saturation defined in a DertivativeParsedMaterial");
return params;
}
NewCoefDiffusion::NewCoefDiffusion(const InputParameters & parameters)
: Kernel(parameters),
_m(getMaterialProperty<std::vector<Real>>("m")) // Magnetization Saturation Vector
{
}
Real
NewCoefDiffusion::computeQpResidual()
{
return _grad_test[_i][_qp] * -_grad_u[_qp] - _m[_qp]*grad_test[_i][_qp];
}
Real
NewCoefDiffusion::computeQpJacobian()
{
return _grad_test[_i][_qp] * -_grad_phi[_j][_qp] - _m[_qp]*grad_test[_i][_qp];
}