Line data Source code
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 : 10 : #include "ComputeLinearViscoelasticStress.h" 11 : 12 : registerMooseObject("TensorMechanicsApp", ComputeLinearViscoelasticStress); 13 : 14 : InputParameters 15 12 : ComputeLinearViscoelasticStress::validParams() 16 : { 17 12 : InputParameters params = ComputeLinearElasticStress::validParams(); 18 12 : params.addClassDescription("Divides total strain into elastic + creep + eigenstrains"); 19 24 : params.addParam<std::string>( 20 : "apparent_creep_strain", 21 : "apparent_creep_strain", 22 : "name of the apparent creep strain (defined by a LinearViscoelasticityBase material)"); 23 24 : params.addParam<std::string>( 24 : "apparent_elasticity_tensor", 25 : "apparent_elasticity_tensor", 26 : "name of the apparent elasticity tensor (defined by a LinearViscoelasticityBase material)"); 27 24 : params.addParam<std::string>( 28 : "elasticity_tensor_inv", 29 : "elasticity_tensor_inv", 30 : "name of the real compliance tensor (defined by a LinearViscoelasticityBase material)"); 31 12 : return params; 32 0 : } 33 : 34 9 : ComputeLinearViscoelasticStress::ComputeLinearViscoelasticStress(const InputParameters & parameters) 35 : : ComputeLinearElasticStress(parameters), 36 9 : _creep_strain(declareProperty<RankTwoTensor>( 37 18 : isParamValid("base_name") ? _base_name + "_creep_strain" : "creep_strain")), 38 9 : _creep_strain_old(getMaterialPropertyOld<RankTwoTensor>( 39 27 : isParamValid("base_name") ? _base_name + "_creep_strain" : "creep_strain")), 40 18 : _apparent_creep_strain(getMaterialProperty<RankTwoTensor>("apparent_creep_strain")), 41 18 : _apparent_elasticity_tensor(getMaterialProperty<RankFourTensor>("apparent_elasticity_tensor")), 42 27 : _elasticity_tensor_inv(getMaterialProperty<RankFourTensor>("elasticity_tensor_inv")) 43 : { 44 9 : } 45 : 46 : void 47 48 : ComputeLinearViscoelasticStress::initQpStatefulProperties() 48 : { 49 48 : _creep_strain[_qp].zero(); 50 48 : } 51 : 52 : void 53 10392 : ComputeLinearViscoelasticStress::computeQpStress() 54 : { 55 10392 : _creep_strain[_qp] = 56 10392 : _mechanical_strain[_qp] - (_apparent_elasticity_tensor[_qp] * _elasticity_tensor_inv[_qp]) * 57 20784 : (_mechanical_strain[_qp] - _apparent_creep_strain[_qp]); 58 : 59 10392 : _elastic_strain[_qp] = _mechanical_strain[_qp] - _creep_strain[_qp]; 60 : 61 10392 : _stress[_qp] = _elasticity_tensor[_qp] * _elastic_strain[_qp]; 62 : 63 10392 : _Jacobian_mult[_qp] = _elasticity_tensor[_qp]; 64 10392 : }