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 "PorousFlowExponentialDecay.h" 11 : 12 : #include "MooseVariable.h" 13 : 14 : registerMooseObject("PorousFlowApp", PorousFlowExponentialDecay); 15 : 16 : InputParameters 17 60 : PorousFlowExponentialDecay::validParams() 18 : { 19 60 : InputParameters params = Kernel::validParams(); 20 120 : params.addCoupledVar("rate", 1.0, "Rate of exponential decay"); 21 120 : params.addCoupledVar("reference", 0.0, "Reference value of the variable"); 22 60 : params.addClassDescription("Residual = rate * (variable - reference). Useful for modelling " 23 : "exponential decay of a variable"); 24 60 : return params; 25 0 : } 26 : 27 33 : PorousFlowExponentialDecay::PorousFlowExponentialDecay(const InputParameters & parameters) 28 33 : : Kernel(parameters), _rate(coupledValue("rate")), _reference(coupledValue("reference")) 29 : { 30 33 : } 31 : 32 : Real 33 2112 : PorousFlowExponentialDecay::computeQpResidual() 34 : { 35 2112 : return _test[_i][_qp] * _rate[_qp] * (_u[_qp] - _reference[_qp]); 36 : } 37 : 38 : Real 39 3264 : PorousFlowExponentialDecay::computeQpJacobian() 40 : { 41 3264 : return _test[_i][_qp] * _rate[_qp] * _phi[_j][_qp]; 42 : }