42 static const std::string
name;
52 template<
int direction>
58 static_assert(direction < 3,
"We only support three dimensions.");
64 computeHLLSpeeds<direction>(eq, left, right, speedLeft, speedRight, cs);
65 eq.template computePointFlux<direction>(left, fluxLeft);
66 eq.template computePointFlux<direction>(right, fluxRight);
68 const real pressureLeft = left.p;
69 const real pressureRight = right.p;
71 const real udl = left.u[direction] - speedLeft;
72 const real udr = right.u[direction] - speedRight;
74 real aa = udr * right.
rho - udl * left.rho;
75 real sm = (right.m[direction] * udr - left.m[direction] * udl + pressureRight -
78 rvec us = ( fluxRight.
m - fluxLeft.
m - speedRight * right.m + speedLeft *
84 }
else if (speedLeft > 0) {
86 }
else if (speedRight < 0) {
90 middle.
rho = left.rho * udl / (sm - speedLeft);
91 middle.
m = middle.
rho * us;
92 const real p = pressureLeft + left.rho * (left.u[direction] - sm) * udl;
93 middle.
E = (udl * left.E + pressureLeft * left.u[direction] - p * sm) /
95 F = fluxLeft + speedLeft * (middle - left.conserved());
98 middle.
rho = right.rho * udr / (sm - speedRight);
99 middle.
m = middle.
rho * us;
100 real p = pressureRight + right.rho * (right.u[direction] - sm) * udr;
101 middle.
E = (udr * right.E + pressureRight * right.u[direction] - p * sm) /
103 F = fluxRight + speedRight * (middle - right.conserved());
106 return fmax(fabs(speedLeft), fabs(speedRight));
119 template<
int direction>
126 const real waveLeft = sqrt(left.
rho);
127 const real waveRight = sqrt(right.
rho);
130 const rvec u = (waveLeft * left.
u + waveRight * right.
u) /
131 (waveLeft + waveRight);
132 const real p = (waveLeft * left.
p + waveRight * right.
p) /
133 (waveLeft + waveRight);
141 const real correct = 0.5 * fmax(
real(0),
142 left.
u[direction] - right.
u[direction]);
145 speedLeft = fmin(left.
u[direction] + correct - cfLeft, u[direction] - cs);
146 speedRight = fmax(right.
u[direction] - correct + cfRight, u[direction] + cs);
Definition: types.hpp:104
__device__ __host__ real getGamma() const
Definition: Euler.hpp:299
Types< nsd >::rvec rvec
Definition: HLL3.hpp:44
#define __host__
Definition: types.hpp:46
Definition: ConservedVariables.hpp:30
double real
Definition: types.hpp:65
__device__ static __host__ void computeHLLSpeeds(const equation::euler::Euler< nsd > &eq, const equation::euler::AllVariables< nsd > &left, const equation::euler::AllVariables< nsd > &right, real &speedLeft, real &speedRight, real &cs)
Definition: HLL3.hpp:120
int rho
Definition: sodshocktube.py:3
rvec m
Definition: ConservedVariables.hpp:93
#define static_assert(x, y)
Definition: types.hpp:52
static const std::string name
name is "hll3"
Definition: HLL3.hpp:42
#define __device__
Definition: types.hpp:45
real rho
Definition: ConservedVariables.hpp:92
Definition: AllVariables.hpp:27
Various utility functions to implement the tecno flux.
Definition: types.hpp:30
float p
Definition: sodshocktube.py:5
__device__ static __host__ real computeFlux(const equation::euler::Euler< nsd > &eq, const equation::euler::AllVariables< nsd > &left, const equation::euler::AllVariables< nsd > &right, equation::euler::ConservedVariables< nsd > &F)
Definition: HLL3.hpp:53
real E
Definition: ConservedVariables.hpp:94