This is a collection of MATLAB files for SPH simulations.
For documentation, please refer to the comments in the code and to the preprint:
- SPHM: a MATLAB package for Smoothed Particle Hydrodynamics simulations, M. Sutti, Tech. report, September 2022.
The code is mainly based on the corresponding FORTRAN code contained in:
- Liu, G. R. and Liu, M. B. Smoothed particle hydrodynamics: a meshfree particle method. World Scientific, Singapore, 2003.
If there are any issues or bugs, feel free to email me at msutti (at) ncts.tw
- Last changes: Feb 22, 2024.
- Ver 2, Sep 12, 2022.
- Ver 1, Jul 11, 2021: initial release.
The code is organized in the following folders:
eos: contains the equations of state for ideal gas and artificial water.examples: contains parameters and data for the 1D shock tube and the 2D shear cavity problems.plots: contains the plots generated from the simulation data.postprocessing: contains utilities for plotting and visualizing data.results: contains the matfiles generated byDriver_SPHM.utilities: contains all the core functions for the SPH simulations.videos: contains videos of the simulations.
No installation is required.
- Use
Driver_SPHMto perform an SPH simulation. The results of the simulations will be saved into matfiles in the results folder. - The script
Driver_Animationcan be used to generate a video of the simulation. The scriptDriver_shocktube_profilesgenerates the profile plots for the shock tube example. - The script
Driver_shear_cavity_steady_stategenerates the plots for the shear-driven cavity problem at the steady state. - The script
Driver_Sod_shocktubecan be used to visualize the profiles of the exact solution to the classical Sod shock tube problem.
The code written by me is GPL-licensed.