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 "CoupledTimeDerivative.h" 11 : 12 : registerMooseObject("MooseApp", CoupledTimeDerivative); 13 : 14 : InputParameters 15 14290 : CoupledTimeDerivative::validParams() 16 : { 17 14290 : InputParameters params = Kernel::validParams(); 18 14290 : params.addClassDescription("Time derivative Kernel that acts on a coupled variable. Weak form: " 19 : "$(\\psi_i, \\frac{\\partial v_h}{\\partial t})$."); 20 14290 : params.addRequiredCoupledVar("v", "Coupled variable"); 21 14290 : return params; 22 0 : } 23 : 24 13 : CoupledTimeDerivative::CoupledTimeDerivative(const InputParameters & parameters) 25 13 : : Kernel(parameters), _v_dot(coupledDot("v")), _dv_dot(coupledDotDu("v")), _v_var(coupled("v")) 26 : { 27 13 : } 28 : 29 : Real 30 9600 : CoupledTimeDerivative::computeQpResidual() 31 : { 32 9600 : return _test[_i][_qp] * _v_dot[_qp]; 33 : } 34 : 35 : Real 36 25600 : CoupledTimeDerivative::computeQpJacobian() 37 : { 38 25600 : return 0.0; 39 : } 40 : 41 : Real 42 25600 : CoupledTimeDerivative::computeQpOffDiagJacobian(unsigned int jvar) 43 : { 44 25600 : if (jvar == _v_var) 45 25600 : return _test[_i][_qp] * _phi[_j][_qp] * _dv_dot[_qp]; 46 : 47 0 : return 0.0; 48 : }