www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ACInterface2DMultiPhase1 Class Reference

Compute the Allen-Cahn interface term with the weak form residual \( \left(\nabla (L \psi), 1/2 {\partial \kappa} \over {\partial \nabla \eta_{\alpha i}} \sum \{(\nabla \eta_{\beta j})^2 \} \right) \). More...

#include <ACInterface2DMultiPhase1.h>

Inheritance diagram for ACInterface2DMultiPhase1:
[legend]

Public Member Functions

 ACInterface2DMultiPhase1 (const InputParameters &parameters)
 
virtual void initialSetup ()
 

Protected Member Functions

virtual Real computeQpResidual ()
 
virtual Real computeQpJacobian ()
 
virtual Real computeQpOffDiagJacobian (unsigned int jvar)
 
Real sumSquareGradEta ()
 
RealGradient gradL ()
 
RealGradient gradKappa ()
 
RealGradient nablaLPsi ()
 the \( \nabla(L\psi) \) term More...
 
RealGradient kappaNablaLPsi ()
 the \( \kappa\nabla(L\psi) \) term More...
 

Protected Attributes

const MaterialProperty< RealGradient > & _dkappadgrad_etaa
 Interfacial parameter. More...
 
const MaterialProperty< RealTensorValue > & _d2kappadgrad_etaa
 
unsigned int _num_etas
 Order parameters. More...
 
std::vector< const VariableValue * > _eta
 
std::vector< const VariableGradient * > _grad_eta
 
const MaterialProperty< Real > & _L
 Mobility. More...
 
const MaterialProperty< Real > & _kappa
 Interfacial parameter. More...
 
const bool _variable_L
 flag set if L is a function of non-linear variables in args More...
 
const MaterialProperty< Real > & _dkappadop
 kappa derivative w.r.t. order parameter More...
 
const unsigned int _nvar
 number of coupled variables More...
 
std::vector< const MaterialProperty< Real > * > _dkappadarg
 kappa derivative w.r.t. other coupled variables More...
 
std::vector< const VariableGradient * > _gradarg
 Gradients for all coupled variables. More...
 
const MaterialProperty< Real > & _dLdop
 Mobility derivatives w.r.t. order parameter. More...
 
const MaterialProperty< Real > & _d2Ldop2
 
std::vector< const MaterialProperty< Real > * > _dLdarg
 Mobility derivative w.r.t. other coupled variables. More...
 
std::vector< const MaterialProperty< Real > * > _d2Ldargdop
 
std::vector< std::vector< const MaterialProperty< Real > * > > _d2Ldarg2
 

Detailed Description

Compute the Allen-Cahn interface term with the weak form residual \( \left(\nabla (L \psi), 1/2 {\partial \kappa} \over {\partial \nabla \eta_{\alpha i}} \sum \{(\nabla \eta_{\beta j})^2 \} \right) \).

Definition at line 28 of file ACInterface2DMultiPhase1.h.

Constructor & Destructor Documentation

◆ ACInterface2DMultiPhase1()

ACInterface2DMultiPhase1::ACInterface2DMultiPhase1 ( const InputParameters &  parameters)

Definition at line 34 of file ACInterface2DMultiPhase1.C.

35  : ACInterface(parameters),
36  _dkappadgrad_etaa(getMaterialProperty<RealGradient>("dkappadgrad_etaa_name")),
37  _d2kappadgrad_etaa(getMaterialProperty<RealTensorValue>("d2kappadgrad_etaa_name")),
38  _num_etas(coupledComponents("etas")),
39  _eta(_num_etas),
41 {
42 }
unsigned int _num_etas
Order parameters.
ACInterface(const InputParameters &parameters)
Definition: ACInterface.C:31
const MaterialProperty< RealTensorValue > & _d2kappadgrad_etaa
const MaterialProperty< RealGradient > & _dkappadgrad_etaa
Interfacial parameter.
std::vector< const VariableGradient * > _grad_eta
std::vector< const VariableValue * > _eta

Member Function Documentation

◆ computeQpJacobian()

Real ACInterface2DMultiPhase1::computeQpJacobian ( )
protectedvirtual

Reimplemented from ACInterface.

Definition at line 64 of file ACInterface2DMultiPhase1.C.

65 {
66  // dsum is the derivative \f$ \frac\partial{\partial \eta} \left( \nabla (L\psi) \right) \f$
67  RealGradient dsum = _dLdop[_qp] * _phi[_j][_qp] * _grad_test[_i][_qp];
68 
69  // compute the derivative of the gradient of the mobility
70  if (_variable_L)
71  {
72  RealGradient dgradL =
73  _grad_phi[_j][_qp] * _dLdop[_qp] + _grad_u[_qp] * _phi[_j][_qp] * _d2Ldop2[_qp];
74 
75  for (unsigned int i = 0; i < _nvar; ++i)
76  dgradL += (*_gradarg[i])[_qp] * _phi[_j][_qp] * (*_d2Ldargdop[i])[_qp];
77 
78  dsum += dgradL * _test[_i][_qp];
79  }
80  Real jac1 = 0.5 * dsum * _dkappadgrad_etaa[_qp] * sumSquareGradEta();
81  Real jac2 =
82  0.5 * nablaLPsi() * (_d2kappadgrad_etaa[_qp] * _grad_phi[_j][_qp]) * sumSquareGradEta();
83  Real jac3 = nablaLPsi() * _dkappadgrad_etaa[_qp] * _grad_u[_qp] * _grad_phi[_j][_qp];
84  return jac1 + jac2 + jac3;
85 }
std::vector< const VariableGradient * > _gradarg
Gradients for all coupled variables.
Definition: ACInterface.h:75
const bool _variable_L
flag set if L is a function of non-linear variables in args
Definition: ACInterface.h:52
RealGradient nablaLPsi()
the term
Definition: ACInterface.C:86
const MaterialProperty< Real > & _dLdop
Mobility derivatives w.r.t. order parameter.
Definition: ACInterface.h:55
std::vector< const MaterialProperty< Real > * > _d2Ldargdop
Definition: ACInterface.h:67
const MaterialProperty< RealTensorValue > & _d2kappadgrad_etaa
const unsigned int _nvar
number of coupled variables
Definition: ACInterface.h:63
const MaterialProperty< RealGradient > & _dkappadgrad_etaa
Interfacial parameter.
const MaterialProperty< Real > & _d2Ldop2
Definition: ACInterface.h:56

◆ computeQpOffDiagJacobian()

Real ACInterface2DMultiPhase1::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtual

Reimplemented from ACInterface.

Definition at line 88 of file ACInterface2DMultiPhase1.C.

89 {
90  // get the coupled variable jvar is referring to
91  const unsigned int cvar = mapJvarToCvar(jvar);
92 
93  // dsum is the derivative \f$ \frac\partial{\partial \eta} \left( \nabla (L\psi) \right) \f$
94  RealGradient dsum = (*_dLdarg[cvar])[_qp] * _phi[_j][_qp] * _grad_test[_i][_qp];
95 
96  // compute the derivative of the gradient of the mobility
97  if (_variable_L)
98  {
99  RealGradient dgradL = _grad_phi[_j][_qp] * (*_dLdarg[cvar])[_qp] +
100  _grad_u[_qp] * _phi[_j][_qp] * (*_d2Ldargdop[cvar])[_qp];
101 
102  for (unsigned int i = 0; i < _nvar; ++i)
103  dgradL += (*_gradarg[i])[_qp] * _phi[_j][_qp] * (*_d2Ldarg2[cvar][i])[_qp];
104 
105  dsum += dgradL * _test[_i][_qp];
106  }
107 
108  // the gradient of coupled variable etab
109  _grad_eta[0] = &coupledGradient("etas", 0);
110 
111  Real jac1 = 0.5 * dsum * _dkappadgrad_etaa[_qp] * sumSquareGradEta();
112  Real jac2 =
113  -0.5 * nablaLPsi() * (_d2kappadgrad_etaa[_qp] * _grad_phi[_j][_qp]) * sumSquareGradEta();
114  Real jac3 = nablaLPsi() * _dkappadgrad_etaa[_qp] * (*_grad_eta[0])[_qp] * _grad_phi[_j][_qp];
115  return jac1 + jac2 + jac3;
116 }
std::vector< const VariableGradient * > _gradarg
Gradients for all coupled variables.
Definition: ACInterface.h:75
const bool _variable_L
flag set if L is a function of non-linear variables in args
Definition: ACInterface.h:52
RealGradient nablaLPsi()
the term
Definition: ACInterface.C:86
std::vector< const MaterialProperty< Real > * > _d2Ldargdop
Definition: ACInterface.h:67
const MaterialProperty< RealTensorValue > & _d2kappadgrad_etaa
const unsigned int _nvar
number of coupled variables
Definition: ACInterface.h:63
std::vector< const MaterialProperty< Real > * > _dLdarg
Mobility derivative w.r.t. other coupled variables.
Definition: ACInterface.h:66
std::vector< std::vector< const MaterialProperty< Real > * > > _d2Ldarg2
Definition: ACInterface.h:68
const MaterialProperty< RealGradient > & _dkappadgrad_etaa
Interfacial parameter.
std::vector< const VariableGradient * > _grad_eta

◆ computeQpResidual()

Real ACInterface2DMultiPhase1::computeQpResidual ( )
protectedvirtual

Reimplemented from ACInterface.

Definition at line 58 of file ACInterface2DMultiPhase1.C.

59 {
60  return 0.5 * nablaLPsi() * _dkappadgrad_etaa[_qp] * sumSquareGradEta();
61 }
RealGradient nablaLPsi()
the term
Definition: ACInterface.C:86
const MaterialProperty< RealGradient > & _dkappadgrad_etaa
Interfacial parameter.

◆ gradKappa()

RealGradient ACInterface::gradKappa ( )
protectedinherited

◆ gradL()

RealGradient ACInterface::gradL ( )
protectedinherited

Definition at line 77 of file ACInterface.C.

Referenced by ACInterface::computeQpJacobian(), ACInterface::computeQpOffDiagJacobian(), and ACInterface::nablaLPsi().

78 {
79  RealGradient g = _grad_u[_qp] * _dLdop[_qp];
80  for (unsigned int i = 0; i < _nvar; ++i)
81  g += (*_gradarg[i])[_qp] * (*_dLdarg[i])[_qp];
82  return g;
83 }
std::vector< const VariableGradient * > _gradarg
Gradients for all coupled variables.
Definition: ACInterface.h:75
const MaterialProperty< Real > & _dLdop
Mobility derivatives w.r.t. order parameter.
Definition: ACInterface.h:55
const unsigned int _nvar
number of coupled variables
Definition: ACInterface.h:63
std::vector< const MaterialProperty< Real > * > _dLdarg
Mobility derivative w.r.t. other coupled variables.
Definition: ACInterface.h:66

◆ initialSetup()

void ACInterface::initialSetup ( )
virtualinherited

Definition at line 70 of file ACInterface.C.

71 {
72  validateCoupling<Real>("mob_name");
73  validateCoupling<Real>("kappa_name");
74 }

◆ kappaNablaLPsi()

RealGradient ACInterface::kappaNablaLPsi ( )
protectedinherited

the \( \kappa\nabla(L\psi) \) term

Definition at line 98 of file ACInterface.C.

Referenced by ACInterface::computeQpJacobian(), and ACInterface::computeQpResidual().

99 {
100  return _kappa[_qp] * nablaLPsi();
101 }
RealGradient nablaLPsi()
the term
Definition: ACInterface.C:86
const MaterialProperty< Real > & _kappa
Interfacial parameter.
Definition: ACInterface.h:49

◆ nablaLPsi()

RealGradient ACInterface::nablaLPsi ( )
protectedinherited

the \( \nabla(L\psi) \) term

Definition at line 86 of file ACInterface.C.

Referenced by computeQpJacobian(), ACInterface2DMultiPhase2::computeQpJacobian(), ACInterface2DMultiPhase2::computeQpOffDiagJacobian(), computeQpOffDiagJacobian(), computeQpResidual(), and ACInterface::kappaNablaLPsi().

87 {
88  // sum is the product rule gradient \f$ \nabla (L\psi) \f$
89  RealGradient sum = _L[_qp] * _grad_test[_i][_qp];
90 
91  if (_variable_L)
92  sum += gradL() * _test[_i][_qp];
93 
94  return sum;
95 }
const MaterialProperty< Real > & _L
Mobility.
Definition: ACInterface.h:47
const bool _variable_L
flag set if L is a function of non-linear variables in args
Definition: ACInterface.h:52
RealGradient gradL()
Definition: ACInterface.C:77

◆ sumSquareGradEta()

Real ACInterface2DMultiPhase1::sumSquareGradEta ( )
protected

Definition at line 45 of file ACInterface2DMultiPhase1.C.

Referenced by computeQpJacobian(), computeQpOffDiagJacobian(), and computeQpResidual().

46 {
47  // get the sum of square of gradients of all order parameters
48  Real SumSquareGradOp = _grad_u[_qp] * _grad_u[_qp];
49  for (unsigned int i = 0; i < _num_etas; ++i)
50  {
51  _grad_eta[i] = &coupledGradient("etas", i);
52  SumSquareGradOp += (*_grad_eta[i])[_qp] * (*_grad_eta[i])[_qp];
53  }
54  return SumSquareGradOp;
55 }
unsigned int _num_etas
Order parameters.
std::vector< const VariableGradient * > _grad_eta

Member Data Documentation

◆ _d2kappadgrad_etaa

const MaterialProperty<RealTensorValue>& ACInterface2DMultiPhase1::_d2kappadgrad_etaa
protected

Definition at line 42 of file ACInterface2DMultiPhase1.h.

Referenced by computeQpJacobian(), and computeQpOffDiagJacobian().

◆ _d2Ldarg2

std::vector<std::vector<const MaterialProperty<Real> *> > ACInterface::_d2Ldarg2
protectedinherited

◆ _d2Ldargdop

std::vector<const MaterialProperty<Real> *> ACInterface::_d2Ldargdop
protectedinherited

◆ _d2Ldop2

const MaterialProperty<Real>& ACInterface::_d2Ldop2
protectedinherited

◆ _dkappadarg

std::vector<const MaterialProperty<Real> *> ACInterface::_dkappadarg
protectedinherited

kappa derivative w.r.t. other coupled variables

Definition at line 72 of file ACInterface.h.

Referenced by ACInterface::ACInterface(), and ACInterface::computeQpOffDiagJacobian().

◆ _dkappadgrad_etaa

const MaterialProperty<RealGradient>& ACInterface2DMultiPhase1::_dkappadgrad_etaa
protected

Interfacial parameter.

Definition at line 41 of file ACInterface2DMultiPhase1.h.

Referenced by computeQpJacobian(), computeQpOffDiagJacobian(), and computeQpResidual().

◆ _dkappadop

const MaterialProperty<Real>& ACInterface::_dkappadop
protectedinherited

kappa derivative w.r.t. order parameter

Definition at line 60 of file ACInterface.h.

Referenced by ACInterface::computeQpJacobian(), and ACInterface::computeQpOffDiagJacobian().

◆ _dLdarg

std::vector<const MaterialProperty<Real> *> ACInterface::_dLdarg
protectedinherited

◆ _dLdop

const MaterialProperty<Real>& ACInterface::_dLdop
protectedinherited

Mobility derivatives w.r.t. order parameter.

Definition at line 55 of file ACInterface.h.

Referenced by ACInterface::computeQpJacobian(), ACInterface2DMultiPhase2::computeQpJacobian(), computeQpJacobian(), and ACInterface::gradL().

◆ _eta

std::vector<const VariableValue *> ACInterface2DMultiPhase1::_eta
protected

Definition at line 46 of file ACInterface2DMultiPhase1.h.

◆ _grad_eta

std::vector<const VariableGradient *> ACInterface2DMultiPhase1::_grad_eta
protected

Definition at line 47 of file ACInterface2DMultiPhase1.h.

Referenced by computeQpOffDiagJacobian(), and sumSquareGradEta().

◆ _gradarg

std::vector<const VariableGradient *> ACInterface::_gradarg
protectedinherited

◆ _kappa

const MaterialProperty<Real>& ACInterface::_kappa
protectedinherited

◆ _L

const MaterialProperty<Real>& ACInterface::_L
protectedinherited

◆ _num_etas

unsigned int ACInterface2DMultiPhase1::_num_etas
protected

Order parameters.

Definition at line 45 of file ACInterface2DMultiPhase1.h.

Referenced by sumSquareGradEta().

◆ _nvar

const unsigned int ACInterface::_nvar
protectedinherited

◆ _variable_L

const bool ACInterface::_variable_L
protectedinherited

The documentation for this class was generated from the following files: