LCOV - code coverage report
Current view: top level - src/fvbcs - CNSFVHLLCMomentumImplicitBC.C (source / functions) Hit Total Coverage
Test: idaholab/moose navier_stokes: #32971 (54bef8) with base c6cf66 Lines: 18 18 100.0 %
Date: 2026-05-29 20:37:52 Functions: 5 5 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 "CNSFVHLLCMomentumImplicitBC.h"
      11             : 
      12             : // Full specialization of the validParams function for this object
      13             : registerADMooseObject("NavierStokesApp", CNSFVHLLCMomentumImplicitBC);
      14             : 
      15             : InputParameters
      16         106 : CNSFVHLLCMomentumImplicitBC::validParams()
      17             : {
      18         106 :   InputParameters params = CNSFVHLLCImplicitBC::validParams();
      19         212 :   MooseEnum momentum_component("x=0 y=1 z=2", "x");
      20         212 :   params.addParam<MooseEnum>("momentum_component",
      21             :                              momentum_component,
      22             :                              "The component of the momentum equation that this kernel applies to.");
      23         106 :   params.addClassDescription("Implements an implicit advective boundary flux for the momentum "
      24             :                              "equation for an HLLC discretization");
      25         106 :   return params;
      26         106 : }
      27             : 
      28          56 : CNSFVHLLCMomentumImplicitBC::CNSFVHLLCMomentumImplicitBC(const InputParameters & parameters)
      29         112 :   : CNSFVHLLCImplicitBC(parameters), _index(getParam<MooseEnum>("momentum_component"))
      30             : {
      31          56 : }
      32             : 
      33             : ADReal
      34        5148 : CNSFVHLLCMomentumImplicitBC::fluxElem()
      35             : {
      36        5148 :   return _normal_speed_elem * _rho_elem[_qp] * _vel_elem[_qp](_index) +
      37       10296 :          _normal(_index) * _pressure_elem[_qp];
      38             : }
      39             : 
      40             : ADReal
      41        5148 : CNSFVHLLCMomentumImplicitBC::hllcElem()
      42             : {
      43        5148 :   auto vel_nonnormal = _vel_elem[_qp] - _normal_speed_elem * _normal;
      44        5148 :   return _normal(_index) * _SM + vel_nonnormal(_index);
      45             : 
      46             :   // For some reason, the below expression doesn't give as good results as the
      47             :   // above one.
      48             :   // return _normal(_index) * (_SM - _normal_speed_elem) + _vel_elem[_qp](_index);
      49             : }
      50             : 
      51             : ADReal
      52        5148 : CNSFVHLLCMomentumImplicitBC::conservedVariableElem()
      53             : {
      54        5148 :   return _rho_elem[_qp] * _vel_elem[_qp](_index);
      55             : }

Generated by: LCOV version 1.14