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