CMSC 491/691: Computer Animation

Assignment 5
Fluids I: Interpolation and Advection
Due Nov 21, 2017 at 11:59 PM

Before you start

You will be doing your work this semester in a class git repository. Before you get started on any of the assignments, you should fetch yourself a copy of your personal repository following these directions. Your personal class respoitory on the UMBC GL/Linux systems is /afs/umbc.edu/users/a/d/adamb/pub/491/your-user-name.git

The Assignment

For this assignment, you must write a C or C++ program that will perform spring mass simulations. I have put sample input files in your git repositories.

Input file format

The main input file will be in the wonderfully awesome super extensible .json format. You might want to use this format in future projects. Every since I discovered it I use it in every serious project I do. This file will specify the main simulation parameters and one particle file. Particle fils

The first line will be the number of particles. Each subsequent line will have six floating point values giving the initial position (x, y, z) and velocity (u, v, w) of the particle.

You can run my program here:

~adamb/public/Fluids/advect input.json output-%05d.part

More details

The particles will move based on their initial velocity and interactions with other particles through the background grid. You will need three basic functions, one that transfers velocity from the particles to the grid, one that transfers velocity updates from the grid to the particles, and one to advect the particles through the grid's velocity field. Each timestep you should advect the particles, transfer velocities from the particles to the grid, and then transfer updates fromt he grid to the particle (in the next assignment you will add operations between the transfer from particles to the grid and back to the particles. For the basic assignment use simple Euler integration to advect the particles. You should use a staggered grid for storing the velocity field (i.e. the x-component of the velocity on x-faces, the y-component on y-faces, and the z-component on z-faces). It will be easiest to write three interpolation operators, one for each type of face, and another function that calls all three. You should use trilinear weight functions for transfers between the grid and the particles (and vice versa). Assume that boundary cells have zero velocity and ensure particles never enter these cells.

Resources

Foster and Metaxas's 1996 liquids paper (PIC)
Mark Carlson's 2004 thesis. See Chapter 3
Robert Bridson's course notes

Extra Credit

For 30 extra points implement RK2 integration (either midpoint or trapazoidal rule).

For 50 extra points implement velocity extrapolation.

What to turn in

Turn in this assignment electronically by pushing your source code to your class git repository by 11:59 PM on the day of the deadline. Do your development in the proj1 directory so we can find it. Be sure the Makefile will build your project when we run 'make' (or edit it so it will). Also include a README.txt file telling us about your assignment. Do not forget to tell us what (if any) help did you receive from books, web sites or people other than the instructor and TA.

Check in along the way with useful checkin messages. We will be looking at your development process, so a complete and perfectly working ray tracer submitted in a single checkin one minute before the deadline will NOT get full credit. Do be sure to check in all of your source code, Makefile, README, and updated .gitignore file, but no build files, log files, generated images, zip files, libraries, or other non-code content.

To make sure you have the submission process working, you must do at least one commit and push by the friday before the deadline.