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 "ComputePlasticHeatEnergy.h" 11 : 12 : registerMooseObject("SolidMechanicsApp", ComputePlasticHeatEnergy); 13 : 14 : InputParameters 15 24 : ComputePlasticHeatEnergy::validParams() 16 : { 17 24 : InputParameters params = Material::validParams(); 18 48 : params.addParam<std::string>("base_name", 19 : "Optional parameter that allows the user to define " 20 : "multiple mechanics material systems on the same " 21 : "block, i.e. for multiple phases"); 22 24 : params.addClassDescription("Plastic heat energy density = stress * plastic_strain_rate"); 23 24 : return params; 24 0 : } 25 : 26 18 : ComputePlasticHeatEnergy::ComputePlasticHeatEnergy(const InputParameters & parameters) 27 : : DerivativeMaterialInterface<Material>(parameters), 28 18 : _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""), 29 36 : _plastic_strain(getMaterialProperty<RankTwoTensor>("plastic_strain")), 30 36 : _plastic_strain_old(getMaterialPropertyOld<RankTwoTensor>("plastic_strain")), 31 36 : _stress(getMaterialProperty<RankTwoTensor>(_base_name + "stress")), 32 36 : _Jacobian_mult(getMaterialProperty<RankFourTensor>(_base_name + "Jacobian_mult")), 33 36 : _elasticity_tensor(getMaterialProperty<RankFourTensor>(_base_name + "elasticity_tensor")), 34 18 : _plastic_heat(declareProperty<Real>(_base_name + "plastic_heat")), 35 36 : _dplastic_heat_dstrain(declareProperty<RankTwoTensor>(_base_name + "dplastic_heat_dstrain")) 36 : { 37 18 : } 38 : 39 : void 40 928 : ComputePlasticHeatEnergy::computeQpProperties() 41 : { 42 928 : _plastic_heat[_qp] = 43 928 : _stress[_qp].doubleContraction(_plastic_strain[_qp] - _plastic_strain_old[_qp]) / _dt; 44 928 : if (_fe_problem.currentlyComputingJacobian()) 45 : { 46 32 : if (_plastic_strain[_qp] == _plastic_strain_old[_qp]) 47 : // no plastic deformation, so _elasticity_tensor = _Jacobian_mult 48 0 : _dplastic_heat_dstrain[_qp] = RankTwoTensor(); 49 : else 50 : { 51 32 : _dplastic_heat_dstrain[_qp] = 52 32 : (_plastic_strain[_qp] - _plastic_strain_old[_qp]).initialContraction(_Jacobian_mult[_qp]); 53 32 : _dplastic_heat_dstrain[_qp] += _stress[_qp]; 54 32 : _dplastic_heat_dstrain[_qp] -= 55 32 : _stress[_qp].initialContraction(_elasticity_tensor[_qp].invSymm() * _Jacobian_mult[_qp]); 56 32 : _dplastic_heat_dstrain[_qp] /= _dt; 57 : } 58 : } 59 928 : }