LCOV - code coverage report
Current view: top level - src/linearfvkernels - LinearFVReaction.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 2bf808 Lines: 13 14 92.9 %
Date: 2025-07-17 01:28:37 Functions: 4 4 100.0 %
Legend: Lines: hit not hit

          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 "LinearFVReaction.h"
      11             : #include "Assembly.h"
      12             : #include "SubProblem.h"
      13             : 
      14             : registerMooseObject("MooseApp", LinearFVReaction);
      15             : 
      16             : InputParameters
      17       14963 : LinearFVReaction::validParams()
      18             : {
      19       14963 :   InputParameters params = LinearFVElementalKernel::validParams();
      20       14963 :   params.addClassDescription(
      21             :       "Represents the matrix and right hand side contributions of a reaction "
      22             :       "term ($c u$) in a partial differential equation.");
      23       14963 :   params.addParam<MooseFunctorName>("coeff", 1.0, "The reaction coefficient.");
      24       14963 :   return params;
      25           0 : }
      26             : 
      27         349 : LinearFVReaction::LinearFVReaction(const InputParameters & params)
      28         349 :   : LinearFVElementalKernel(params), _coefficient(getFunctor<Real>("coeff"))
      29             : {
      30         349 : }
      31             : 
      32             : Real
      33      130298 : LinearFVReaction::computeMatrixContribution()
      34             : {
      35             :   // The matrix contribution is c_C*V_C
      36      130298 :   return _coefficient(makeElemArg(_current_elem_info->elem()), determineState()) *
      37      130298 :          _current_elem_volume;
      38             : }
      39             : 
      40             : Real
      41      130298 : LinearFVReaction::computeRightHandSideContribution()
      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      130298 :   return 0.0;
      47             : }

Generated by: LCOV version 1.14