LCOV - code coverage report
Current view: top level - src/fvkernels - PNSFVPGradEpsilon.C (source / functions) Hit Total Coverage
Test: idaholab/moose navier_stokes: ba1ead Lines: 15 15 100.0 %
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 "PNSFVPGradEpsilon.h"
      11             : #include "NS.h"
      12             : #include "Function.h"
      13             : 
      14             : registerMooseObject("NavierStokesApp", PNSFVPGradEpsilon);
      15             : 
      16             : InputParameters
      17         938 : PNSFVPGradEpsilon::validParams()
      18             : {
      19         938 :   InputParameters params = FVElementalKernel::validParams();
      20         938 :   params.addClassDescription("Introduces a -p * grad_eps term.");
      21        1876 :   MooseEnum momentum_component("x=0 y=1 z=2");
      22        1876 :   params.addRequiredParam<MooseEnum>(
      23             :       "momentum_component",
      24             :       momentum_component,
      25             :       "The component of the momentum equation that this kernel applies to.");
      26        1876 :   params.addRequiredParam<FunctionName>("epsilon_function", "A function describing the porosity");
      27         938 :   return params;
      28         938 : }
      29             : 
      30         481 : PNSFVPGradEpsilon::PNSFVPGradEpsilon(const InputParameters & params)
      31             :   : FVElementalKernel(params),
      32         962 :     _pressure(getADMaterialProperty<Real>(NS::pressure)),
      33         481 :     _eps_function(getFunction("epsilon_function")),
      34        1443 :     _index(getParam<MooseEnum>("momentum_component"))
      35             : {
      36         481 : }
      37             : 
      38             : ADReal
      39     2962190 : PNSFVPGradEpsilon::computeQpResidual()
      40             : {
      41     2962190 :   return -_pressure[_qp] * _eps_function.gradient(_t, _q_point[_qp])(_index);
      42             : }

Generated by: LCOV version 1.14