Skip to content

PIC/Flip Fluid Simulator written in C++ and rendered with OpenGL

Notifications You must be signed in to change notification settings

roberlozcar/PIC-FLIP

Repository files navigation

PIC/Flip Fluid Simulator

Introduction

This program simulate the velocity and pressure field of an incomplesible fluid in 2D using the PIC/Flip or the PIC algorithm. The boundaries conditions are homogeneous, i.e., v=0 in the boundaries.

The simulation is rendered in OpenGL and visualize the value of a parameter of the fluid, ink color is the standard.

You have to press 's' to start the simulation and you can toggle the visualization of the velocity field and/or the particles position pressing 'g'.

Options

  • You can change the simulation algorithm turning false the parameter flipEnabled in Fluid2.h. If it is false you are using PIC and it is true you are using PIC/Flip.
  • You can modify the parameter of the fluid like viscosity and density and the value of gravity or time step in Scene.cpp. If you increase the time step or the viscosity, the algorithm could become unstable.
  • You can change the number of cell in each axis in Scene.cpp. If you inclease these number, the computation time will increase too and if you decrease these number, the algorithm could become unstable.

Requeriments

This project needs Freeglut library. This library and its source are included in external but you can check the freeglut project for more information and credits.

Questions

Write to the mail: r.lozanoc93@gmail.com.

About

PIC/Flip Fluid Simulator written in C++ and rendered with OpenGL

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published