-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Hyper2D, a minimalistic finite-volume solver for hyperbolic equations and hypersonic flows.

Hyper2D is a minimalistic finite-volume solver for hyperbolic equations and hypersonic flows.
By minimalistic, we mean that Hyper2D is simple. As simple as we could make it. And you will like it. Mostly (but not only) Cartesian grids. No object-oriented programming, no latest programming language functionalities, just good old Fortran 2003. Simple structure, simple grids, simple code, quick learning! Single core OR GPU parallelization with CUDA Fortran.
- Are you a newcomer to the finite-volume method and want to learn it?
- Do you want to run some good-looking fluid dynamic simulations?
- Or, are you a researcher implementing your own set of hyperbolic PDEs?
Then Hyper2D may be the code for you.
Hyper2D comes for free: if you use Hyper2D in your research, citing it is the best way of supporting us. We don't have a specific journal publication for it, but you could refer to this one, where we use Hyper2D to solve the Euler equations and some other hyperbolic PDEs:
S. Boccelli, J. G. McDonald, T. E. Magin, 14-moment maximum-entropy modelling of collisionless ions for Hall thruster discharges, http://arxiv.org/abs/2202.04159
Hyper2D is released under the BSD-3-clause license.
In order to keep the software as simple as possible, we provide different implementations of the solver, that you can find in different directories:
-
The hyper1D directory contains 1D solvers, written in Octave/MATLAB and in Fortran. These are mostly aimed at familiarizing with the code and employ simple first order numerical schemes (directories "PDE1D_Octave" and "src_hyper1D_simple"). A more advanced program showing higher order formulations in time and space is given in the sub-directory "src_hyper1D".
-
The hyper2D_single_core directory contains a number of possibilities:
- "hyper2D_basic" contains the simplest implementation and mostly extends hyper1D to two dimensions; Higher order (in space and time) methods are also given into sub-directories.
- "hyper2D_flatplate" shows how to introduce solid boundaries into the domain.
- "hyper2D_hypersonic" is aimed at solving the compressible Euler equations of gas dynamics including non-perfect gas thermodynamics (including a two-temperature roto-translational/vibrational model).
- "hyper2D_kinetic" solves the 1D1V Boltzmann/Vlasov kinetic equation in phase space. One axis represents physical space, and the other axis represents the particle velocity.
- The hyper2D_CUDA directory gives a CUDA Fortran implementation. This usually gives some pretty large speed-up (depending on your hardware of course). In the directory, you will find a basic implementation as well as a mode sophisticated one, including 3rd-order time integration with a low-storage TVD Runge-Kutta method and higher order space integration with either MUSCL or WENO methods (up to 5th-order).
The output will be in VTK file format for hyper2D and hyper2D_CUDA, and will be a simple dat file for the 1D implementations.
Hyper2D was tested on GNU/Linux. The software requirements depend on the specific Hyper2D implementation to be used:
- hyper1D directory:
- PDE1D_Octave -> runs under Octave and/or MATLAB (with little or no modifications)
- src_hyper1D and src_hyper1D_simple -> Fortran versions, require gfortran and make.
-
hyper2D_single_core directory: Fortran versions, require gfortran and make.
-
hyper2D_CUDA directory: requires a GPU. Software requirements: make and some CUDA implementation (tested working with the NVidia HPC SDK v22, that include the nvfortran compiler; other CUDA compilers may work, but may require to modify the parameters in the Makefile).
You can download this repository with:
$ git clone github.com/sbocce/hyper2D
First, you need to identify the Hyper2D implementation that you are interested in. In the respective directory, you will find a Makefile. Type:
$ make
This will create the executable "hyper2D.exe". Hyper2D will print its output in a local "dumps" directory. Make sure that it exists:
$ mkdir -p dumps
You are now ready to run the program:
$ ./hyper2D.exe
After applying modifications to the program, such as changing the simulated conditions, you need to compile again. Suggestion: the following command allows to clean the "dumps" directory, removing the output of previous simulations; then compile the sources and run hyper2D:
$ make cleanoutput && make && ./hyper2D.exe
For more information, check the README files.
Hyper2D is open-source. Contributions and bug reports are welcome. Issues/bug reports can be opened at https://github.com/sbocce/hyper2D/issues. A few suggestions for future developments include:
- Implementing viscous fluid equations and other PDEs;
- Coupling hyper2D with thermochemical libraries;
- Coupling hyper2D with numerical integration libraries;
- Creating hyper3D?