LCOV - code coverage report
Current view: top level - src/fvkernels - PINSFVScalarFieldAdvection.C (source / functions) Hit Total Coverage
Test: idaholab/moose navier_stokes: ba1ead Lines: 13 15 86.7 %
Date: 2025-08-13 06:50:25 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 "PINSFVScalarFieldAdvection.h"
      11             : #include "NS.h"
      12             : 
      13             : registerMooseObject("NavierStokesApp", PINSFVScalarFieldAdvection);
      14             : 
      15             : InputParameters
      16          41 : PINSFVScalarFieldAdvection::validParams()
      17             : {
      18          41 :   auto params = INSFVScalarFieldAdvection::validParams();
      19          41 :   params.addClassDescription(
      20             :       "Advects an arbitrary quantity, the associated nonlinear 'variable' in porous medium.");
      21          41 :   params.addRequiredParam<MooseFunctorName>(NS::porosity,
      22             :                                             "The name of the functor giving the local porosity");
      23             : 
      24          41 :   return params;
      25           0 : }
      26             : 
      27          22 : PINSFVScalarFieldAdvection::PINSFVScalarFieldAdvection(const InputParameters & params)
      28          22 :   : INSFVScalarFieldAdvection(params), _eps(getFunctor<ADReal>(NS::porosity))
      29             : 
      30             : {
      31          22 :   if (_add_slip_model)
      32           0 :     mooseError("Slip model and porous medium treatment is not currently supported");
      33          22 : }
      34             : 
      35             : ADReal
      36       24570 : PINSFVScalarFieldAdvection::computeQpResidual()
      37             : {
      38       24570 :   const auto state = determineState();
      39             :   // Note that we do not use the advected quantity interpolation because we expect to use this
      40             :   // with a functor material that does not support upwinding
      41       24570 :   const auto eps_face = _eps(makeCDFace(*_face_info, false), state);
      42             : 
      43       24570 :   return INSFVScalarFieldAdvection::computeQpResidual() / eps_face;
      44             : }

Generated by: LCOV version 1.14