LCOV - code coverage report
Current view: top level - include/linearfvkernels - LinearFVFluxKernel.h (source / functions) Hit Total Coverage
Test: idaholab/moose framework: #31706 (f8ed4a) with base bb0a08 Lines: 1 1 100.0 %
Date: 2025-11-03 17:23:24 Functions: 1 1 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             : #pragma once
      11             : 
      12             : #include "LinearFVKernel.h"
      13             : #include "FaceArgInterface.h"
      14             : 
      15             : /**
      16             :  * Finite volume kernel that contributes approximations of discretized face flux terms to the matrix
      17             :  * and right hand side of a linear system.
      18             :  */
      19             : class LinearFVFluxKernel : public LinearFVKernel, public FaceArgProducerInterface
      20             : {
      21             : public:
      22             :   static InputParameters validParams();
      23             : 
      24             :   /**
      25             :    * Class constructor.
      26             :    * @param parameters The InputParameters for the object
      27             :    */
      28             :   LinearFVFluxKernel(const InputParameters & params);
      29             : 
      30             :   virtual void addMatrixContribution() override;
      31             : 
      32             :   virtual void addRightHandSideContribution() override;
      33             : 
      34             :   virtual bool hasFaceSide(const FaceInfo & fi, bool fi_elem_side) const override;
      35             : 
      36             :   /**
      37             :    * Set the current FaceInfo object
      38             :    * @param face_info The face info which will be used as current face info
      39             :    */
      40             :   virtual void setupFaceData(const FaceInfo * face_info);
      41             : 
      42             :   /**
      43             :    * Set the coordinate system specific face area for the assembly
      44             :    * @param area the face area
      45             :    */
      46     2951769 :   void setCurrentFaceArea(const Real area) { _current_face_area = area; };
      47             : 
      48             :   /// Computes the system matrix contribution from an element side on an internal face
      49             :   virtual Real computeElemMatrixContribution() = 0;
      50             : 
      51             :   /// Computes the system matrix contribution from the neighbor side on an internal face
      52             :   virtual Real computeNeighborMatrixContribution() = 0;
      53             : 
      54             :   /// Computes the right hand side contribution from the element side on an internal face
      55             :   virtual Real computeElemRightHandSideContribution() = 0;
      56             : 
      57             :   /// Computes the right hand side contribution from the neighbor side on an internal face
      58             :   virtual Real computeNeighborRightHandSideContribution() = 0;
      59             : 
      60             :   /**
      61             :    * Computes the matrix contribution from a boundary face
      62             :    * @param bc The boundary condition on the given face
      63             :    */
      64             :   virtual Real computeBoundaryMatrixContribution(const LinearFVBoundaryCondition & bc) = 0;
      65             : 
      66             :   /**
      67             :    * Computes the right hand side contribution from a boundary face
      68             :    * @param bc The boundary condition on the given face
      69             :    */
      70             :   virtual Real computeBoundaryRHSContribution(const LinearFVBoundaryCondition & bc) = 0;
      71             : 
      72             :   /**
      73             :    * Computes the flux from this kernel on a boundary
      74             :    */
      75             :   virtual Real computeBoundaryFlux(const LinearFVBoundaryCondition & bc);
      76             : 
      77             : protected:
      78             :   /**
      79             :    * Determine the single sided face argument when evaluating a functor on a face.
      80             :    * @param fi the FaceInfo for this face
      81             :    * @param limiter_type the limiter type, to be specified if more than the default average
      82             :    *        interpolation is required for the parameters of the functor
      83             :    * @param correct_skewness whether to perform skew correction at the face
      84             :    */
      85             :   Moose::FaceArg singleSidedFaceArg(
      86             :       const FaceInfo * fi,
      87             :       Moose::FV::LimiterType limiter_type = Moose::FV::LimiterType::CentralDifference,
      88             :       bool correct_skewness = false) const;
      89             : 
      90             :   /// Pointer to the face info we are operating on right now
      91             :   const FaceInfo * _current_face_info;
      92             : 
      93             :   /// The current, coordinate system specific face area
      94             :   Real _current_face_area;
      95             : 
      96             :   /// Face ownership information for the current face
      97             :   FaceInfo::VarFaceNeighbors _current_face_type;
      98             : 
      99             :   /// If we already built the matrix contribution. This switch can be used to
     100             :   /// check if cached quantities are already available in the kernel.
     101             :   bool _cached_matrix_contribution;
     102             : 
     103             :   /// If we already built the right hand side contribution. This switch can be used to
     104             :   /// check if cached quantities are already available in the kernel.
     105             :   bool _cached_rhs_contribution;
     106             : 
     107             :   /// Whether to force execution of this kernel on all external boundaries
     108             :   const bool _force_boundary_execution;
     109             : 
     110             :   /// A vector of dof indices that describe where to add the
     111             :   /// matrix and right hand side batch contribution
     112             :   DenseVector<dof_id_type> _dof_indices;
     113             : 
     114             :   /// Cache for a batch of matrix contributions for faster assembly
     115             :   DenseMatrix<Real> _matrix_contribution;
     116             : 
     117             :   /// Cache for a batch of vector contributions for faster assembly
     118             :   DenseVector<Real> _rhs_contribution;
     119             : };

Generated by: LCOV version 1.14