www.mooseframework.org
PorousFlowExponentialDecay.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 
11 
12 #include "MooseVariable.h"
13 
15 
18 {
20  params.addCoupledVar("rate", 1.0, "Rate of exponential decay");
21  params.addCoupledVar("reference", 0.0, "Reference value of the variable");
22  params.addClassDescription("Residual = rate * (variable - reference). Useful for modelling "
23  "exponential decay of a variable");
24  return params;
25 }
26 
28  : Kernel(parameters), _rate(coupledValue("rate")), _reference(coupledValue("reference"))
29 {
30 }
31 
32 Real
34 {
35  return _test[_i][_qp] * _rate[_qp] * (_u[_qp] - _reference[_qp]);
36 }
37 
38 Real
40 {
41  return _test[_i][_qp] * _rate[_qp] * _phi[_j][_qp];
42 }
static InputParameters validParams()
static InputParameters validParams()
virtual Real computeQpResidual() override
PorousFlowExponentialDecay(const InputParameters &parameters)
const VariableTestValue & _test
unsigned int _i
const VariableValue & _rate
The decay rate.
void addCoupledVar(const std::string &name, const std::string &doc_string)
unsigned int _j
virtual Real computeQpJacobian() override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
const VariableValue & _reference
The reference.
Kernel = _rate * (variable - reference)
registerMooseObject("PorousFlowApp", PorousFlowExponentialDecay)
const VariablePhiValue & _phi
const VariableValue & _u
unsigned int _qp