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 "CNSFVMomentumHLLC.h" 11 : 12 : // Full specialization of the validParams function for this object 13 : registerADMooseObject("NavierStokesApp", CNSFVMomentumHLLC); 14 : 15 : InputParameters 16 299 : CNSFVMomentumHLLC::validParams() 17 : { 18 299 : InputParameters params = CNSFVHLLC::validParams(); 19 598 : MooseEnum momentum_component("x=0 y=1 z=2"); 20 598 : params.addRequiredParam<MooseEnum>( 21 : "momentum_component", 22 : momentum_component, 23 : "The component of the momentum equation that this kernel applies to."); 24 299 : params.addClassDescription( 25 : "Implements the momentum flux portion of the free-flow HLLC discretization."); 26 299 : return params; 27 299 : } 28 : 29 157 : CNSFVMomentumHLLC::CNSFVMomentumHLLC(const InputParameters & params) 30 314 : : CNSFVHLLC(params), _index(getParam<MooseEnum>("momentum_component")) 31 : { 32 157 : } 33 : 34 : ADReal 35 650382 : CNSFVMomentumHLLC::fluxElem() 36 : { 37 650382 : return _normal_speed_elem * _rho_elem[_qp] * _vel_elem[_qp](_index) + 38 1300764 : _normal(_index) * _pressure_elem[_qp]; 39 : } 40 : 41 : ADReal 42 165014 : CNSFVMomentumHLLC::fluxNeighbor() 43 : { 44 165014 : return _normal_speed_neighbor * _rho_neighbor[_qp] * _vel_neighbor[_qp](_index) + 45 330028 : _normal(_index) * _pressure_neighbor[_qp]; 46 : } 47 : 48 : ADReal 49 650382 : CNSFVMomentumHLLC::hllcElem() 50 : { 51 650382 : auto vel_nonnormal = _vel_elem[_qp] - _normal_speed_elem * _normal; 52 650382 : 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 165014 : CNSFVMomentumHLLC::hllcNeighbor() 61 : { 62 165014 : auto vel_nonnormal = _vel_neighbor[_qp] - _normal_speed_neighbor * _normal; 63 165014 : 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 650382 : CNSFVMomentumHLLC::conservedVariableElem() 72 : { 73 650382 : return _rho_elem[_qp] * _vel_elem[_qp](_index); 74 : } 75 : 76 : ADReal 77 165014 : CNSFVMomentumHLLC::conservedVariableNeighbor() 78 : { 79 165014 : return _rho_neighbor[_qp] * _vel_neighbor[_qp](_index); 80 : }