www.mooseframework.org
ACGrGrElasticDrivingForce.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 #include "Material.h"
10 #include "RankFourTensor.h"
11 #include "RankTwoTensor.h"
12 
13 template <>
14 InputParameters
16 {
17  InputParameters params = ACBulk<Real>::validParams();
18  params.addClassDescription("Adds elastic energy contribution to the Allen-Cahn equation");
19  params.addRequiredParam<MaterialPropertyName>(
20  "D_tensor_name", "The elastic tensor derivative for the specific order parameter");
21  return params;
22 }
23 
24 ACGrGrElasticDrivingForce::ACGrGrElasticDrivingForce(const InputParameters & parameters)
25  : ACBulk<Real>(parameters),
26  _D_elastic_tensor(getMaterialProperty<RankFourTensor>("D_tensor_name")),
27  _elastic_strain(getMaterialPropertyByName<RankTwoTensor>("elastic_strain"))
28 {
29 }
30 
31 Real
33 {
34  // Access the heterogeneous strain calculated by the Solid Mechanics kernels
35  RankTwoTensor strain(_elastic_strain[_qp]);
36 
37  // Compute the partial derivative of the stress wrt the order parameter
38  RankTwoTensor D_stress = _D_elastic_tensor[_qp] * strain;
39 
40  switch (type)
41  {
42  case Residual:
43  return 0.5 *
44  D_stress.doubleContraction(strain); // Compute the deformation energy driving force
45 
46  case Jacobian:
47  return 0.0;
48  }
49 
50  mooseError("Invalid type passed in");
51 }
This is the Allen-Cahn equation base class that implements the bulk or local energy term of the equat...
Definition: ACBulk.h:22
virtual Real computeDFDOP(PFFunctionType type)
const MaterialProperty< RankFourTensor > & _D_elastic_tensor
const MaterialProperty< RankTwoTensor > & _elastic_strain
ACGrGrElasticDrivingForce(const InputParameters &parameters)
InputParameters validParams< ACGrGrElasticDrivingForce >()
static InputParameters validParams()
Definition: ACBulk.h:72