This project demonstrates how to solve the Euler equations using the Samurai library with adaptive mesh refinement (AMR).
You need a package manager like conda or mamba to install the dependencies.
-
Create the Conda environment:
Use the provided
environment.ymlfile to create the environment.mamba env create -f conda/environment.yml
Or with conda:
conda env create -f conda/environment.yml
-
Activate the environment:
mamba activate samurai-euler-env
-
Create a build directory:
mkdir build cd build -
Configure the project with CMake:
cmake .. -DCMAKE_BUILD_TYPE=Release
-
Build the executables:
make
To run the 2D Euler simulation:
./euler_2dThis will generate output files (e.g., HDF5/XDMF) in the results directory (or current directory depending on configuration), which can be visualized using ParaView.
euler_1d: 1D Euler simulation.euler_user_pred_1d: 1D Euler simulation with user-defined prediction.
The euler_2d executable accepts several command-line arguments to control the simulation, multiresolution parameters, and output.
| Option | Description | Default |
|---|---|---|
--cfl |
The CFL number | 0.9 |
--Ti |
Initial time | 0.0 |
--Tf |
Final time | 0.25 |
--scheme |
Finite volume scheme (rusanov, hll, hllc) |
hllc |
--test-case |
Test case to run | double_mach_reflection |
--restart-file |
Path to a file to restart the simulation from | (empty) |
| Option | Description | Default |
|---|---|---|
--min-level |
Minimum level of the multiresolution | 8 |
--max-level |
Maximum level of the multiresolution | 8 |
| Option | Description | Default |
|---|---|---|
--path |
Output directory path | Current directory |
--nfiles |
Number of output files to generate | 1 |
Run the simulation with a specific final time and output 10 files:
./euler_2d --Tf 0.5 --nfiles 10Run with adaptive mesh refinement (levels 5 to 10):
./euler_2d --min-level 5 --max-level 10