LCOV - code coverage report
Current view: top level - src/fvkernels - INSFVEnergyTimeDerivative.C (source / functions) Hit Total Coverage
Test: idaholab/moose navier_stokes: #32971 (54bef8) with base c6cf66 Lines: 16 18 88.9 %
Date: 2026-05-29 20:37:52 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 "INSFVEnergyTimeDerivative.h"
      11             : #include "INSFVEnergyVariable.h"
      12             : 
      13             : #include "NS.h"
      14             : 
      15             : registerMooseObject("NavierStokesApp", INSFVEnergyTimeDerivative);
      16             : 
      17             : InputParameters
      18         636 : INSFVEnergyTimeDerivative::validParams()
      19             : {
      20         636 :   InputParameters params = FVFunctorTimeKernel::validParams();
      21         636 :   params.addClassDescription(
      22             :       "Adds the time derivative term to the incompressible Navier-Stokes energy equation.");
      23         636 :   params.addRequiredParam<MooseFunctorName>(NS::density, "Density");
      24        1908 :   params.addParam<MooseFunctorName>(NS::time_deriv(NS::specific_enthalpy),
      25        1272 :                                     NS::time_deriv(NS::specific_enthalpy),
      26             :                                     "The time derivative of the specific enthalpy");
      27         636 :   return params;
      28           0 : }
      29             : 
      30         343 : INSFVEnergyTimeDerivative::INSFVEnergyTimeDerivative(const InputParameters & params)
      31             :   : FVFunctorTimeKernel(params),
      32         686 :     _rho(getFunctor<ADReal>(NS::density)),
      33         686 :     _h_dot(getFunctor<ADReal>(NS::time_deriv(NS::specific_enthalpy)))
      34             : {
      35         343 :   if (!dynamic_cast<INSFVEnergyVariable *>(&_var))
      36           0 :     paramError("variable", "The supplied variable should be of INSFVEnergyVariable type.");
      37         343 : }
      38             : 
      39             : ADReal
      40     2173142 : INSFVEnergyTimeDerivative::computeQpResidual()
      41             : {
      42     2173142 :   const auto elem_arg = makeElemArg(_current_elem);
      43     2173142 :   const auto state = determineState();
      44     2173142 :   return _rho(elem_arg, state) * _h_dot(elem_arg, state);
      45             : }

Generated by: LCOV version 1.14