LCOV - code coverage report
Current view: top level - src/auxkernels - HasPorosityJumpFace.C (source / functions) Hit Total Coverage
Test: idaholab/moose navier_stokes: 9fc4b0 Lines: 16 18 88.9 %
Date: 2025-08-14 10:14:56 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         246 : HasPorosityJumpFace::validParams()
      19             : {
      20         246 :   InputParameters params = AuxKernel::validParams();
      21         246 :   params.addClassDescription("Shows whether an element has any attached porosity jump faces");
      22         246 :   params.addRequiredParam<MooseFunctorName>(NS::porosity, "The porosity");
      23         246 :   return params;
      24           0 : }
      25             : 
      26         132 : HasPorosityJumpFace::HasPorosityJumpFace(const InputParameters & parameters)
      27         132 :   : AuxKernel(parameters), _eps(getFunctor<Real>(NS::porosity))
      28             : {
      29         132 :   if (isNodal())
      30           0 :     mooseError("This AuxKernel only supports Elemental fields");
      31         132 : }
      32             : 
      33             : Real
      34         648 : HasPorosityJumpFace::computeValue()
      35             : {
      36        1620 :   for (const auto s : _current_elem->side_index_range())
      37        1188 :     if (const Elem * const neighbor = _current_elem->neighbor_ptr(s))
      38             :     {
      39             :       const FaceInfo * const fi =
      40         972 :           Moose::FV::elemHasFaceInfo(*_current_elem, neighbor)
      41         972 :               ? _mesh.faceInfo(_current_elem, s)
      42         540 :               : _mesh.faceInfo(neighbor, neighbor->which_neighbor_am_i(_current_elem));
      43             :       mooseAssert(fi, "This should be non-null");
      44         972 :       if (std::get<0>(NS::isPorosityJumpFace(_eps, *fi, determineState())))
      45             :         return 1;
      46             :     }
      47             : 
      48             :   return 0;
      49             : }

Generated by: LCOV version 1.14