https://mooseframework.inl.gov
ReactionNodalKernel.C
Go to the documentation of this file.
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 "ReactionNodalKernel.h"
11 
12 #include "Function.h"
13 
15 
18 {
20  params.addClassDescription("Implements a simple consuming reaction term at nodes");
21  params.addParam<Real>("coeff", 1., "A coefficient for multiplying the reaction term");
22  return params;
23 }
24 
26  : NodalKernel(parameters), _coeff(getParam<Real>("coeff"))
27 {
28 }
29 
30 Real
32 {
33  return _coeff * _u[_qp];
34 }
35 
36 Real
38 {
39  return _coeff;
40 }
Represents a nodal reaction term equivalent to $a * u$.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
registerMooseObject("MooseApp", ReactionNodalKernel)
virtual Real computeQpJacobian() override
The user can override this function to compute the "on-diagonal" Jacobian contribution.
virtual Real computeQpResidual() override
The user can override this function to compute the residual at a node.
static InputParameters validParams()
ReactionNodalKernel(const InputParameters &parameters)
const VariableValue & _u
Value of the unknown variable this is acting on.
Definition: NodalKernel.h:72
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump...
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an optional parameter and a documentation string to the InputParameters object...
static InputParameters validParams()
Class constructor.
Definition: NodalKernel.C:18
Base class for creating nodal kernels with hand-coded Jacobians.
Definition: NodalKernel.h:17
unsigned int _qp
Quadrature point index.
const Real _coeff
An optional input-file supplied rate coefficient.