LCOV - code coverage report
Current view: top level - src/kernels - INSADMomentumGradDiv.C (source / functions) Hit Total Coverage
Test: idaholab/moose navier_stokes: 9fc4b0 Lines: 14 15 93.3 %
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 "INSADMomentumGradDiv.h"
      11             : #include "Assembly.h"
      12             : #include "NavierStokesMethods.h"
      13             : 
      14             : registerMooseObject("NavierStokesApp", INSADMomentumGradDiv);
      15             : 
      16             : InputParameters
      17          41 : INSADMomentumGradDiv::validParams()
      18             : {
      19          41 :   InputParameters params = ADVectorKernel::validParams();
      20          41 :   params.addClassDescription("Adds grad-div stabilization to the INS momentum equation");
      21          82 :   params.addRequiredParam<Real>("gamma", "The grad-div stabilization coefficient");
      22          41 :   return params;
      23           0 : }
      24             : 
      25          22 : INSADMomentumGradDiv::INSADMomentumGradDiv(const InputParameters & parameters)
      26             :   : ADVectorKernel(parameters),
      27          22 :     _gamma(getParam<Real>("gamma")),
      28          22 :     _coord_sys(_assembly.coordSystem()),
      29          44 :     _rz_radial_coord(_mesh.getAxisymmetricRadialCoord())
      30             : {
      31          22 : }
      32             : 
      33             : ADReal
      34     1772928 : INSADMomentumGradDiv::computeQpResidual()
      35             : {
      36             :   const auto test_div = NS::divergence(
      37     1772928 :       _grad_test[_i][_qp], _test[_i][_qp], _ad_q_point[_qp], _coord_sys, _rz_radial_coord);
      38             :   const auto u_div =
      39     1772928 :       NS::divergence(_grad_u[_qp], _u[_qp], _ad_q_point[_qp], _coord_sys, _rz_radial_coord);
      40     1772928 :   return _gamma * test_div * u_div;
      41             : }

Generated by: LCOV version 1.14