Modeling Fluid Flow using Smoothed Particle Hydrodynamics

vel_benny.jpg (52261 bytes) thesis.tex, thesis.ps

Benny the beaver takes a little swim in our simulation.


We have implemented a fluid flow simulation using the smoothed particle hydrodynamics (SPH) method.  Our implementation runs in parallel on distributed memory machines using the MPI message passing libraries. 

The user can specify various simulation parameters and place cylinders and rectangles into a two-dimensional flow.  The flow accelerates under a constant force specified by the user.  We use periodic boundary conditions (particles flowing off the right side wrap around to the left) and no slip conditions (friction is exhibited along the surface of boundary shapes).

Our simulator consists of a server side and a client side.  The server is written in C++ and performs all the number crunching.  The client side is written in Java and can be used to initialize the server and visualizes the resulting data.   Communication between the client and server is carried out by a socket connection using classes we developed during the project.  This allows the client to be run virtually anywhere that has a Java Virtual Machine and an internet connection.   Alternatively, the server can be run without the client, writing data files to disk.  These data files can be read in by the client application at a later time.  

The data can be viewed as a positional plot of the free and bound particles.  It can also be viewed as a color contour plot of pressure, density, or speed.  The contour plot is created by coloring each pixel according to the relevant attribute of its nearest free particle neighbor.

We have made all of our source code available here.  It is our hope that others will use and extend our work.  For more details about the physics and implementation, see the papers listed below.

Papers:

Schlatter, Brian.  A Pedagogical Tool Using Smooth Particle Hydrodynamics to Model Fluid Flow Past a System of Cylinders.  Dual MS Project, Oregon State University, June 11th, 1999.

Vertanen, Keith.  A Parallel Implementation of a Fluid Flow Simulation using Smoothed Particle Hydrodynamics.  MS Project, Oregon State University, June 24th, 1999.  Abstract.

Example animations:

single_pos.mpg Flow around a single cylinder, positional plot
single_pres.mpg Flow around a single cylinder, pressure plot
single_speed.mpg Flow around a single cylinder, speed plot
single_params Parameters used for the single cylinder run
many_pos.mpg Flow around a bunch of cylinders, positional plot
many_dens.mpg Flow around a bunch of cylinders, density plot
many_speed.mpg Flow around a bunch of cylinders, speed plot
many_params Parameters used for the bunch of cylinders run
benny_pos.mpg Flow around a beaver, positional plot
benny_speed.mpg Flow around a beaver, speed plot


Software:

server Contains source code and Makefile for our MPI parallel SPH simulation
server_util Contains code for several debugging utilities that can be used with *.debug files produced by the server.  Utilities can be used to compare differences in particle attributes between runs and also trace the desired properties of a particle through time.
client Source code for a Java application that performs control and visualization of the server.  This one contains just the Java source, needs JDK 1.2 (uses Swing).
client_all_tar.tar.gz
Source code and project files for the client.  This one contains the Java source and the Visual Cafe project files.
Java / C++ socket communication Classes developed to handle the socket communication between the Java client and the C++ server.
brian.tar Complete tar file ("that's all folks")