https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ComputeStrainIncrementBasedStress.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
13
16{
18 params.addClassDescription("Compute stress after subtracting inelastic strain increments");
19 params.addParam<std::vector<MaterialPropertyName>>(
20 "inelastic_strain_names", {}, "Names of inelastic strain properties");
21
22 return params;
23}
24
26 const InputParameters & parameters)
27 : ComputeStressBase(parameters),
28 _elasticity_tensor_name(_base_name + "elasticity_tensor"),
29 _elasticity_tensor(getMaterialPropertyByName<RankFourTensor>(_elasticity_tensor_name)),
30 _stress_old(getMaterialPropertyOld<RankTwoTensor>(_base_name + "stress")),
31 _mechanical_strain_old(
32 getMaterialPropertyOldByName<RankTwoTensor>(_base_name + "mechanical_strain")),
33 _inelastic_strain_names(getParam<std::vector<MaterialPropertyName>>("inelastic_strain_names"))
34{
36
38 {
41
42 for (unsigned int i = 0; i < _num_inelastic_strain_models; ++i)
43 {
44 _inelastic_strains[i] = &getMaterialProperty<RankTwoTensor>(_inelastic_strain_names[i]);
46 &getMaterialPropertyOld<RankTwoTensor>(_inelastic_strain_names[i]);
47 }
48 }
49}
50
51void
53{
54 RankTwoTensor elastic_strain_increment = (_mechanical_strain[_qp] - _mechanical_strain_old[_qp]);
55
56 for (unsigned int i = 0; i < _num_inelastic_strain_models; ++i)
57 elastic_strain_increment -= (*_inelastic_strains[i])[_qp] - (*_inelastic_strains_old[i])[_qp];
58
59 _stress[_qp] = _stress_old[_qp] + _elasticity_tensor[_qp] * elastic_strain_increment;
60
62}
63
64void
registerMooseObject("SolidMechanicsApp", ComputeStrainIncrementBasedStress)
const MaterialProperty< RankTwoTensor > & _mechanical_strain
Mechanical strain material property.
MaterialProperty< RankFourTensor > & _Jacobian_mult
derivative of stress w.r.t. strain (_dstress_dstrain)
MaterialProperty< RankTwoTensor > & _stress
Stress material property.
ComputeStrainIncrementBasedStress computes stress considering list of inelastic strain increments.
std::vector< const MaterialProperty< RankTwoTensor > * > _inelastic_strains_old
std::vector< MaterialPropertyName > _inelastic_strain_names
Names of the inelastic strain material properties for all inelastic models.
ComputeStrainIncrementBasedStress(const InputParameters &parameters)
const MaterialProperty< RankTwoTensor > & _stress_old
Old state of the stress tensor material property.
unsigned int _num_inelastic_strain_models
Number of inelastic models.
const MaterialProperty< RankTwoTensor > & _mechanical_strain_old
Old state of the mechanical strain material property.
virtual void computeQpStress()
Compute the stress and store it in the _stress material property for the current quadrature point.
std::vector< const MaterialProperty< RankTwoTensor > * > _inelastic_strains
Vectors of current and old states of the inelastic strain material properties.
const MaterialProperty< RankFourTensor > & _elasticity_tensor
Elasticity tensor material property.
ComputeStressBase is the base class for stress tensors computed from MOOSE's strain calculators.
static InputParameters validParams()
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)