https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ACInterfaceKobayashi2.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
13
16{
18 params.addClassDescription("Anisotropic Gradient energy Allen-Cahn Kernel Part 2");
19 params.addParam<MaterialPropertyName>("mob_name", "L", "The mobility used with the kernel");
20 params.addParam<MaterialPropertyName>("eps_name", "eps", "The anisotropic parameter");
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 return params;
26}
27
30 _L(getMaterialProperty<Real>("mob_name")),
31 _dLdop(getMaterialPropertyDerivative<Real>("mob_name", _var.name())),
32 _eps(getMaterialProperty<Real>("eps_name")),
33 _depsdgrad_op(getMaterialProperty<RealGradient>("depsdgrad_op_name")),
34 _dLdarg(_n_args),
35 _depsdarg(_n_args)
36{
37 // Iterate over all coupled variables
38 for (unsigned int i = 0; i < _n_args; ++i)
39 {
40 _dLdarg[i] = &getMaterialPropertyDerivative<Real>("mob_name", i);
41 _depsdarg[i] = &getMaterialPropertyDerivative<Real>("eps_name", i);
42 }
43}
44
45RealGradient
47{
48 // Set interfacial part of residual
49 return _eps[_qp] * _eps[_qp] * _L[_qp] * _grad_u[_qp];
50}
51
52RealGradient
54{
55 // Calculate depsdop_i
56 Real depsdop_i = _depsdgrad_op[_qp] * _grad_phi[_j][_qp];
57
58 // Set Jacobian using product rule
59 return _L[_qp] *
60 (_eps[_qp] * _eps[_qp] * _grad_phi[_j][_qp] + 2.0 * _eps[_qp] * depsdop_i * _grad_u[_qp]);
61}
62
63Real
65{
66 // get the coupled variable jvar is referring to
67 const unsigned int cvar = mapJvarToCvar(jvar);
68
69 // Set off-diagonal jaocbian terms from mobility and epsilon dependence
70 Real dsum = _L[_qp] * 2.0 * _eps[_qp] * (*_depsdarg[cvar])[_qp] * _phi[_j][_qp] * _grad_u[_qp] *
71 _grad_test[_i][_qp];
72 dsum += _eps[_qp] * _eps[_qp] * (*_dLdarg[cvar])[_qp] * _phi[_j][_qp] * _grad_u[_qp] *
73 _grad_test[_i][_qp];
74
75 return dsum;
76}
registerMooseObject("PhaseFieldApp", ACInterfaceKobayashi2)
const std::string name
Definition Setup.h:21
Kernel 2 of 2 for interfacial energy anisotropy in the Allen-Cahn equation as implemented in R.
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
const MaterialProperty< Real > & _L
Mobility.
ACInterfaceKobayashi2(const InputParameters &parameters)
const MaterialProperty< Real > & _eps
Interfacial parameter.
std::vector< const MaterialProperty< Real > * > _dLdarg
Mobility derivative w.r.t. other coupled variables.
virtual RealGradient precomputeQpResidual()
const MaterialProperty< RealGradient > & _depsdgrad_op
std::vector< const MaterialProperty< Real > * > _depsdarg
virtual RealGradient precomputeQpJacobian()
static InputParameters validParams()
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()