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