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 "GeneralizedKelvinVoigtBase.h" 11 : 12 : InputParameters 13 168 : GeneralizedKelvinVoigtBase::validParams() 14 : { 15 168 : InputParameters params = LinearViscoelasticityBase::validParams(); 16 168 : params.set<bool>("need_viscoelastic_properties_inverse") = true; 17 168 : params.suppressParameter<bool>("need_viscoelastic_properties_inverse"); 18 168 : return params; 19 0 : } 20 : 21 126 : GeneralizedKelvinVoigtBase::GeneralizedKelvinVoigtBase(const InputParameters & parameters) 22 : : LinearViscoelasticityBase(parameters), 23 126 : _first_elasticity_tensor_old( 24 252 : getMaterialPropertyOld<RankFourTensor>(_base_name + "spring_elasticity_tensor_0")), 25 126 : _first_elasticity_tensor_inv_old( 26 252 : getMaterialPropertyOld<RankFourTensor>(_base_name + "spring_elasticity_tensor_0_inv")) 27 : { 28 126 : } 29 : 30 : void 31 6688 : GeneralizedKelvinVoigtBase::updateQpViscousStrains() 32 : { 33 6688 : if (_t_step <= 1) 34 240 : return; 35 : 36 6448 : RankTwoTensor effective_stress = _first_elasticity_tensor_old[_qp] * _elastic_strain_old[_qp]; 37 : 38 6448 : if (_has_driving_eigenstrain) 39 1208 : effective_stress += _first_elasticity_tensor_old[_qp] * (*_driving_eigenstrain_old)[_qp]; 40 : 41 15720 : for (unsigned int i = 0; i < _springs_elasticity_tensors.size(); ++i) 42 : { 43 9272 : Real theta_i = computeTheta(_dt_old, (*_dashpot_viscosities_old[i])[_qp]); 44 9272 : Real gamma = (*_dashpot_viscosities_old[i])[_qp] / (_dt_old * theta_i); 45 9272 : (*_viscous_strains[i])[_qp] = 46 9272 : ((*_springs_elasticity_tensors_inv_old[i])[_qp] * effective_stress) / 47 9272 : (theta_i * (1. + gamma)); 48 18544 : (*_viscous_strains[i])[_qp] += (*_viscous_strains_old[i])[_qp] * 49 9272 : (gamma / (theta_i * (1. + gamma)) - (1. - theta_i) / theta_i); 50 : } 51 : 52 6448 : if (_has_longterm_dashpot) 53 : { 54 2416 : (*_viscous_strains.back())[_qp] = (_first_elasticity_tensor_inv_old[_qp] * effective_stress) * 55 2416 : (_dt_old / (*_dashpot_viscosities_old.back())[_qp]); 56 2416 : (*_viscous_strains.back())[_qp] += (*_viscous_strains_old.back())[_qp]; 57 : } 58 : } 59 : 60 : void 61 6688 : GeneralizedKelvinVoigtBase::computeQpApparentElasticityTensors() 62 : { 63 6688 : _elasticity_tensor[_qp] = _first_elasticity_tensor[_qp]; 64 6688 : _elasticity_tensor_inv[_qp] = (*_first_elasticity_tensor_inv)[_qp]; 65 6688 : _apparent_elasticity_tensor_inv[_qp] = (*_first_elasticity_tensor_inv)[_qp]; 66 : 67 16320 : for (unsigned int i = 0; i < _springs_elasticity_tensors.size(); ++i) 68 : { 69 9632 : Real theta_i = computeTheta(_dt, (*_dashpot_viscosities[i])[_qp]); 70 9632 : Real gamma = (*_dashpot_viscosities[i])[_qp] / (_dt * theta_i); 71 9632 : _apparent_elasticity_tensor_inv[_qp] += 72 19264 : (*_springs_elasticity_tensors_inv[i])[_qp] / (1. + gamma); 73 : } 74 : 75 6688 : if (_has_longterm_dashpot) 76 : { 77 2496 : Real theta_i = computeTheta(_dt, (*_dashpot_viscosities.back())[_qp]); 78 2496 : Real gamma = (*_dashpot_viscosities.back())[_qp] / (_dt * theta_i); 79 4992 : _apparent_elasticity_tensor_inv[_qp] += (*_first_elasticity_tensor_inv)[_qp] / gamma; 80 : } 81 : 82 6688 : _apparent_elasticity_tensor[_qp] = _apparent_elasticity_tensor_inv[_qp].invSymm(); 83 6688 : } 84 : 85 : void 86 6688 : GeneralizedKelvinVoigtBase::computeQpApparentCreepStrain() 87 : { 88 6688 : _apparent_creep_strain[_qp].zero(); 89 : 90 16320 : for (unsigned int i = 0; i < _springs_elasticity_tensors.size(); ++i) 91 : { 92 9632 : Real theta_i = computeTheta(_dt, (*_dashpot_viscosities[i])[_qp]); 93 9632 : Real gamma = (*_dashpot_viscosities[i])[_qp] / (_dt * theta_i); 94 9632 : _apparent_creep_strain[_qp] += (*_viscous_strains[i])[_qp] * (gamma / (1. + gamma)); 95 : } 96 : 97 6688 : if (_has_longterm_dashpot) 98 2496 : _apparent_creep_strain[_qp] += (*_viscous_strains.back())[_qp]; 99 : 100 6688 : if (_has_driving_eigenstrain) 101 : { 102 1248 : RankFourTensor cumulated_driving_tensor; 103 1248 : cumulated_driving_tensor.zero(); 104 1248 : for (unsigned int i = 0; i < _springs_elasticity_tensors.size(); ++i) 105 : { 106 0 : double theta_i = computeTheta(_dt, (*_dashpot_viscosities[i])[_qp]); 107 0 : double gamma = (*_dashpot_viscosities[i])[_qp] / (_dt * theta_i); 108 0 : cumulated_driving_tensor += (*_springs_elasticity_tensors_inv[i])[_qp] / (1. + gamma); 109 : } 110 : 111 1248 : _apparent_creep_strain[_qp] += 112 1248 : (_elasticity_tensor[_qp] * cumulated_driving_tensor) * (*_driving_eigenstrain)[_qp]; 113 : 114 1248 : if (_has_longterm_dashpot) 115 : { 116 1248 : double theta_i = computeTheta(_dt, (*_dashpot_viscosities.back())[_qp]); 117 1248 : double gamma = (*_dashpot_viscosities.back())[_qp] / (_dt * theta_i); 118 1248 : _apparent_creep_strain[_qp] += (*_driving_eigenstrain)[_qp] / gamma; 119 : } 120 : } 121 6688 : }