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 : 5 : #include "ThinFilmInterfaceEnergyDensity.h" 6 : 7 : registerMooseObject("raccoonApp", ThinFilmInterfaceEnergyDensity); 8 : 9 : InputParameters 10 136 : ThinFilmInterfaceEnergyDensity::validParams() 11 : { 12 136 : InputParameters params = Material::validParams(); 13 136 : params += BaseNameInterface::validParams(); 14 136 : params.addClassDescription( 15 : "This class compute the interface energy density corresponding to a shear-lag model, " 16 : "i.e. $\\psi^i = 0.5 c \\bs{u} \\cdot \\bs{u}$."); 17 : 18 272 : params.addRequiredParam<MaterialPropertyName>( 19 : "shear_lag_coef", 20 : "The coefficient describing the mismatch between the film and the substrate"); 21 272 : params.addRequiredCoupledVar( 22 : "displacements", 23 : "The displacements appropriate for the simulation geometry and coordinate system"); 24 : 25 272 : params.addRequiredCoupledVar("phase_field", "Name of the phase-field (damage) variable"); 26 272 : params.addParam<MaterialPropertyName>( 27 : "interface_energy_density", "psii", "Name of the interfacial energy density"); 28 272 : params.addParam<MaterialPropertyName>("degradation_function", "g", "The degradation function"); 29 : 30 136 : return params; 31 0 : } 32 : 33 0 : ThinFilmInterfaceEnergyDensity::ThinFilmInterfaceEnergyDensity(const InputParameters & parameters) 34 : : Material(parameters), 35 : DerivativeMaterialPropertyNameInterface(), 36 : BaseNameInterface(parameters), 37 0 : _coef(getADMaterialProperty<Real>(prependBaseName("shear_lag_coef", true))), 38 0 : _ndisp(coupledComponents("displacements")), 39 0 : _disp(3), 40 : 41 0 : _d_name(getVar("phase_field", 0)->name()), 42 : 43 : // The strain energy density and its derivatives 44 0 : _psii_name(prependBaseName("interface_energy_density", true)), 45 0 : _psii(declareADProperty<Real>(_psii_name)), 46 0 : _psii_active(declareADProperty<Real>(_psii_name + "_active")), 47 0 : _dpsii_dd(declareADProperty<Real>(derivativePropertyName(_psii_name, {_d_name}))), 48 : 49 : // The degradation function and its derivatives 50 0 : _g_name(prependBaseName("degradation_function", true)), 51 0 : _g(getADMaterialProperty<Real>(_g_name)), 52 0 : _dg_dd(getADMaterialProperty<Real>(derivativePropertyName(_g_name, {_d_name}))) 53 : { 54 0 : for (unsigned int i = 0; i < _ndisp; ++i) 55 0 : _disp[i] = &adCoupledValue("displacements", i); 56 : 57 : // set unused dimensions to zero 58 0 : for (unsigned i = _ndisp; i < 3; ++i) 59 0 : _disp[i] = &_ad_zero; 60 0 : } 61 : 62 : void 63 0 : ThinFilmInterfaceEnergyDensity::computeQpProperties() 64 : { 65 0 : ADRealVectorValue u((*_disp[0])[_qp], (*_disp[1])[_qp], (*_disp[2])[_qp]); 66 0 : _psii_active[_qp] = 0.5 * _coef[_qp] * u * u; 67 0 : _psii[_qp] = _g[_qp] * _psii_active[_qp]; 68 0 : _dpsii_dd[_qp] = _dg_dd[_qp] * _psii_active[_qp]; 69 0 : }