Fluid simulation framework based on the MPS method
This is a fluid simulation framework based on the Moving Particle Semi-implicit method derived from results obtained in a M.Sc. thesis: "A fluid simulation system based on the MPS method". A set of papers (shown in the references section) was used as base to its development.
This framework also works as a tool, simulating pre-built scenarios that can be fine-tuned regarding its physical properties, compressibility approach, execution type (CPU/GPU) and others.
The creation of new simulation scenarios is not included and it is suggested as future work.
The system makes possible to simulate fluids in different ways and approaches. A few possibilities are:
-
Compressibility approach
-
Fully Incompressible
-
Weakly Compressible
-
-
Numerical improvements in both compressibility approaches
-
Type of execution
-
CPU - Sequential
-
CPU - OpenMP optimized
-
GPU - CUDA optimized
-
-
Turbulence model
-
Viscosity model
-
Multiphase interaction (max. of 2 fluids)
- Fine-tune density & viscosity of both fluids
-
Time-step duration
-
NVIDIA GPU
-
Compute capability equal or greater than 6.1 (https://en.wikipedia.org/wiki/CUDA)
-
CUDA 10.1
-
Visual Studio 2017
-
Update the NVIDIA GPU driver to the current version
-
Install CUDA 10.1 (https://developer.nvidia.com/cuda-10.1-download-archive-base)
-
Install Visual Studio 2017 (Community, Professional or Enterprise) (https://visualstudio.microsoft.com/vs/)
-
Install Git and clone this repository
-
Build from source both Visual Studio projects, first the the VoxarMPS solution and then the GUI solution
-
To solve a common problem during build: Copy all files from this path (depends on the path you installed CUDA in)
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\extras\visual_studio_integration\MSBuildExtensions
to this path:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\BuildCustomizations
-
-
Run GUI.exe to set the simulation parameters and start it
-
(1) Choose two or three dimensions simulations;
-
(2) Type of execution: sequentially, parallelized through OpenMP or parallelized through CUDA;
-
(3) Select from a set of previously built simulation scenarios;
-
(4) Choose from two possible fluid compressibility approaches;
-
By selecting Fully Incompressible, (5) and (6) will be enabled, which numerically improve calculations and stabilize fluid pressure;
-
(7) Check to employ the SPS-LES turbulence model;
-
(8) Can only be enabled if the chosen test scenario is a multiphase system. If checked, the second fluid in the simulation will present viscoplastic properties;
-
In (9), (10), (11) and (12) the density and viscosity values of the two fluids in the simulation can be set;
-
(13) Sets the time-step duration;
-
(14) Sets how long the simulation will last in real-world time;
-
(15) Generates the output VTU files with all kinds of particles present in the simulation;
-
(16) Generates the output VTU files with only fluid particles information;
-
(17) starts the generating the simulation;
-
(18) allows the user to switch between PT-BR and EN-US languages.
To watch the simulation outcome any visualization software that reads VTU files can be used, such as ParaView.
-
Number of particles in the simulation is limited by the size of available RAM
-
Only tested on Windows 10 using Visual Studio 2017 Enterprise and Community editions.
-
Only tested on the following NVIDIA GPUs: GTX 1080 (Mobile) and GTX 1080 Ti
main.cu
- CUDA file that contains the main loop and calls for every utilized function of the algorithm, including CUDA kernels for the GPU runs
functions.cu
- CUDA file containing the implementations of the main routines and CUDA kernels used inside the main loop
functions.cuh
- All declarations of the routines and CUDA kernels implemented in
functions.cu
inOut.cpp
- Implementations of functions that allow storing the output VTU files and also reading from these
inOut.h
- Declarations of the input and output routines from
inOut.cpp
This program is distributed under GNU General Public License version 3 (GPLv3) license. Please see LICENSE file.
- André Luiz Buarque Vieira-e-Silva (albvs@cin.ufpe.br)
- Voxar Labs (voxarlabs@cin.ufpe.br) - https://www.cin.ufpe.br/~voxarlabs/
If you use Voxar MPS in your work, please cite it:
@article{vieira-e-silva2021fluid,
title = "A fluid simulation system based on the MPS method",
journal = "Computer Physics Communications",
volume = "258",
pages = "107572",
year = "2021",
issn = "0010-4655",
doi = "https://doi.org/10.1016/j.cpc.2020.107572",
url = "http://www.sciencedirect.com/science/article/pii/S0010465520302745",
author = "André Luiz Buarque {Vieira-e-Silva} and Caio José {dos Santos Brito} and Francisco Paulo {Magalhães Simões} and Veronica Teichrieb",
keywords = "MPS, Framework, Numerical improvements, Fluid models, Parallelization"
}
Main references
-
Vieira-e-Silva, André Luiz Buarque, et al. "A fluid simulation system based on the MPS method." Computer Physics Communications (2020): 107572.
-
Shakibaeinia, Ahmad, and Yee-Chung Jin. "MPS mesh-free particle method for multiphase flows." Computer Methods in Applied Mechanics and Engineering 229 (2012): 13-26.
-
Gotoh, H. "Advanced particle methods for accurate and stable computation of fluid flows." Frontiers of Discontinuous Numerical Methods and Practical Simulations in Engineering and Disaster Prevention (2013): 113.
-
Koshizuka, Seiichi, and Yoshiaki Oka. "Moving-particle semi-implicit method for fragmentation of incompressible fluid." Nuclear science and engineering 123.3 (1996): 421-434.