LCOV - code coverage report
Current view: top level - src/fvkernels - WCNSFVEnergyTimeDerivative.C (source / functions) Hit Total Coverage
Test: idaholab/moose navier_stokes: ba1ead Lines: 15 16 93.8 %
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 "WCNSFVEnergyTimeDerivative.h"
      11             : 
      12             : #include "NS.h"
      13             : 
      14             : registerMooseObject("NavierStokesApp", WCNSFVEnergyTimeDerivative);
      15             : 
      16             : InputParameters
      17         537 : WCNSFVEnergyTimeDerivative::validParams()
      18             : {
      19         537 :   InputParameters params = INSFVEnergyTimeDerivative::validParams();
      20         537 :   params.addClassDescription(
      21             :       "Adds the time derivative term to the incompressible Navier-Stokes momentum equation.");
      22             : 
      23        1611 :   params.addRequiredParam<MooseFunctorName>(NS::time_deriv(NS::density),
      24             :                                             "The time derivative of the density material property");
      25         537 :   params.addParam<MooseFunctorName>(
      26             :       NS::specific_enthalpy, NS::specific_enthalpy, "The specific enthalpy");
      27         537 :   return params;
      28           0 : }
      29             : 
      30         302 : WCNSFVEnergyTimeDerivative::WCNSFVEnergyTimeDerivative(const InputParameters & params)
      31             :   : INSFVEnergyTimeDerivative(params),
      32         302 :     _rho_dot(getFunctor<ADReal>(NS::time_deriv(NS::density))),
      33         302 :     _h(getFunctor<ADReal>(NS::specific_enthalpy))
      34             : {
      35         302 : }
      36             : 
      37             : ADReal
      38      828776 : WCNSFVEnergyTimeDerivative::computeQpResidual()
      39             : {
      40      828776 :   const auto elem_arg = makeElemArg(_current_elem);
      41      828776 :   const auto state = determineState();
      42      828776 :   return INSFVEnergyTimeDerivative::computeQpResidual() +
      43      828776 :          _rho_dot(elem_arg, state) * _h(elem_arg, state);
      44             : }

Generated by: LCOV version 1.14