LCOV - code coverage report
Current view: top level - src/kernels - NSSUPGBase.C (source / functions) Hit Total Coverage
Test: idaholab/moose navier_stokes: 9fc4b0 Lines: 26 27 96.3 %
Date: 2025-08-14 10:14:56 Functions: 2 2 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             : // Navier-Stokes includes
      11             : #include "NSSUPGBase.h"
      12             : #include "NS.h"
      13             : 
      14             : // MOOSE includes
      15             : #include "MooseMesh.h"
      16             : 
      17             : InputParameters
      18         164 : NSSUPGBase::validParams()
      19             : {
      20         164 :   InputParameters params = NSKernel::validParams();
      21         164 :   params.addClassDescription("This class acts as a base class for stabilization kernels.");
      22         164 :   params.addRequiredCoupledVar(NS::temperature, "temperature");
      23         164 :   params.addRequiredCoupledVar(NS::specific_total_enthalpy, "specific total enthalpy");
      24         164 :   return params;
      25           0 : }
      26             : 
      27          88 : NSSUPGBase::NSSUPGBase(const InputParameters & parameters)
      28             :   : NSKernel(parameters),
      29             : 
      30             :     // Material properties
      31          88 :     _viscous_stress_tensor(getMaterialProperty<RealTensorValue>("viscous_stress_tensor")),
      32         176 :     _dynamic_viscosity(getMaterialProperty<Real>("dynamic_viscosity")),
      33         176 :     _thermal_conductivity(getMaterialProperty<Real>("thermal_conductivity")),
      34             : 
      35             :     // SUPG-related material properties
      36         176 :     _hsupg(getMaterialProperty<Real>("hsupg")),
      37         176 :     _tauc(getMaterialProperty<Real>("tauc")),
      38         176 :     _taum(getMaterialProperty<Real>("taum")),
      39         176 :     _taue(getMaterialProperty<Real>("taue")),
      40         176 :     _strong_residuals(getMaterialProperty<std::vector<Real>>("strong_residuals")),
      41             : 
      42             :     // Momentum equation inviscid flux matrices
      43         176 :     _calA(getMaterialProperty<std::vector<RealTensorValue>>("calA")),
      44             : 
      45             :     // "velocity column" matrices
      46         176 :     _calC(getMaterialProperty<std::vector<RealTensorValue>>("calC")),
      47             : 
      48             :     // energy inviscid flux matrices
      49         176 :     _calE(getMaterialProperty<std::vector<std::vector<RealTensorValue>>>("calE")),
      50             : 
      51             :     // Old coupled variable values
      52             :     // _rho_old(coupledValueOld(NS::density)),
      53             :     // _rho_u_old(coupledValueOld(NS::momentum_x)),
      54             :     // _rho_v_old(_mesh.dimension() >= 2 ? coupledValueOld(NS::momentum_y) : _zero),
      55             :     // _rho_w_old(_mesh.dimension() == 3 ? coupledValueOld(NS::momentum_z) : _zero),
      56             :     // _rho_et_old(coupledValueOld(NS::total_energy_density)),
      57             : 
      58             :     // Time derivative derivatives (no, that's not a typo).  You can
      59             :     // just think of these as 1/dt for simplicity, they usually are...
      60          88 :     _d_rhodot_du(coupledDotDu(NS::density)),
      61          88 :     _d_rhoudot_du(coupledDotDu(NS::momentum_x)),
      62          88 :     _d_rhovdot_du(_mesh.dimension() >= 2 ? coupledDotDu(NS::momentum_y) : _zero),
      63          88 :     _d_rhowdot_du(_mesh.dimension() == 3 ? coupledDotDu(NS::momentum_z) : _zero),
      64          88 :     _d_rho_etdot_du(coupledDotDu(NS::total_energy_density)),
      65             : 
      66             :     // Coupled aux variables
      67          88 :     _temperature(coupledValue(NS::temperature)),
      68         176 :     _specific_total_enthalpy(coupledValue(NS::specific_total_enthalpy))
      69             : {
      70          88 : }

Generated by: LCOV version 1.14