Appearance
First run
Build FLUME, run the Sod shock tube, look at what it writes and check it against the exact solution. The toolchain and HDF5 are set up on the install page.
Build
bash
git clone https://github.com/szaghi/adam && cd adam
fobis fetch # the dependencies, into src/third_party/
fobis build --mode flume-cpu-gnu # exe/adam_flume_cpu (gfortran + Open MPI)Run
Run in a directory of your own: a run writes its outputs next to its input.
bash
mkdir -p run/sod && cp src/tests/flume/regression/sod-x/input.ini run/sod/
cd run/sod && mpirun -np 2 ../../exe/adam_flume_cpu input.ini > log.txtThe input is the Sod shock tube along
text
[mpi-00000]save HDF5 files t: 174, time: 0.20000000000000001E+000
[mpi-00000]ADAM run complete: all realms finalized, entering MPI_FinalizeWhat it writes
text
sod-x-000000000.xdmf sod-x-000000000-proc000000.h5 sod-x-000000000-proc000001.h5
sod-x-000000174.xdmf sod-x-000000174-proc000000.h5 sod-x-000000174-proc000001.h5
sod-x-residuals.dat sod-x-conservation_history.dat- Field files, at step 0 and at the last step (
[IO] it_save = 100000saves nothing in between): one HDF5 file per rank and one XDMF index per save, the conservative variablesr,ru,rv,rw,rEof every block, ghost cells included. sod-x-residuals.dat: the L2 norm of every residual, one row per step.sod-x-conservation_history.dat: the domain integrals of the conservative variables, one row per step. With extrapolation at both ends mass is conserved up to the flux through the ends, which the waves have not reached:
text
0 0.0000000000000000E+000 5.6250000000000000E-001 0.0000000000000000E+000 ... 1.3750000000000002E+000
174 2.0000000000000001E-001 5.6249999999999989E-001 1.7999999999999999E-001 ... 1.3750000000000002E+000Look at it
Open sod-x-000000174.xdmf in ParaView, apply Cell Data to Point Data if you want a line plot, and plot r over a line along HDF5_USE_FILE_LOCKING=FALSE first, or ParaView shows empty data (IO cookbook).
Check it
FLUME's Sod verification compares the density with the exact Riemann solution:
bash
python3 -m venv ../../exe/.regression-venv && ../../exe/.regression-venv/bin/pip install h5py numpy # once
../../exe/.regression-venv/bin/python ../../src/tests/flume/verification/sod/sod_oracle.py input.ini . --l1-max 3.31e-3text
/sod-x: axis x, it 174, cells 200, L1(rho) = 3.244140e-03 PASSWhat you learned
- A run is one executable and one INI file; it writes next to the input.
- Field files are per rank, indexed by one XDMF per save; histories are plain text.
- Every FLUME verification case has an oracle you can run on your own output.
Next: the FLUME tutorial, or the other tutorials.