www.mooseframework.org
EshelbyTensor.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 
10 #include "EshelbyTensor.h"
11 #include "RankTwoTensor.h"
12 #include "MooseMesh.h"
13 
14 registerMooseObject("TensorMechanicsApp", EshelbyTensor);
15 
17 
18 InputParameters
20 {
21  InputParameters params = Material::validParams();
22  params.addClassDescription("Computes the Eshelby tensor as a function of "
23  "strain energy density and the first "
24  "Piola-Kirchoff stress");
25  params.addRequiredCoupledVar(
26  "displacements",
27  "The displacements appropriate for the simulation geometry and coordinate system");
28  params.addParam<std::string>("base_name",
29  "Optional parameter that allows the user to define "
30  "multiple mechanics material systems on the same "
31  "block, i.e. for multiple phases");
32  params.addCoupledVar("temperature", "Coupled temperature");
33  return params;
34 }
35 
36 EshelbyTensor::EshelbyTensor(const InputParameters & parameters)
37  : DerivativeMaterialInterface<Material>(parameters),
38  _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""),
39  _sed(getMaterialPropertyByName<Real>(_base_name + "strain_energy_density")),
40  _eshelby_tensor(declareProperty<RankTwoTensor>(_base_name + "Eshelby_tensor")),
41  _stress(getMaterialProperty<RankTwoTensor>(_base_name + "stress")),
42  _stress_old(getMaterialPropertyOld<RankTwoTensor>(_base_name + "stress")),
43  _grad_disp(3),
44  _J_thermal_term_vec(declareProperty<RealVectorValue>("J_thermal_term_vec")),
45  _grad_temp(coupledGradient("temperature")),
46  _has_temp(isCoupled("temperature")),
47  _total_deigenstrain_dT(hasMaterialProperty<RankTwoTensor>("total_deigenstrain_dT")
48  ? &getMaterialProperty<RankTwoTensor>("total_deigenstrain_dT")
49  : nullptr)
50 {
51  unsigned int ndisp = coupledComponents("displacements");
52 
53  // Checking for consistency between mesh size and length of the provided displacements vector
54  if (ndisp != _mesh.dimension())
55  mooseError(
56  "The number of variables supplied in 'displacements' must match the mesh dimension.");
57 
58  // fetch coupled gradients
59  for (unsigned int i = 0; i < ndisp; ++i)
60  _grad_disp[i] = &coupledGradient("displacements", i);
61 
62  // set unused dimensions to zero
63  for (unsigned i = ndisp; i < 3; ++i)
64  _grad_disp[i] = &_grad_zero;
65 
67  mooseError("EshelbyTensor Error: To include thermal strain term in Fracture integral "
68  "calculation, must both couple temperature in DomainIntegral block and compute "
69  "total_deigenstrain_dT using ThermalFractureIntegral material model.");
70 }
71 
72 void
74 {
75 }
76 
77 void
79 {
80  RankTwoTensor F((*_grad_disp[0])[_qp],
81  (*_grad_disp[1])[_qp],
82  (*_grad_disp[2])[_qp]); // Deformation gradient
83 
84  RankTwoTensor H(F);
85  F.addIa(1.0);
86  Real detF = F.det();
87  RankTwoTensor FinvT(F.inverse().transpose());
88 
89  // 1st Piola-Kirchoff Stress (P):
90  RankTwoTensor P = detF * _stress[_qp] * FinvT;
91 
92  // HTP = H^T * P = H^T * detF * sigma * FinvT;
93  RankTwoTensor HTP = H.transpose() * P;
94 
95  RankTwoTensor WI = RankTwoTensor(RankTwoTensor::initIdentity);
96  WI *= (_sed[_qp] * detF);
97 
98  _eshelby_tensor[_qp] = WI - HTP;
99 
100  if (_has_temp)
101  {
102  Real sigma_alpha = _stress[_qp].doubleContraction((*_total_deigenstrain_dT)[_qp]);
103  _J_thermal_term_vec[_qp] = sigma_alpha * _grad_temp[_qp];
104  }
105  else
106  _J_thermal_term_vec[_qp].zero();
107 }
EshelbyTensor::initQpStatefulProperties
virtual void initQpStatefulProperties() override
Definition: EshelbyTensor.C:73
EshelbyTensor::_stress
const MaterialProperty< RankTwoTensor > & _stress
Definition: EshelbyTensor.h:42
EshelbyTensor::_J_thermal_term_vec
MaterialProperty< RealVectorValue > & _J_thermal_term_vec
Definition: EshelbyTensor.h:46
EshelbyTensor::computeQpProperties
virtual void computeQpProperties() override
Definition: EshelbyTensor.C:78
defineLegacyParams
defineLegacyParams(EshelbyTensor)
EshelbyTensor::validParams
static InputParameters validParams()
Definition: EshelbyTensor.C:19
EshelbyTensor::_eshelby_tensor
MaterialProperty< RankTwoTensor > & _eshelby_tensor
Definition: EshelbyTensor.h:41
EshelbyTensor::_grad_temp
const VariableGradient & _grad_temp
Definition: EshelbyTensor.h:47
EshelbyTensor::_grad_disp
std::vector< const VariableGradient * > _grad_disp
Definition: EshelbyTensor.h:44
EshelbyTensor::_has_temp
const bool _has_temp
Definition: EshelbyTensor.h:48
validParams
InputParameters validParams()
registerMooseObject
registerMooseObject("TensorMechanicsApp", EshelbyTensor)
RankTwoTensor
RankTwoTensorTempl< Real > RankTwoTensor
Definition: ACGrGrElasticDrivingForce.h:17
EshelbyTensor.h
EshelbyTensor::_total_deigenstrain_dT
const MaterialProperty< RankTwoTensor > * _total_deigenstrain_dT
Definition: EshelbyTensor.h:49
EshelbyTensor::_sed
const MaterialProperty< Real > & _sed
Definition: EshelbyTensor.h:40
EshelbyTensor
EshelbyTensor defines a strain increment and rotation increment, for finite strains.
Definition: EshelbyTensor.h:27
RankTwoTensorTempl< Real >
EshelbyTensor::EshelbyTensor
EshelbyTensor(const InputParameters &parameters)
Definition: EshelbyTensor.C:36