www.mooseframework.org
ComputePlasticHeatEnergy.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 /****************************************************************/
7 
9 
10 template <>
11 InputParameters
13 {
14  InputParameters params = validParams<Material>();
15  params.addParam<std::string>("base_name",
16  "Optional parameter that allows the user to define "
17  "multiple mechanics material systems on the same "
18  "block, i.e. for multiple phases");
19  params.addClassDescription("Plastic heat energy density = stress * plastic_strain_rate");
20  return params;
21 }
22 
23 ComputePlasticHeatEnergy::ComputePlasticHeatEnergy(const InputParameters & parameters)
24  : DerivativeMaterialInterface<Material>(parameters),
25  _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""),
26  _plastic_strain(getMaterialProperty<RankTwoTensor>("plastic_strain")),
27  _plastic_strain_old(getMaterialPropertyOld<RankTwoTensor>("plastic_strain")),
28  _stress(getMaterialProperty<RankTwoTensor>(_base_name + "stress")),
29  _Jacobian_mult(getMaterialProperty<RankFourTensor>(_base_name + "Jacobian_mult")),
30  _elasticity_tensor(getMaterialProperty<RankFourTensor>(_base_name + "elasticity_tensor")),
31  _plastic_heat(declareProperty<Real>(_base_name + "plastic_heat")),
32  _dplastic_heat_dstrain(declareProperty<RankTwoTensor>(_base_name + "dplastic_heat_dstrain"))
33 {
34 }
35 
36 void
38 {
39  _plastic_heat[_qp] =
40  _stress[_qp].doubleContraction(_plastic_strain[_qp] - _plastic_strain_old[_qp]) / _dt;
41  if (_fe_problem.currentlyComputingJacobian())
42  {
43  if (_plastic_strain[_qp] == _plastic_strain_old[_qp])
44  // no plastic deformation, so _elasticity_tensor = _Jacobian_mult
45  _dplastic_heat_dstrain[_qp] = RankTwoTensor();
46  else
47  {
49  (_plastic_strain[_qp] - _plastic_strain_old[_qp]).initialContraction(_Jacobian_mult[_qp]);
50  _dplastic_heat_dstrain[_qp] += _stress[_qp];
52  _stress[_qp].initialContraction(_elasticity_tensor[_qp].invSymm() * _Jacobian_mult[_qp]);
53  _dplastic_heat_dstrain[_qp] /= _dt;
54  }
55  }
56 }
const MaterialProperty< RankFourTensor > & _Jacobian_mult
d(stress)/d(total strain)
ComputePlasticHeatEnergy(const InputParameters &parameters)
const MaterialProperty< RankTwoTensor > & _stress
stress
const MaterialProperty< RankFourTensor > & _elasticity_tensor
elasticity tensor
const MaterialProperty< RankTwoTensor > & _plastic_strain
plastic strain
const MaterialProperty< RankTwoTensor > & _plastic_strain_old
old value of plastic strain
InputParameters validParams< ComputePlasticHeatEnergy >()
MaterialProperty< Real > & _plastic_heat
computed property: stress * (plastic_strain - plastic_strain_old) / dt
virtual void computeQpProperties() override
MaterialProperty< RankTwoTensor > & _dplastic_heat_dstrain
d(plastic_heat)/d(total strain)