www.mooseframework.org
ACInterface2DMultiPhase2.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 
14 template <>
15 InputParameters
17 {
18  InputParameters params = validParams<ACInterface>();
19  params.addClassDescription(
20  "Gradient energy Allen-Cahn Kernel where the interface parameter kappa is considered.");
21  params.addParam<MaterialPropertyName>("dkappadgrad_etaa_name",
22  "dkappadgrad_etaa",
23  "The derivative of the kappa with respect to grad_etaa");
24  return params;
25 }
26 
27 ACInterface2DMultiPhase2::ACInterface2DMultiPhase2(const InputParameters & parameters)
28  : ACInterface(parameters),
29  _dkappadgrad_etaa(getMaterialProperty<RealGradient>("dkappadgrad_etaa_name"))
30 {
31 }
32 
33 Real
35 {
36  // dsum is the derivative \f$ \frac\partial{\partial \eta} \left( \nabla (L\psi) \right) \f$
37  RealGradient dsum = _dLdop[_qp] * _phi[_j][_qp] * _grad_test[_i][_qp];
38 
39  // compute the derivative of the gradient of the mobility
40  if (_variable_L)
41  {
42  RealGradient dgradL =
43  _grad_phi[_j][_qp] * _dLdop[_qp] + _grad_u[_qp] * _phi[_j][_qp] * _d2Ldop2[_qp];
44 
45  for (unsigned int i = 0; i < _nvar; ++i)
46  dgradL += (*_gradarg[i])[_qp] * _phi[_j][_qp] * (*_d2Ldargdop[i])[_qp];
47 
48  dsum += dgradL * _test[_i][_qp];
49  }
50  Real jac1 = dsum * _kappa[_qp] * _grad_u[_qp];
51  Real jac2 = nablaLPsi() * _dkappadgrad_etaa[_qp] * _grad_phi[_j][_qp] * _grad_u[_qp];
52  Real jac3 = nablaLPsi() * _kappa[_qp] * _grad_phi[_j][_qp];
53  return jac1 + jac2 + jac3;
54 }
55 
56 Real
58 {
59  // get the coupled variable jvar is referring to
60  const unsigned int cvar = mapJvarToCvar(jvar);
61 
62  // dsum is the derivative \f$ \frac\partial{\partial \eta} \left( \nabla (L\psi) \right) \f$
63  RealGradient dsum = (*_dLdarg[cvar])[_qp] * _phi[_j][_qp] * _grad_test[_i][_qp];
64 
65  // compute the derivative of the gradient of the mobility
66  if (_variable_L)
67  {
68  RealGradient dgradL = _grad_phi[_j][_qp] * (*_dLdarg[cvar])[_qp] +
69  _grad_u[_qp] * _phi[_j][_qp] * (*_d2Ldargdop[cvar])[_qp];
70 
71  for (unsigned int i = 0; i < _nvar; ++i)
72  dgradL += (*_gradarg[i])[_qp] * _phi[_j][_qp] * (*_d2Ldarg2[cvar][i])[_qp];
73 
74  dsum += dgradL * _test[_i][_qp];
75  }
76 
77  Real jac1 = dsum * _kappa[_qp] * _grad_u[_qp];
78  Real jac2 = -nablaLPsi() * _dkappadgrad_etaa[_qp] * _grad_phi[_j][_qp] * _grad_u[_qp];
79  return jac1 + jac2;
80 }
ACInterface::_gradarg
std::vector< const VariableGradient * > _gradarg
Gradients for all coupled variables.
Definition: ACInterface.h:74
ACInterface::_variable_L
const bool _variable_L
flag set if L is a function of non-linear variables in args
Definition: ACInterface.h:51
ACInterface2DMultiPhase2::computeQpOffDiagJacobian
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
Definition: ACInterface2DMultiPhase2.C:57
ACInterface2DMultiPhase2::computeQpJacobian
virtual Real computeQpJacobian()
Definition: ACInterface2DMultiPhase2.C:34
libMesh::RealGradient
VectorValue< Real > RealGradient
Definition: GrainForceAndTorqueInterface.h:17
ACInterface::nablaLPsi
RealGradient nablaLPsi()
the term
Definition: ACInterface.C:86
validParams< ACInterface >
InputParameters validParams< ACInterface >()
Definition: ACInterface.C:16
ACInterface::_nvar
const unsigned int _nvar
number of coupled variables
Definition: ACInterface.h:62
ACInterface::_d2Ldargdop
std::vector< const MaterialProperty< Real > * > _d2Ldargdop
Definition: ACInterface.h:66
validParams< ACInterface2DMultiPhase2 >
InputParameters validParams< ACInterface2DMultiPhase2 >()
Definition: ACInterface2DMultiPhase2.C:16
ACInterface2DMultiPhase2::_dkappadgrad_etaa
const MaterialProperty< RealGradient > & _dkappadgrad_etaa
Interfacial parameter.
Definition: ACInterface2DMultiPhase2.h:38
ACInterface::_kappa
const MaterialProperty< Real > & _kappa
Interfacial parameter.
Definition: ACInterface.h:48
ACInterface::_dLdarg
std::vector< const MaterialProperty< Real > * > _dLdarg
Mobility derivative w.r.t. other coupled variables.
Definition: ACInterface.h:65
ACInterface::_d2Ldarg2
std::vector< std::vector< const MaterialProperty< Real > * > > _d2Ldarg2
Definition: ACInterface.h:67
ACInterface2DMultiPhase2
Compute the Allen-Cahn interface term with the weak form residual It is assumed kappa is a function ...
Definition: ACInterface2DMultiPhase2.h:28
ACInterface::_dLdop
const MaterialProperty< Real > & _dLdop
Mobility derivatives w.r.t. order parameter.
Definition: ACInterface.h:54
ACInterface
Compute the Allen-Cahn interface term with the weak form residual .
Definition: ACInterface.h:25
registerMooseObject
registerMooseObject("PhaseFieldApp", ACInterface2DMultiPhase2)
ACInterface2DMultiPhase2::ACInterface2DMultiPhase2
ACInterface2DMultiPhase2(const InputParameters &parameters)
Definition: ACInterface2DMultiPhase2.C:27
ACInterface2DMultiPhase2.h
ACInterface::_d2Ldop2
const MaterialProperty< Real > & _d2Ldop2
Definition: ACInterface.h:55