https://mooseframework.inl.gov
CNSFVHLLCBC.C
Go to the documentation of this file.
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"
14 
17 {
19 }
20 
21 CNSFVHLLCBC::CNSFVHLLCBC(const InputParameters & parameters) : CNSFVHLLCBCBase(parameters) {}
22 
23 ADReal
25 {
28 
29  auto wave_speeds = CNSFVHLLCBase::waveSpeed(hllcData(), _normal);
30 
31  _SL = std::move(wave_speeds[0]);
32  _SM = std::move(wave_speeds[1]);
33  _SR = std::move(wave_speeds[2]);
34 
35  if (_SL >= 0)
36  return fluxElem();
37  else if (_SR <= 0)
38  return fluxBoundary();
39  else
40  {
41  if (_SM >= 0)
42  {
44  return fluxElem() + _SL * (f * hllcElem() - conservedVariableElem());
45  }
46  else
47  {
50  }
51  }
52  mooseError("Should never get here");
53  return 0;
54 }
static std::array< ADReal, 3 > waveSpeed(const HLLCData &hllc_data, const ADRealVectorValue &normal)
helper function for computing wave speed
Definition: CNSFVHLLCBase.C:59
HLLCData hllcData() const
virtual void preComputeWaveSpeed()=0
this function is a call back for setting quantities for computing wave speed before calling the wave ...
ADReal _SL
the wave speeds
virtual ADReal conservedVariableElem()=0
conserved variable of this equation from elem and boundary
static InputParameters validParams()
Definition: CNSFVHLLCBC.C:16
virtual ADReal hllcBoundary()=0
DualNumber< Real, DNDerivativeType, true > ADReal
virtual ADReal computeQpResidual() override
Definition: CNSFVHLLCBC.C:24
const ADMaterialProperty< RealVectorValue > & _vel_elem
virtual ADReal hllcElem()=0
HLLC modifications to flux for elem & boundary, see Toro.
const ADMaterialProperty< Real > & _rho_elem
const unsigned int _qp
static InputParameters validParams()
CNSFVHLLCBC(const InputParameters &parameters)
Definition: CNSFVHLLCBC.C:21
Real f(Real x)
Test function for Brents method.
ADRealVectorValue _normal
ADReal _normal_speed_boundary
these quantities must be computed in preComputeWaveSpeed
virtual ADReal fluxElem()=0
flux functions on elem & from boundary
Base clase for HLLC boundary condition for Euler equation.
virtual ADReal conservedVariableBoundary()=0
void mooseError(Args &&... args) const
virtual ADReal fluxBoundary()=0
ADReal _normal_speed_elem
speeds normal to the interface on the element side