LCOV - code coverage report
Current view: top level - src/fvkernels - INSFVBodyForce.C (source / functions) Hit Total Coverage
Test: idaholab/moose navier_stokes: ba1ead Lines: 17 18 94.4 %
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 "INSFVBodyForce.h"
      11             : 
      12             : registerMooseObject("NavierStokesApp", INSFVBodyForce);
      13             : 
      14             : InputParameters
      15       12174 : INSFVBodyForce::validParams()
      16             : {
      17       12174 :   auto params = FVElementalKernel::validParams();
      18       12174 :   params += INSFVMomentumResidualObject::validParams();
      19       12174 :   params.addClassDescription("Body force that contributes to the Rhie-Chow interpolation");
      20       24348 :   params.addParam<Real>("scaling_factor", 1.0, "Coefficient to multiply by the body force term");
      21       24348 :   params.addParam<MooseFunctorName>("functor", "1", "A functor that describes the body force");
      22       36522 :   params.addParam<PostprocessorName>(
      23       24348 :       "postprocessor", 1, "A postprocessor whose value is multiplied by the body force");
      24       24348 :   params.declareControllable("scaling_factor");
      25       12174 :   return params;
      26           0 : }
      27             : 
      28        6094 : INSFVBodyForce::INSFVBodyForce(const InputParameters & parameters)
      29             :   : FVElementalKernel(parameters),
      30             :     INSFVMomentumResidualObject(*this),
      31        6094 :     _scale(getParam<Real>("scaling_factor")),
      32       12188 :     _functor(getFunctor<ADReal>("functor")),
      33       12188 :     _postprocessor(getPostprocessorValue("postprocessor"))
      34             : {
      35        6094 : }
      36             : 
      37             : ADReal
      38    16671074 : INSFVBodyForce::computeQpResidual()
      39             : {
      40    33342148 :   return -_scale * _postprocessor * _functor(makeElemArg(_current_elem), determineState());
      41             : }

Generated by: LCOV version 1.14