www.mooseframework.org
ACInterfaceKobayashi1.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
8 
9 template <>
10 InputParameters
12 {
13  InputParameters params = validParams<KernelGrad>();
14  params.addClassDescription("Anisotropic gradient energy Allen-Cahn Kernel Part 1");
15  params.addParam<MaterialPropertyName>("mob_name", "L", "The mobility used with the kernel");
16  params.addParam<MaterialPropertyName>("eps_name", "eps", "The anisotropic interface parameter");
17  params.addParam<MaterialPropertyName>(
18  "deps_name",
19  "deps",
20  "The derivative of the anisotropic interface parameter with respect to angle");
21  params.addParam<MaterialPropertyName>(
22  "depsdgrad_op_name",
23  "depsdgrad_op",
24  "The derivative of the anisotropic interface parameter eps with respect to grad_op");
25  params.addParam<MaterialPropertyName>(
26  "ddepsdgrad_op_name", "ddepsdgrad_op", "The derivative of deps with respect to grad_op");
27  params.addCoupledVar("args", "Vector of nonlinear variable arguments this object depends on");
28  return params;
29 }
30 
31 ACInterfaceKobayashi1::ACInterfaceKobayashi1(const InputParameters & parameters)
32  : DerivativeMaterialInterface<JvarMapKernelInterface<KernelGrad>>(parameters),
33  _L(getMaterialProperty<Real>("mob_name")),
34  _dLdop(getMaterialPropertyDerivative<Real>("mob_name", _var.name())),
35  _eps(getMaterialProperty<Real>("eps_name")),
36  _deps(getMaterialProperty<Real>("deps_name")),
37  _depsdgrad_op(getMaterialProperty<RealGradient>("depsdgrad_op_name")),
38  _ddepsdgrad_op(getMaterialProperty<RealGradient>("ddepsdgrad_op_name"))
39 {
40  // Get number of coupled variables
41  unsigned int nvar = _coupled_moose_vars.size();
42 
43  // reserve space for derivatives
44  _dLdarg.resize(nvar);
45  _depsdarg.resize(nvar);
46  _ddepsdarg.resize(nvar);
47 
48  // Iterate over all coupled variables
49  for (unsigned int i = 0; i < nvar; ++i)
50  {
51  const VariableName iname = _coupled_moose_vars[i]->name();
52  _dLdarg[i] = &getMaterialPropertyDerivative<Real>("mob_name", iname);
53  _depsdarg[i] = &getMaterialPropertyDerivative<Real>("eps_name", iname);
54  _ddepsdarg[i] = &getMaterialPropertyDerivative<Real>("deps_name", iname);
55  }
56 }
57 
58 RealGradient
60 {
61  // Set modified gradient vector
62  const RealGradient v(-_grad_u[_qp](1), _grad_u[_qp](0), 0);
63 
64  // Define anisotropic interface residual
65  return _eps[_qp] * _deps[_qp] * _L[_qp] * v;
66 }
67 
68 RealGradient
70 {
71  // Set modified gradient vector
72  const RealGradient v(-_grad_u[_qp](1), _grad_u[_qp](0), 0);
73 
74  // dvdgrad_op*_grad_phi
75  const RealGradient dv(-_grad_phi[_j][_qp](1), _grad_phi[_j][_qp](0), 0);
76 
77  // Derivative of epsilon wrt nodal op values
78  Real depsdop_i = _depsdgrad_op[_qp] * _grad_phi[_j][_qp];
79  Real ddepsdop_i = _ddepsdgrad_op[_qp] * _grad_phi[_j][_qp];
80  ;
81 
82  // Set the Jacobian
83  RealGradient jac1 = _eps[_qp] * _deps[_qp] * dv;
84  RealGradient jac2 = _deps[_qp] * depsdop_i * v;
85  RealGradient jac3 = _eps[_qp] * ddepsdop_i * v;
86 
87  return _L[_qp] * (jac1 + jac2 + jac3);
88 }
89 
90 Real
92 {
93  // get the coupled variable jvar is referring to
94  const unsigned int cvar = mapJvarToCvar(jvar);
95 
96  // Set modified gradient vector
97  const RealGradient v(-_grad_u[_qp](1), _grad_u[_qp](0), 0);
98 
99  // Set off-diagonal jaocbian terms from mobility dependence
100  Real dsum =
101  _L[_qp] * (_deps[_qp] * (*_depsdarg[cvar])[_qp] * _phi[_j][_qp] * v * _grad_test[_i][_qp]);
102  dsum +=
103  _L[_qp] * (_eps[_qp] * (*_ddepsdarg[cvar])[_qp] * _phi[_j][_qp] * v * _grad_test[_i][_qp]);
104  dsum += (*_dLdarg[cvar])[_qp] * _phi[_j][_qp] * _eps[_qp] * _deps[_qp] * v * _grad_test[_i][_qp];
105 
106  return dsum;
107 }
ACInterfaceKobayashi1(const InputParameters &parameters)
std::vector< const MaterialProperty< Real > * > _depsdarg
const MaterialProperty< RealGradient > & _ddepsdgrad_op
InputParameters validParams< ACInterfaceKobayashi1 >()
const MaterialProperty< Real > & _eps
std::vector< const MaterialProperty< Real > * > _dLdarg
Mobility derivative w.r.t. other coupled variables.
const MaterialProperty< Real > & _deps
virtual RealGradient precomputeQpResidual()
Enum of computeDFDOP inputs.
const MaterialProperty< Real > & _L
Mobility.
virtual RealGradient precomputeQpJacobian()
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
const MaterialProperty< RealGradient > & _depsdgrad_op
std::vector< const MaterialProperty< Real > * > _ddepsdarg