LCOV - code coverage report
Current view: top level - src/linearfvkernels - LinearFVDivergence.C (source / functions) Hit Total Coverage
Test: idaholab/moose navier_stokes: 9fc4b0 Lines: 27 28 96.4 %
Date: 2025-08-14 10:14:56 Functions: 9 9 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 "LinearFVDivergence.h"
      11             : 
      12             : registerMooseObject("NavierStokesApp", LinearFVDivergence);
      13             : 
      14             : InputParameters
      15        1618 : LinearFVDivergence::validParams()
      16             : {
      17        1618 :   InputParameters params = LinearFVFluxKernel::validParams();
      18        1618 :   params.addClassDescription("Represents a divergence term. Note, this term does not contribute to "
      19             :                              "the system matrix, only takes the divergence of a face flux field "
      20             :                              "and adds it to the right hand side of the linear system.");
      21        3236 :   params.addRequiredParam<MooseFunctorName>("face_flux", "Functor for the face flux.");
      22        1618 :   return params;
      23           0 : }
      24             : 
      25         809 : LinearFVDivergence::LinearFVDivergence(const InputParameters & params)
      26        1618 :   : LinearFVFluxKernel(params), _face_flux(getFunctor<Real>("face_flux"))
      27             : 
      28             : {
      29         809 : }
      30             : 
      31             : Real
      32    22964624 : LinearFVDivergence::computeElemMatrixContribution()
      33             : {
      34    22964624 :   return 0;
      35             : }
      36             : 
      37             : Real
      38    22964624 : LinearFVDivergence::computeNeighborMatrixContribution()
      39             : {
      40    22964624 :   return 0;
      41             : }
      42             : 
      43             : Real
      44    22964624 : LinearFVDivergence::computeElemRightHandSideContribution()
      45             : {
      46    22964624 :   return computeFaceFlux();
      47             : }
      48             : 
      49             : Real
      50    22964624 : LinearFVDivergence::computeNeighborRightHandSideContribution()
      51             : {
      52    22964624 :   return -computeFaceFlux();
      53             : }
      54             : 
      55             : Real
      56     3183884 : LinearFVDivergence::computeBoundaryMatrixContribution(const LinearFVBoundaryCondition & /*bc*/)
      57             : {
      58     3183884 :   return 0.0;
      59             : }
      60             : 
      61             : Real
      62     3183884 : LinearFVDivergence::computeBoundaryRHSContribution(const LinearFVBoundaryCondition & /*bc*/)
      63             : {
      64     3183884 :   return computeFaceFlux();
      65             : }
      66             : 
      67             : Real
      68    49113132 : LinearFVDivergence::computeFaceFlux()
      69             : {
      70    49113132 :   const auto face_arg = makeCDFace(*_current_face_info);
      71    49113132 :   const auto state_arg = determineState();
      72             : 
      73    49113132 :   if (!_cached_rhs_contribution)
      74             :   {
      75    26148508 :     _cached_rhs_contribution = true;
      76    26148508 :     _flux_rhs_contribution = _face_flux(face_arg, state_arg) * _current_face_area;
      77             :   }
      78             : 
      79    49113132 :   return _flux_rhs_contribution;
      80             : }

Generated by: LCOV version 1.14