https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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{
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
32Real
39
40Real
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}
registerMooseObject("MooseApp", LinearFVReaction)
const Elem * elem() const
Definition ElemInfo.h:34
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...
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
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.
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.
Finite volume kernel that contributes approximations of volumetric integral terms to the matrix and r...
const ElemInfo * _current_elem_info
Pointer to the current element info.
static InputParameters validParams()
Real _current_elem_volume
The coordinate-specific element volume.
Kernel that adds contributions from a reaction term discretized using the finite volume method to a l...
virtual Real computeRightHandSideContribution() override
Computes the right hand side contribution for the given variable on the current element.
static InputParameters validParams()
const Moose::Functor< Real > & _coefficient
The functor for the reaction coefficient.
LinearFVReaction(const InputParameters &params)
Class constructor.
virtual Real computeMatrixContribution() override
Computes the system matrix contribution for the given variable on the current element.
Moose::StateArg determineState() const
Create a functor state argument that corresponds to the implicit state of this object.