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 "CNSFVHLLCMomentumStagnationInletBC.h" 11 : 12 : // Full specialization of the validParams function for this object 13 : registerADMooseObject("NavierStokesApp", CNSFVHLLCMomentumStagnationInletBC); 14 : 15 : InputParameters 16 82 : CNSFVHLLCMomentumStagnationInletBC::validParams() 17 : { 18 82 : InputParameters params = CNSFVHLLCStagnationInletBC::validParams(); 19 164 : MooseEnum momentum_component("x=0 y=1 z=2", "x"); 20 164 : params.addParam<MooseEnum>("momentum_component", 21 : momentum_component, 22 : "The component of the momentum equation that this kernel applies to."); 23 82 : params.addClassDescription( 24 : "Adds the boundary momentum flux for HLLC when provided stagnation temperature and pressure"); 25 82 : return params; 26 82 : } 27 : 28 44 : CNSFVHLLCMomentumStagnationInletBC::CNSFVHLLCMomentumStagnationInletBC( 29 44 : const InputParameters & parameters) 30 88 : : CNSFVHLLCStagnationInletBC(parameters), _index(getParam<MooseEnum>("momentum_component")) 31 : { 32 44 : } 33 : 34 : ADReal 35 0 : CNSFVHLLCMomentumStagnationInletBC::fluxElem() 36 : { 37 0 : return _normal_speed_elem * _rho_elem[_qp] * _vel_elem[_qp](_index) + 38 0 : _normal(_index) * _pressure_elem[_qp]; 39 : } 40 : 41 : ADReal 42 1416 : CNSFVHLLCMomentumStagnationInletBC::fluxBoundary() 43 : { 44 1416 : return _normal_speed_boundary * _rho_boundary * _vel_boundary(_index) + 45 1416 : _normal(_index) * _p_boundary; 46 : } 47 : 48 : ADReal 49 0 : CNSFVHLLCMomentumStagnationInletBC::hllcElem() 50 : { 51 0 : const auto vel_nonnormal = _vel_elem[_qp] - _normal_speed_elem * _normal; 52 0 : return _normal(_index) * _SM + vel_nonnormal(_index); 53 : } 54 : 55 : ADReal 56 1416 : CNSFVHLLCMomentumStagnationInletBC::hllcBoundary() 57 : { 58 1416 : const auto vel_nonnormal = _vel_boundary - _normal_speed_boundary * _normal; 59 1416 : return _normal(_index) * _SM + vel_nonnormal(_index); 60 : } 61 : 62 : ADReal 63 0 : CNSFVHLLCMomentumStagnationInletBC::conservedVariableElem() 64 : { 65 0 : return _rho_elem[_qp] * _vel_elem[_qp](_index); 66 : } 67 : 68 : ADReal 69 1416 : CNSFVHLLCMomentumStagnationInletBC::conservedVariableBoundary() 70 : { 71 1416 : return _rho_boundary * _vel_boundary(_index); 72 : }