https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ADComputeStrainIncrementBasedStress.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 : ADComputeStressBase(parameters),
28 _elasticity_tensor_name(_base_name + "elasticity_tensor"),
29 _elasticity_tensor(getADMaterialPropertyByName<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] = &getADMaterialProperty<RankTwoTensor>(_inelastic_strain_names[i]);
46 &getMaterialPropertyOld<RankTwoTensor>(_inelastic_strain_names[i]);
47 }
48 }
49}
50
51void
53{
54 ADRankTwoTensor elastic_strain_increment =
56
57 for (unsigned int i = 0; i < _num_inelastic_strain_models; ++i)
58 elastic_strain_increment -= (*_inelastic_strains[i])[_qp] - (*_inelastic_strains_old[i])[_qp];
59
60 _stress[_qp] = _stress_old[_qp] + _elasticity_tensor[_qp] * elastic_strain_increment;
61}
registerMooseObject("SolidMechanicsApp", ADComputeStrainIncrementBasedStress)
ADComputeStrainIncrementBasedStress computes stress considering list of inelastic strain increments.
const ADMaterialProperty< RankFourTensor > & _elasticity_tensor
Elasticity tensor material property.
std::vector< MaterialPropertyName > _inelastic_strain_names
Names of the inelastic strain material properties for all inelastic models.
std::vector< const MaterialProperty< RankTwoTensor > * > _inelastic_strains_old
const MaterialProperty< RankTwoTensor > & _mechanical_strain_old
Old state of the mechanical strain material property.
unsigned int _num_inelastic_strain_models
Number of inelastic models.
const MaterialProperty< RankTwoTensor > & _stress_old
Old state of the stress tensor material property.
std::vector< const ADMaterialProperty< RankTwoTensor > * > _inelastic_strains
Vectors of current and old states of the inelastic strain material properties.
ADComputeStrainIncrementBasedStress(const InputParameters &parameters)
ADComputeStressBaseTempl is the base class for stress tensors.
ADMaterialProperty< R2 > & _stress
The stress tensor to be calculated.
const ADMaterialProperty< R2 > & _mechanical_strain
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)
unsigned int _qp