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 "CNSFVHLLCBC.h" 11 : #include "CNSFVHLLC.h" 12 : #include "NS.h" 13 : #include "SinglePhaseFluidProperties.h" 14 : 15 : InputParameters 16 2378 : CNSFVHLLCBC::validParams() 17 : { 18 2378 : return CNSFVHLLCBCBase::validParams(); 19 : } 20 : 21 1264 : CNSFVHLLCBC::CNSFVHLLCBC(const InputParameters & parameters) : CNSFVHLLCBCBase(parameters) {} 22 : 23 : ADReal 24 83686 : CNSFVHLLCBC::computeQpResidual() 25 : { 26 83686 : _normal_speed_elem = _normal * _vel_elem[_qp]; 27 83686 : preComputeWaveSpeed(); 28 : 29 83686 : auto wave_speeds = CNSFVHLLCBase::waveSpeed(hllcData(), _normal); 30 : 31 83686 : _SL = std::move(wave_speeds[0]); 32 83686 : _SM = std::move(wave_speeds[1]); 33 83686 : _SR = std::move(wave_speeds[2]); 34 : 35 83686 : if (_SL >= 0) 36 0 : return fluxElem(); 37 83686 : else if (_SR <= 0) 38 0 : return fluxBoundary(); 39 : else 40 : { 41 83686 : if (_SM >= 0) 42 : { 43 41843 : ADReal f = _rho_elem[_qp] * (_SL - _normal_speed_elem) / (_SL - _SM); 44 125529 : return fluxElem() + _SL * (f * hllcElem() - conservedVariableElem()); 45 : } 46 : else 47 : { 48 83686 : ADReal f = _rho_boundary * (_SR - _normal_speed_boundary) / (_SR - _SM); 49 125529 : return fluxBoundary() + _SR * (f * hllcBoundary() - conservedVariableBoundary()); 50 : } 51 : } 52 : mooseError("Should never get here"); 53 : return 0; 54 : }