www.mooseframework.org
ComputeStrainIncrementBasedStress.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 
13 
14 template <>
15 InputParameters
17 {
18  InputParameters params = validParams<ComputeStressBase>();
19  params.addClassDescription("Compute stress after subtracting inelastic strain increments");
20  params.addParam<std::vector<MaterialPropertyName>>("inelastic_strain_names",
21  "Names of inelastic strain properties");
22 
23  return params;
24 }
25 
27  const InputParameters & parameters)
28  : ComputeStressBase(parameters),
29  _elasticity_tensor_name(_base_name + "elasticity_tensor"),
30  _elasticity_tensor(getMaterialPropertyByName<RankFourTensor>(_elasticity_tensor_name)),
31  _stress_old(getMaterialPropertyOld<RankTwoTensor>(_base_name + "stress")),
32  _mechanical_strain(getMaterialPropertyByName<RankTwoTensor>(_base_name + "mechanical_strain")),
33  _mechanical_strain_old(
34  getMaterialPropertyOldByName<RankTwoTensor>(_base_name + "mechanical_strain")),
35  _inelastic_strain_names(getParam<std::vector<MaterialPropertyName>>("inelastic_strain_names"))
36 {
38 
40  {
43 
44  for (unsigned int i = 0; i < _num_inelastic_strain_models; ++i)
45  {
46  _inelastic_strains[i] = &getMaterialProperty<RankTwoTensor>(_inelastic_strain_names[i]);
48  &getMaterialPropertyOld<RankTwoTensor>(_inelastic_strain_names[i]);
49  }
50  }
51 }
52 
53 void
55 {
56  RankTwoTensor elastic_strain_increment = (_mechanical_strain[_qp] - _mechanical_strain_old[_qp]);
57 
58  for (unsigned int i = 0; i < _num_inelastic_strain_models; ++i)
59  elastic_strain_increment -= (*_inelastic_strains[i])[_qp] - (*_inelastic_strains_old[i])[_qp];
60 
61  _stress[_qp] = _stress_old[_qp] + _elasticity_tensor[_qp] * elastic_strain_increment;
62 
64 }
65 
66 void
68 {
70 }
MaterialProperty< RankFourTensor > & _Jacobian_mult
derivative of stress w.r.t. strain (_dstress_dstrain)
ComputeStressBase is the base class for stress tensors.
ComputeStrainIncrementBasedStress computes stress considering list of inelastic strain increments...
const MaterialProperty< RankTwoTensor > & _stress_old
Old state of the stress tensor material property.
const MaterialProperty< RankTwoTensor > & _mechanical_strain_old
MaterialProperty< RankTwoTensor > & _stress
Stress material property.
std::vector< const MaterialProperty< RankTwoTensor > * > _inelastic_strains
Vectors of current and old states of the inelastic strain material properties.
unsigned int _num_inelastic_strain_models
Number of inelastic models.
virtual void computeQpStress()
Compute the stress and store it in the _stress material property for the current quadrature point...
registerMooseObject("TensorMechanicsApp", ComputeStrainIncrementBasedStress)
ComputeStrainIncrementBasedStress(const InputParameters &parameters)
const MaterialProperty< RankTwoTensor > & _mechanical_strain
Current and old states of the mechanical strain material property.
std::vector< MaterialPropertyName > _inelastic_strain_names
Names of the inelastic strain material properties for all inelastic models.
InputParameters validParams< ComputeStrainIncrementBasedStress >()
std::vector< const MaterialProperty< RankTwoTensor > * > _inelastic_strains_old
const MaterialProperty< RankFourTensor > & _elasticity_tensor
Elasticity tensor material property.
InputParameters validParams< ComputeStressBase >()