www.mooseframework.org
ComputeStrainIncrementBasedStress.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 /****************************************************************/
8 
9 template <>
10 InputParameters
12 {
13  InputParameters params = validParams<ComputeStressBase>();
14  params.addClassDescription("Compute stress after subtracting inelastic strain increments");
15  params.addParam<std::vector<MaterialPropertyName>>("inelastic_strain_names",
16  "Names of inelastic strain properties");
17 
18  return params;
19 }
20 
22  const InputParameters & parameters)
23  : ComputeStressBase(parameters),
24  _stress_old(getMaterialPropertyOld<RankTwoTensor>(_base_name + "stress")),
25  _mechanical_strain(getMaterialPropertyByName<RankTwoTensor>(_base_name + "mechanical_strain")),
26  _mechanical_strain_old(
27  getMaterialPropertyOldByName<RankTwoTensor>(_base_name + "mechanical_strain")),
28  _property_names(getParam<std::vector<MaterialPropertyName>>("inelastic_strain_names"))
29 {
31 
32  if (_num_property > 0)
33  {
36 
37  for (unsigned int i = 0; i < _num_property; ++i)
38  {
39  _inelastic_strains[i] = &getMaterialProperty<RankTwoTensor>(_property_names[i]);
40  _inelastic_strains_old[i] = &getMaterialPropertyOld<RankTwoTensor>(_property_names[i]);
41  }
42  }
43 }
44 
45 void
47 {
48  RankTwoTensor elastic_strain_increment = (_mechanical_strain[_qp] - _mechanical_strain_old[_qp]);
49 
50  for (unsigned int i = 0; i < _num_property; ++i)
51  elastic_strain_increment -= (*_inelastic_strains[i])[_qp] - (*_inelastic_strains_old[i])[_qp];
52 
53  _stress[_qp] = _stress_old[_qp] + _elasticity_tensor[_qp] * elastic_strain_increment;
54 
56 }
57 
58 void
60 {
62 }
MaterialProperty< RankFourTensor > & _Jacobian_mult
derivative of stress w.r.t. strain (_dstress_dstrain)
ComputeStressBase is the base class for stress tensors.
const MaterialProperty< RankTwoTensor > & _stress_old
const MaterialProperty< RankTwoTensor > & _mechanical_strain_old
MaterialProperty< RankTwoTensor > & _stress
std::vector< const MaterialProperty< RankTwoTensor > * > _inelastic_strains
ComputeStrainIncrementBasedStress(const InputParameters &parameters)
const MaterialProperty< RankTwoTensor > & _mechanical_strain
InputParameters validParams< ComputeStrainIncrementBasedStress >()
std::vector< MaterialPropertyName > _property_names
std::vector< const MaterialProperty< RankTwoTensor > * > _inelastic_strains_old
InputParameters validParams< ComputeStressBase >()
const MaterialProperty< RankFourTensor > & _elasticity_tensor