Line data Source code
1 : //* This file is part of the RACCOON application 2 : //* being developed at Dolbow lab at Duke University 3 : //* http://dolbow.pratt.duke.edu 4 : //* By: @Sina-av 5 : 6 : #include "LinearHardening.h" 7 : 8 : registerMooseObject("raccoonApp", LinearHardening); 9 : 10 : InputParameters 11 148 : LinearHardening::validParams() 12 : { 13 148 : InputParameters params = PlasticHardeningModel::validParams(); 14 148 : params.addClassDescription("Plastic hardening following a linear isotropic law."); 15 : 16 296 : params.addRequiredParam<MaterialPropertyName>("yield_stress", 17 : "The initial yield stress $\\sigma_y$"); 18 296 : params.addRequiredParam<MaterialPropertyName>("hardening_modulus", "The hardening modulus $H$"); 19 : 20 296 : params.addRequiredCoupledVar("phase_field", "Name of the phase-field (damage) variable"); 21 296 : params.addParam<MaterialPropertyName>( 22 : "plastic_energy_density", 23 : "psip", 24 : "Name of the plastic energy density computed by this material model"); 25 296 : params.addParam<MaterialPropertyName>("degradation_function", "gp", "The degradation function"); 26 : 27 148 : return params; 28 0 : } 29 : 30 9 : LinearHardening::LinearHardening(const InputParameters & parameters) 31 : : PlasticHardeningModel(parameters), 32 : DerivativeMaterialPropertyNameInterface(), 33 27 : _sigma_y(getADMaterialProperty<Real>(prependBaseName("yield_stress", true))), 34 18 : _H(getADMaterialProperty<Real>(prependBaseName("hardening_modulus", true))), 35 : 36 18 : _d_name(getVar("phase_field", 0)->name()), 37 : 38 : // The strain energy density and its derivatives 39 9 : _psip_name(prependBaseName("plastic_energy_density", true)), 40 9 : _psip(declareADProperty<Real>(_psip_name)), 41 9 : _psip_active(declareADProperty<Real>(_psip_name + "_active")), 42 18 : _dpsip_dd(declareADProperty<Real>(derivativePropertyName(_psip_name, {_d_name}))), 43 : 44 : // The degradation function and its derivatives 45 9 : _gp_name(prependBaseName("degradation_function", true)), 46 9 : _gp(getADMaterialProperty<Real>(_gp_name)), 47 36 : _dgp_dd(getADMaterialProperty<Real>(derivativePropertyName(_gp_name, {_d_name}))) 48 : { 49 27 : } 50 : 51 : ADReal 52 140280 : LinearHardening::plasticEnergy(const ADReal & ep, const unsigned int derivative) 53 : { 54 140280 : if (derivative == 0) 55 : { 56 85944 : _psip_active[_qp] = _sigma_y[_qp] * ep + _H[_qp] / 2. * ep * ep; 57 57296 : _psip[_qp] = _gp[_qp] * _psip_active[_qp]; 58 57296 : _dpsip_dd[_qp] = _dgp_dd[_qp] * _psip_active[_qp]; 59 28648 : return _psip[_qp]; 60 : } 61 : // derivative of plastic energy w.r.t equivalent plastic strain ep 62 111632 : if (derivative == 1) 63 280560 : return _gp[_qp] * (_sigma_y[_qp] + _H[_qp] * ep); 64 : 65 41492 : if (derivative == 2) 66 41492 : return _gp[_qp] * _H[_qp]; 67 : 68 0 : mooseError(name(), "internal error: unsupported derivative order."); 69 : return 0; 70 : }