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 "CrystalPlasticityStateVarRateComponentGSS.h" 11 : #include <cmath> 12 : 13 : registerMooseObject("TensorMechanicsApp", CrystalPlasticityStateVarRateComponentGSS); 14 : 15 : InputParameters 16 72 : CrystalPlasticityStateVarRateComponentGSS::validParams() 17 : { 18 72 : InputParameters params = CrystalPlasticityStateVarRateComponent::validParams(); 19 144 : params.addParam<std::string>( 20 : "uo_slip_rate_name", 21 : "Name of slip rate property: Same as slip rate user object specified in input file."); 22 144 : params.addParam<std::string>("uo_state_var_name", 23 : "Name of state variable property: Same as " 24 : "state variable user object specified in input " 25 : "file."); 26 144 : params.addParam<FileName>( 27 : "slip_sys_hard_prop_file_name", 28 : "", 29 : "Name of the file containing the values of hardness evolution parameters"); 30 144 : params.addParam<std::vector<Real>>("hprops", "Hardening properties"); 31 72 : params.addClassDescription("Phenomenological constitutive model state variable evolution rate " 32 : "component base class. Override the virtual functions in your class"); 33 72 : return params; 34 0 : } 35 : 36 36 : CrystalPlasticityStateVarRateComponentGSS::CrystalPlasticityStateVarRateComponentGSS( 37 36 : const InputParameters & parameters) 38 : : CrystalPlasticityStateVarRateComponent(parameters), 39 36 : _mat_prop_slip_rate( 40 36 : getMaterialProperty<std::vector<Real>>(parameters.get<std::string>("uo_slip_rate_name"))), 41 36 : _mat_prop_state_var( 42 36 : getMaterialProperty<std::vector<Real>>(parameters.get<std::string>("uo_state_var_name"))), 43 36 : _slip_sys_hard_prop_file_name(getParam<FileName>("slip_sys_hard_prop_file_name")), 44 108 : _hprops(getParam<std::vector<Real>>("hprops")) 45 : { 46 36 : } 47 : 48 : bool 49 167904 : CrystalPlasticityStateVarRateComponentGSS::calcStateVariableEvolutionRateComponent( 50 : unsigned int qp, std::vector<Real> & val) const 51 : { 52 167904 : val.assign(_variable_size, 0.0); 53 : 54 167904 : Real r = _hprops[0]; 55 167904 : Real h0 = _hprops[1]; 56 167904 : Real tau_sat = _hprops[2]; 57 : 58 167904 : DenseVector<Real> hb(_variable_size); 59 : Real qab; 60 167904 : Real a = _hprops[3]; // Kalidindi 61 : 62 2182752 : for (unsigned int i = 0; i < _variable_size; ++i) 63 2014848 : hb(i) = h0 * std::pow(std::abs(1.0 - _mat_prop_state_var[qp][i] / tau_sat), a) * 64 2014848 : std::copysign(1.0, 1.0 - _mat_prop_state_var[qp][i] / tau_sat); 65 : 66 2182752 : for (unsigned int i = 0; i < _variable_size; ++i) 67 : { 68 26193024 : for (unsigned int j = 0; j < _variable_size; ++j) 69 : { 70 : unsigned int iplane, jplane; 71 24178176 : iplane = i / 3; 72 24178176 : jplane = j / 3; 73 : 74 24178176 : if (iplane == jplane) // Kalidindi 75 : qab = 1.0; 76 : else 77 : qab = r; 78 : 79 24178176 : val[i] += std::abs(_mat_prop_slip_rate[qp][j]) * qab * hb(j); 80 : } 81 : } 82 : 83 167904 : return true; 84 : }