LCOV - code coverage report
Current view: top level - src/kernels - AcousticInertia.C (source / functions) Hit Total Coverage
Test: idaholab/moose fsi: #31405 (292dce) with base fef103 Lines: 23 24 95.8 %
Date: 2025-09-04 07:53:22 Functions: 4 4 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 "AcousticInertia.h"
      11             : #include "SubProblem.h"
      12             : #include "TimeIntegrator.h"
      13             : #include "NonlinearSystemBase.h"
      14             : 
      15             : registerMooseObject("FsiApp", AcousticInertia);
      16             : 
      17             : InputParameters
      18         164 : AcousticInertia::validParams()
      19             : {
      20         164 :   InputParameters params = TimeKernel::validParams();
      21         164 :   params.addClassDescription("Calculates the residual for the inertial force "
      22             :                              "which is the double time derivative of pressure.");
      23         328 :   params.addParam<MaterialPropertyName>(
      24             :       "inv_co_sq", "inv_co_sq", "Inverse of sqaure of the fluid's speed of sound.");
      25         164 :   return params;
      26           0 : }
      27             : 
      28          88 : AcousticInertia::AcousticInertia(const InputParameters & parameters)
      29             :   : TimeKernel(parameters),
      30          88 :     _inv_co_sq(getMaterialProperty<Real>("inv_co_sq")),
      31          88 :     _u_dot_old(_var.uDotOld()),
      32          88 :     _du_dot_du(_var.duDotDu()),
      33          88 :     _du_dotdot_du(_var.duDotDotDu()),
      34          88 :     _u_dot_factor(_var.vectorTagValue(_sys.getTimeIntegrator(_var.number()).uDotFactorTag())),
      35         176 :     _u_dotdot_factor(_var.vectorTagValue(_sys.getTimeIntegrator(_var.number()).uDotDotFactorTag()))
      36             : {
      37          88 :   addFEVariableCoupleableVectorTag(_sys.getTimeIntegrator(_var.number()).uDotFactorTag());
      38          88 :   addFEVariableCoupleableVectorTag(_sys.getTimeIntegrator(_var.number()).uDotDotFactorTag());
      39          88 : }
      40             : 
      41             : Real
      42    21917500 : AcousticInertia::computeQpResidual()
      43             : {
      44    21917500 :   if (_dt == 0)
      45             :     return 0;
      46             :   else
      47    21917500 :     return _test[_i][_qp] * _inv_co_sq[_qp] *
      48    21917500 :            (_u_dotdot_factor[_qp] + _u_dot_factor[_qp] - _u_dot_old[_qp]);
      49             : }
      50             : 
      51             : Real
      52    71842000 : AcousticInertia::computeQpJacobian()
      53             : {
      54    71842000 :   if (_dt == 0)
      55             :     return 0;
      56             :   else
      57    71842000 :     return _test[_i][_qp] * _inv_co_sq[_qp] * _du_dotdot_du[_qp] * _phi[_j][_qp] +
      58    71842000 :            _test[_i][_qp] * _inv_co_sq[_qp] * _du_dot_du[_qp] * _phi[_j][_qp];
      59             : }

Generated by: LCOV version 1.14