11 #include <coordinates/coordinates.hpp>
12 #include <hydro/hydro.hpp>
13 #include <mesh/mesh.hpp>
16 #include <configure.hpp>
18 void Hydro::RiemannSolver(
int const k,
int const j,
int const il,
int const iu,
22 int ivy = ivx == IVY ? IVZ : IVY;
24 Real wli[NHYDRO], wri[NHYDRO];
26 Real ubar, cbar, hbar;
33 pmy_block->pcoord->PrimToLocal2(k,
j, il, iu, empty, wl, wr, empty);
36 pmy_block->pcoord->PrimToLocal3(k,
j, il, iu, empty, wl, wr, empty);
42 for (
int i = il; i <= iu; ++i) {
43 for (
int n = 0; n < NHYDRO; ++n) {
48 cbar = sqrt(0.5 * (wli[IDN] + wri[IDN]));
49 hbar = 0.5 * (wli[IDN] + wri[IDN]) + 0.5 * cbar * (wli[ivx] - wri[ivx]);
50 ubar = 0.5 * (wli[ivx] + wri[ivx]) + 0.5 / cbar * (wli[IDN] - wri[IDN]);
53 flx(IDN, k,
j, i) = ubar * wli[IDN];
54 flx(ivx, k,
j, i) = ubar * wli[IDN] * wli[ivx] + 0.5 * hbar * hbar;
55 flx(ivy, k,
j, i) = ubar * wli[IDN] * wli[ivy];
57 flx(IDN, k,
j, i) = ubar * wri[IDN];
58 flx(ivx, k,
j, i) = ubar * wri[IDN] * wri[ivx] * 0.5 * hbar * hbar;
59 flx(ivy, k,
j, i) = ubar * wri[IDN] * wri[ivy];
61 flx(IVX, k,
j, i) = 0.;
69 pmy_block->pcoord->FluxToGlobal2(k,
j, il, iu, empty, empty, flx, empty,
73 pmy_block->pcoord->FluxToGlobal3(k,
j, il, iu, empty, empty, flx, empty,