https://mooseframework.inl.gov
LinearFVReaction.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 "LinearFVReaction.h"
11 #include "Assembly.h"
12 #include "SubProblem.h"
13 
15 
18 {
20  params.addClassDescription(
21  "Represents the matrix and right hand side contributions of a reaction "
22  "term ($c u$) in a partial differential equation.");
23  params.addParam<MooseFunctorName>("coeff", 1.0, "The reaction coefficient.");
24  return params;
25 }
26 
28  : LinearFVElementalKernel(params), _coefficient(getFunctor<Real>("coeff"))
29 {
30 }
31 
32 Real
34 {
35  // The matrix contribution is c_C*V_C
38 }
39 
40 Real
42 {
43  // We don't have any contributions to the right hand side as the reaction term is
44  // treated implicitly. If we treated it explicitly, the contribution to the RHS would be
45  // c * u * elem_volume
46  return 0.0;
47 }
const ElemInfo * _current_elem_info
Pointer to the current element info.
Moose::StateArg determineState() const
Create a functor state argument that corresponds to the implicit state of this object.
const Elem * elem() const
Definition: ElemInfo.h:34
static InputParameters validParams()
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
LinearFVReaction(const InputParameters &params)
Class constructor.
Finite volume kernel that contributes approximations of volumetric integral terms to the matrix and r...
Moose::ElemArg makeElemArg(const Elem *elem, bool correct_skewnewss=false) const
Helper method to create an elemental argument for a functor that includes whether to perform skewness...
virtual Real computeMatrixContribution() override
Computes the system matrix contribution for the given variable on the current element.
static InputParameters validParams()
registerMooseObject("MooseApp", LinearFVReaction)
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...
const Moose::Functor< Real > & _coefficient
The functor for the reaction coefficient.
Kernel that adds contributions from a reaction term discretized using the finite volume method to a l...
Real _current_elem_volume
The coordinate-specific element volume.
virtual Real computeRightHandSideContribution() override
Computes the right hand side contribution for the given variable on the current element.