https://mooseframework.inl.gov
ADComputeFiniteStrainElasticStress.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 #include "RankTwoTensor.h"
12 #include "RankFourTensor.h"
13 #include "SymmetricRankTwoTensor.h"
15 
18 
19 template <typename R2, typename R4>
22 {
24  params.addClassDescription("Compute stress using elasticity for finite strains");
25  return params;
26 }
27 
28 template <typename R2, typename R4>
30  const InputParameters & parameters)
31  : ADComputeStressBaseTempl<R2>(parameters),
32  GuaranteeConsumer(this),
33  _elasticity_tensor_name(_base_name + "elasticity_tensor"),
34  _elasticity_tensor(this->template getADMaterialProperty<R4>(_elasticity_tensor_name)),
35  _strain_increment(
36  this->template getADMaterialPropertyByName<R2>(_base_name + "strain_increment")),
37  _rotation_total(this->template declareADProperty<RankTwoTensor>(_base_name + "rotation_total")),
38  _rotation_total_old(
39  this->template getMaterialPropertyOldByName<RankTwoTensor>(_base_name + "rotation_total")),
40  _rotation_increment(this->template getADMaterialPropertyByName<RankTwoTensor>(
41  _base_name + "rotation_increment")),
42  _stress_old(this->template getMaterialPropertyOldByName<R2>(_base_name + "stress")),
43  _elastic_strain_old(
44  this->template getMaterialPropertyOldByName<R2>(_base_name + "elastic_strain"))
45 {
46 }
47 
48 template <typename R2, typename R4>
49 void
51 {
52 }
53 
54 template <typename R2, typename R4>
55 void
57 {
59  _rotation_total[_qp] = RankTwoTensor::Identity();
60 }
61 
62 template <typename R2, typename R4>
63 void
65 {
66  // Calculate the stress in the intermediate configuration
67  ADR2 intermediate_stress;
68 
69  if (hasGuaranteedMaterialProperty(_elasticity_tensor_name, Guarantee::ISOTROPIC))
70  intermediate_stress =
71  _elasticity_tensor[_qp] * (_strain_increment[_qp] + _elastic_strain_old[_qp]);
72  else
73  {
74  // Rotate elasticity tensor to the intermediate configuration
75  // That is, elasticity tensor is defined in the previous time step
76  // This is consistent with the definition of strain increment
77  // The stress is projected onto the current configuration a few lines below
78  auto elasticity_tensor_rotated = _elasticity_tensor[_qp];
79  elasticity_tensor_rotated.rotate(_rotation_total_old[_qp]);
80 
81  intermediate_stress =
82  elasticity_tensor_rotated * (_elastic_strain_old[_qp] + _strain_increment[_qp]);
83 
84  // Update current total rotation matrix to be used in next step
85  _rotation_total[_qp] = _rotation_increment[_qp] * _rotation_total_old[_qp];
86  }
87  // Rotate the stress state to the current configuration
88  _stress[_qp] = intermediate_stress;
89  _stress[_qp].rotate(_rotation_increment[_qp]);
90 
91  // Assign value for elastic strain, which is equal to the mechanical strain
92  _elastic_strain[_qp] = _mechanical_strain[_qp];
93 }
94 
registerMooseObject("SolidMechanicsApp", ADComputeFiniteStrainElasticStress)
virtual void initQpStatefulProperties() override
static RankTwoTensorTempl Identity()
ADComputeFiniteStrainElasticStressTempl(const InputParameters &parameters)
ADComputeFiniteStrainElasticStress computes the stress following elasticity theory for finite strains...
static InputParameters validParams()
void addClassDescription(const std::string &doc_string)
ADComputeStressBaseTempl is the base class for stress tensors.
Add-on class that provides the functionality to check if guarantees for material properties are provi...