LCOV - code coverage report
Current view: top level - src/fvbcs - FVFunctorNeumannBC.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 419b9d Lines: 14 15 93.3 %
Date: 2025-08-08 20:01:16 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 "FVFunctorNeumannBC.h"
      11             : #include "Function.h"
      12             : 
      13             : registerMooseObject("MooseApp", FVFunctorNeumannBC);
      14             : 
      15             : InputParameters
      16       14448 : FVFunctorNeumannBC::validParams()
      17             : {
      18       14448 :   InputParameters params = FVFluxBC::validParams();
      19       14448 :   params.addClassDescription("Neumann boundary condition for the finite volume method.");
      20       43344 :   params.addParam<MooseFunctorName>("factor",
      21       28896 :                                     1.,
      22             :                                     "A factor in the form of a functor for multiplying the "
      23             :                                     "function. This could be useful for flipping "
      24             :                                     "the sign of the function for example based off the normal");
      25       14448 :   params.addRequiredParam<MooseFunctorName>("functor",
      26             :                                             "The value of the flux crossing the boundary.");
      27       14448 :   return params;
      28           0 : }
      29             : 
      30          95 : FVFunctorNeumannBC::FVFunctorNeumannBC(const InputParameters & parameters)
      31             :   : FVFluxBC(parameters),
      32          95 :     _functor(getFunctor<ADReal>("functor")),
      33         190 :     _factor(getFunctor<ADReal>("factor"))
      34             : {
      35          95 : }
      36             : 
      37             : ADReal
      38        5191 : FVFunctorNeumannBC::computeQpResidual()
      39             : {
      40       10382 :   return -_factor(singleSidedFaceArg(), determineState()) *
      41       15573 :          _functor(singleSidedFaceArg(), determineState());
      42             : }

Generated by: LCOV version 1.14