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 
20 {
22  params.addClassDescription("Adds elastic energy contribution to the Allen-Cahn equation");
23  params.addRequiredParam<MaterialPropertyName>(
24  "D_tensor_name", "The elastic tensor derivative for the specific order parameter");
25  return params;
26 }
27 
29  : ACBulk<Real>(parameters),
30  _D_elastic_tensor(getMaterialProperty<RankFourTensor>("D_tensor_name")),
31  _elastic_strain(getMaterialPropertyByName<RankTwoTensor>("elastic_strain"))
32 {
33 }
34 
35 Real
37 {
38  // Access the heterogeneous strain calculated by the Solid Mechanics kernels
39  RankTwoTensor strain(_elastic_strain[_qp]);
40 
41  // Compute the partial derivative of the stress wrt the order parameter
42  RankTwoTensor D_stress = _D_elastic_tensor[_qp] * strain;
43 
44  switch (type)
45  {
46  case Residual:
47  return 0.5 *
48  D_stress.doubleContraction(strain); // Compute the deformation energy driving force
49 
50  case Jacobian:
51  return 0.0;
52  }
53 
54  mooseError("Invalid type passed in");
55 }
static InputParameters validParams()
void mooseError(Args &&... args)
void addRequiredParam(const std::string &name, const std::string &doc_string)
This is the Allen-Cahn equation base class that implements the bulk or local energy term of the equat...
Definition: ACBulk.h:24
virtual Real computeDFDOP(PFFunctionType type)
const MaterialProperty< RankFourTensor > & _D_elastic_tensor
Real doubleContraction(const RankTwoTensorTempl< Real > &a) const
const MaterialProperty< RankTwoTensor > & _elastic_strain
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
ACGrGrElasticDrivingForce(const InputParameters &parameters)
void addClassDescription(const std::string &doc_string)
Calculates the porton of the Allen-Cahn equation that results from the deformation energy...
static InputParameters validParams()
Definition: ACBulk.h:69
registerMooseObject("PhaseFieldApp", ACGrGrElasticDrivingForce)