340{
341
342
343
344
345
346
348
350 riemannSolver.SetParam("gamma",
351 [&gamma]() ->
NekDouble & {
return gamma; });
352
353 size_t spaceDim = 3;
354 size_t npts = 11;
355
356
359 for (size_t i = 0; i < spaceDim; ++i)
360 {
361 vecLocs[0][i] = 1 + i;
362 }
363 riemannSolver.SetAuxVec(
364 "vecLocs",
365 [&vecLocs]() -> const Array<OneD, const Array<OneD, NekDouble>> & {
366 return vecLocs;
367 });
368
369
370 Array<OneD, Array<OneD, NekDouble>> normals(spaceDim);
371 for (size_t i = 0; i < spaceDim; ++i)
372 {
373 normals[i] = Array<OneD, NekDouble>(npts);
374 }
375 riemannSolver.SetVector(
376 "N", [&normals]() -> const Array<OneD, const Array<OneD, NekDouble>> & {
377 return normals;
378 });
379
380 size_t nFields = spaceDim + 2;
381 Array<OneD, Array<OneD, NekDouble>> fwd(nFields), bwd(nFields),
382 flx(nFields), flxRef(nFields);
383 for (size_t i = 0; i < nFields; ++i)
384 {
385 fwd[i] = Array<OneD, NekDouble>(npts);
386 bwd[i] = Array<OneD, NekDouble>(npts);
387 flx[i] = Array<OneD, NekDouble>(npts);
388 flxRef[i] = Array<OneD, NekDouble>(npts);
389 }
390
391
392
393
394 for (size_t i = 0; i < npts; ++i)
395 {
396
399 fwd[0][i] = rhoL;
400 bwd[0][i] = rhoR;
401
403 fwd[1][i] = rhou;
404 bwd[1][i] = rhou;
405
407 fwd[2][i] = rhov;
408 bwd[2][i] = rhov;
409
411 fwd[3][i] = rhow;
412 bwd[3][i] = rhow;
413
417 rhoe + 0.5 * (rhou * rhou + rhov * rhov + rhow * rhow) / rhoL;
419 rhoe + 0.5 * (rhou * rhou + rhov * rhov + rhow * rhow) / rhoR;
420 fwd[nFields - 1][i] = EL;
421 bwd[nFields - 1][i] = ER;
422
423 normals[0][i] = 1.0;
424
425 flxRef[0][i] = 0.87858599768171342;
426 flxRef[1][i] = 2.0449028304431223;
427 flxRef[2][i] = 1.8282946712594808;
428 flxRef[3][i] = 2.7424420068892208;
429 flxRef[nFields - 1][i] = 9.8154698039903128;
430 }
431
432 riemannSolver.Solve(spaceDim, fwd, bwd, flx);
433
434
435 for (size_t i = 0; i < npts; ++i)
436 {
437 BOOST_CHECK_CLOSE(flxRef[0][i], flx[0][i], 1e-10);
438 BOOST_CHECK_CLOSE(flxRef[1][i], flx[1][i], 1e-10);
439 BOOST_CHECK_CLOSE(flxRef[2][i], flx[2][i], 1e-10);
440 BOOST_CHECK_CLOSE(flxRef[3][i], flx[3][i], 1e-10);
441 BOOST_CHECK_CLOSE(flxRef[4][i], flx[4][i], 1e-10);
442 }
443}