Line data Source code
1 : /**********************************************************************/ 2 : /* DO NOT MODIFY THIS HEADER */ 3 : /* MAGPIE - Mesoscale Atomistic Glue Program for Integrated Execution */ 4 : /* */ 5 : /* Copyright 2017 Battelle Energy Alliance, LLC */ 6 : /* ALL RIGHTS RESERVED */ 7 : /**********************************************************************/ 8 : 9 : #include "CoupledDefectAnnihilation.h" 10 : 11 : registerMooseObject("MagpieApp", CoupledDefectAnnihilation); 12 : 13 : InputParameters 14 0 : CoupledDefectAnnihilation::validParams() 15 : { 16 0 : InputParameters params = Kernel::validParams(); 17 0 : params.addClassDescription("Coupled annihilation rate kernel that is proportional to the product " 18 : "of two coupled variables c and v."); 19 0 : params.addRequiredCoupledVar("c", "First defect concentration"); 20 0 : params.addRequiredCoupledVar("v", "Other defect concentration"); 21 0 : params.addParam<Real>("prefactor", 1.0, "Annihilation rate"); 22 0 : return params; 23 0 : } 24 : 25 0 : CoupledDefectAnnihilation::CoupledDefectAnnihilation(const InputParameters & parameters) 26 : : Kernel(parameters), 27 0 : _c(coupledValue("c")), 28 0 : _c_var(coupled("c")), 29 0 : _v(coupledValue("v")), 30 0 : _v_var(coupled("v")), 31 0 : _prefactor(getParam<Real>("prefactor")) 32 : { 33 0 : } 34 : 35 : Real 36 0 : CoupledDefectAnnihilation::computeQpResidual() 37 : { 38 0 : return _prefactor * _c[_qp] * _v[_qp] * _test[_i][_qp]; 39 : } 40 : 41 : Real 42 0 : CoupledDefectAnnihilation::computeQpJacobian() 43 : { 44 0 : return 0.0; 45 : } 46 : 47 : Real 48 0 : CoupledDefectAnnihilation::computeQpOffDiagJacobian(unsigned int jvar) 49 : { 50 0 : if (jvar == _v_var) 51 0 : return _prefactor * _c[_qp] * _phi[_j][_qp] * _test[_i][_qp]; 52 : 53 0 : if (jvar == _c_var) 54 0 : return _prefactor * _phi[_j][_qp] * _v[_qp] * _test[_i][_qp]; 55 : 56 : return 0.0; 57 : }