LCOV - code coverage report
Current view: top level - src/auxkernels - HasPorosityJumpFace.C (source / functions) Hit Total Coverage
Test: idaholab/moose navier_stokes: #32971 (54bef8) with base c6cf66 Lines: 16 18 88.9 %
Date: 2026-05-29 20:37:52 Functions: 3 3 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 "HasPorosityJumpFace.h"
      11             : #include "MooseMesh.h"
      12             : #include "NS.h"
      13             : #include "NSFVUtils.h"
      14             : 
      15             : registerMooseObject("NavierStokesApp", HasPorosityJumpFace);
      16             : 
      17             : InputParameters
      18         114 : HasPorosityJumpFace::validParams()
      19             : {
      20         114 :   InputParameters params = AuxKernel::validParams();
      21         114 :   params.addClassDescription("Shows whether an element has any attached porosity jump faces");
      22         114 :   params.addRequiredParam<MooseFunctorName>(NS::porosity, "The porosity");
      23         114 :   return params;
      24           0 : }
      25             : 
      26          60 : HasPorosityJumpFace::HasPorosityJumpFace(const InputParameters & parameters)
      27          60 :   : AuxKernel(parameters), _eps(getFunctor<Real>(NS::porosity))
      28             : {
      29          60 :   if (isNodal())
      30           0 :     mooseError("This AuxKernel only supports Elemental fields");
      31          60 : }
      32             : 
      33             : Real
      34         432 : HasPorosityJumpFace::computeValue()
      35             : {
      36        1080 :   for (const auto s : _current_elem->side_index_range())
      37         792 :     if (const Elem * const neighbor = _current_elem->neighbor_ptr(s))
      38             :     {
      39             :       const FaceInfo * const fi =
      40         648 :           Moose::FV::elemHasFaceInfo(*_current_elem, neighbor)
      41         648 :               ? _mesh.faceInfo(_current_elem, s)
      42         360 :               : _mesh.faceInfo(neighbor, neighbor->which_neighbor_am_i(_current_elem));
      43             :       mooseAssert(fi, "This should be non-null");
      44         648 :       if (std::get<0>(NS::isPorosityJumpFace(_eps, *fi, determineState())))
      45             :         return 1;
      46             :     }
      47             : 
      48             :   return 0;
      49             : }

Generated by: LCOV version 1.14