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