Line data Source code
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 : 10 : #include "ComputeFiniteStrainElasticStress.h" 11 : 12 : registerMooseObject("SolidMechanicsApp", ComputeFiniteStrainElasticStress); 13 : 14 : InputParameters 15 14446 : ComputeFiniteStrainElasticStress::validParams() 16 : { 17 14446 : InputParameters params = ComputeStressBase::validParams(); 18 14446 : params.addClassDescription("Compute stress using elasticity for finite strains"); 19 14446 : return params; 20 0 : } 21 : 22 10814 : ComputeFiniteStrainElasticStress::ComputeFiniteStrainElasticStress( 23 10814 : const InputParameters & parameters) 24 : : ComputeStressBase(parameters), 25 : GuaranteeConsumer(this), 26 10814 : _elasticity_tensor_name(_base_name + "elasticity_tensor"), 27 10814 : _elasticity_tensor(getMaterialPropertyByName<RankFourTensor>(_elasticity_tensor_name)), 28 10814 : _rotation_total(declareProperty<RankTwoTensor>(_base_name + "rotation_total")), 29 21628 : _rotation_total_old(getMaterialPropertyOldByName<RankTwoTensor>(_base_name + "rotation_total")), 30 21628 : _strain_increment(getMaterialPropertyByName<RankTwoTensor>(_base_name + "strain_increment")), 31 10814 : _rotation_increment( 32 10814 : getMaterialPropertyByName<RankTwoTensor>(_base_name + "rotation_increment")), 33 21628 : _stress_old(getMaterialPropertyOldByName<RankTwoTensor>(_base_name + "stress")), 34 32442 : _elastic_strain_old(getMaterialPropertyOldByName<RankTwoTensor>(_base_name + "elastic_strain")) 35 : { 36 10814 : } 37 : 38 : void 39 4268 : ComputeFiniteStrainElasticStress::initialSetup() 40 : { 41 4268 : } 42 : 43 : void 44 1015074 : ComputeFiniteStrainElasticStress::initQpStatefulProperties() 45 : { 46 1015074 : ComputeStressBase::initQpStatefulProperties(); 47 1015074 : RankTwoTensor identity_rotation(RankTwoTensor::initIdentity); 48 : 49 1015074 : _rotation_total[_qp] = identity_rotation; 50 1015074 : } 51 : 52 : void 53 39426490 : ComputeFiniteStrainElasticStress::computeQpStress() 54 : { 55 : // Calculate the stress in the intermediate configuration 56 39426490 : RankTwoTensor intermediate_stress; 57 : 58 78852980 : if (hasGuaranteedMaterialProperty(_elasticity_tensor_name, Guarantee::ISOTROPIC)) 59 : { 60 39350798 : intermediate_stress = 61 39350798 : _elasticity_tensor[_qp] * (_elastic_strain_old[_qp] + _strain_increment[_qp]); 62 : 63 : // Compute dstress_dstrain 64 39350798 : _Jacobian_mult[_qp] = _elasticity_tensor[_qp]; // This is NOT the exact jacobian 65 : } 66 : else 67 : { 68 : // Rotate elasticity tensor to the intermediate configuration 69 : // That is, elasticity tensor is defined in the previous time step 70 : // This is consistent with the definition of strain increment 71 : // The stress is projected onto the current configuration a few lines below 72 75692 : RankFourTensor elasticity_tensor_rotated = _elasticity_tensor[_qp]; 73 75692 : elasticity_tensor_rotated.rotate(_rotation_total_old[_qp]); 74 : 75 75692 : intermediate_stress = 76 75692 : elasticity_tensor_rotated * (_elastic_strain_old[_qp] + _strain_increment[_qp]); 77 : 78 : // Update current total rotation matrix to be used in next step 79 75692 : _rotation_total[_qp] = _rotation_increment[_qp] * _rotation_total_old[_qp]; 80 : 81 : // Compute dstress_dstrain 82 75692 : _Jacobian_mult[_qp] = elasticity_tensor_rotated; // This is NOT the exact jacobian 83 : } 84 : 85 : // Rotate the stress state to the current configuration 86 39426490 : _stress[_qp] = 87 39426490 : _rotation_increment[_qp] * intermediate_stress * _rotation_increment[_qp].transpose(); 88 : 89 : // Assign value for elastic strain, which is equal to the mechanical strain 90 39426490 : _elastic_strain[_qp] = _mechanical_strain[_qp]; 91 39426490 : }