https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ACGrGrElasticDrivingForce.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
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
35Real
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}
registerMooseObject("PhaseFieldApp", ACGrGrElasticDrivingForce)
void mooseError(Args &&... args)
This is the Allen-Cahn equation base class that implements the bulk or local energy term of the equat...
Definition ACBulk.h:25
static InputParameters validParams()
Definition ACBulk.h:69
Calculates the porton of the Allen-Cahn equation that results from the deformation energy.
const MaterialProperty< RankTwoTensor > & _elastic_strain
virtual Real computeDFDOP(PFFunctionType type)
ACGrGrElasticDrivingForce(const InputParameters &parameters)
static InputParameters validParams()
const MaterialProperty< RankFourTensor > & _D_elastic_tensor
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
T doubleContraction(const RankTwoTensorTempl< T > &a) const