Peano
Loading...
Searching...
No Matches
exaparty.api.sphtools.riemann Namespace Reference

This is a standalone Riemann solver, based on the exact Riemann solver that is part of Shadowfax (https://github.com/AstroUGent/shadowfax), CMacIonize (https://github.com/bwvdnbro/CMacIonize) and SWIFT. More...

Data Structures

class  RiemannSolver
 Exact Riemann solver. More...
 

Detailed Description

This is a standalone Riemann solver, based on the exact Riemann solver that is part of Shadowfax (https://github.com/AstroUGent/shadowfax), CMacIonize (https://github.com/bwvdnbro/CMacIonize) and SWIFT.

It is based on the description given in Toro, E., Riemann Solvers and Numerical Methods for Fluid Dynamics, 3rd edition (Springer, 2009).

This file should not be run directly (it just runs some unit tests if this is done). Instead, include it in another script as follows: import riemannsolver (make sure the folder containing the file is part of the system PATH).

Once included, you can create a RiemannSolver object for an ideal gas with a given polytropic index (e.g. 5/3): solver = riemannsolver.RiemannSolver(5./3.) This object has a member function solve which can be used to solve the Riemann problem with a given left and right state: rhosol, usol, psol, flag = solver.solver(rhoL, uL, pL, rhoR, uR, pR) rhosol, rhoL, and rhoR are the densities of respectively the solution, the left state, and the right state. usol, uL, and uR are the fluid velocities psol, pL, and pR are the pressures flag is an extra return variable that is set to -1, 1, or 0 if respectively the left state, the right state, or a vacuum state was sampled.

By default, the Riemann solution is sampled for a reference velocity dxdt = 0. Alternatively, you can sample the solution for another reference velocity dxdt = x / t by providing dxdt as an extra argument to solve().