LCOV - code coverage report
Current view: top level - src/fvkernels - PCNSFVMomentumHLLC.C (source / functions) Hit Total Coverage
Test: idaholab/moose navier_stokes: ba1ead Lines: 18 27 66.7 %
Date: 2025-08-13 06:50:25 Functions: 5 8 62.5 %
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 "PCNSFVMomentumHLLC.h"
      11             : 
      12             : registerMooseObject("NavierStokesApp", PCNSFVMomentumHLLC);
      13             : 
      14             : InputParameters
      15         221 : PCNSFVMomentumHLLC::validParams()
      16             : {
      17         221 :   InputParameters params = PCNSFVHLLC::validParams();
      18         442 :   MooseEnum momentum_component("x=0 y=1 z=2");
      19         442 :   params.addRequiredParam<MooseEnum>(
      20             :       "momentum_component",
      21             :       momentum_component,
      22             :       "The component of the momentum equation that this kernel applies to.");
      23         221 :   params.addClassDescription(
      24             :       "Implements the momentum flux portion of the porous HLLC discretization.");
      25         221 :   return params;
      26         221 : }
      27             : 
      28         112 : PCNSFVMomentumHLLC::PCNSFVMomentumHLLC(const InputParameters & params)
      29         224 :   : PCNSFVHLLC(params), _index(getParam<MooseEnum>("momentum_component"))
      30             : {
      31         112 : }
      32             : 
      33             : ADReal
      34       80545 : PCNSFVMomentumHLLC::fluxElem()
      35             : {
      36       80545 :   return _normal_speed_elem * _eps_elem[_qp] * _rho_elem[_qp] * _vel_elem[_qp](_index) +
      37      161090 :          _normal(_index) * _eps_elem[_qp] * _pressure_elem[_qp];
      38             : }
      39             : 
      40             : ADReal
      41           0 : PCNSFVMomentumHLLC::fluxNeighbor()
      42             : {
      43           0 :   return _normal_speed_neighbor * _eps_neighbor[_qp] * _rho_neighbor[_qp] *
      44           0 :              _vel_neighbor[_qp](_index) +
      45           0 :          _normal(_index) * _eps_neighbor[_qp] * _pressure_neighbor[_qp];
      46             : }
      47             : 
      48             : ADReal
      49       80545 : PCNSFVMomentumHLLC::hllcElem()
      50             : {
      51       80545 :   auto vel_nonnormal = _vel_elem[_qp] - _normal_speed_elem * _normal;
      52       80545 :   return _normal(_index) * _SM + vel_nonnormal(_index);
      53             : 
      54             :   // For some reason, the below expression doesn't give as good results as the
      55             :   // above one.
      56             :   // return _normal(_index) * (_SM - _normal_speed_elem) + _vel_elem[_qp](_index);
      57             : }
      58             : 
      59             : ADReal
      60           0 : PCNSFVMomentumHLLC::hllcNeighbor()
      61             : {
      62           0 :   auto vel_nonnormal = _vel_neighbor[_qp] - _normal_speed_neighbor * _normal;
      63           0 :   return _normal(_index) * _SM + vel_nonnormal(_index);
      64             : 
      65             :   // For some reason, the below expression doesn't give as good results as the
      66             :   // above one.
      67             :   // return _normal(_index) * (_SM - _normal_speed_neighbor) + _vel_elem[_qp](_index);
      68             : }
      69             : 
      70             : ADReal
      71       80545 : PCNSFVMomentumHLLC::conservedVariableElem()
      72             : {
      73       80545 :   return _eps_elem[_qp] * _rho_elem[_qp] * _vel_elem[_qp](_index);
      74             : }
      75             : 
      76             : ADReal
      77           0 : PCNSFVMomentumHLLC::conservedVariableNeighbor()
      78             : {
      79           0 :   return _eps_neighbor[_qp] * _rho_neighbor[_qp] * _vel_neighbor[_qp](_index);
      80             : }

Generated by: LCOV version 1.14