Giter Site home page Giter Site logo

v-h-giang / fluidsolver2d Goto Github PK

View Code? Open in Web Editor NEW

This project forked from slallement/fluidsolver2d

0.0 0.0 0.0 2.54 MB

2D fluid simulator in C++ using OpenCL and the SFML for display - based on the paper "Real-Time Fluid Dynamics for Games" by Jos Stam

C 19.14% C++ 51.35% Objective-C 0.47% CMake 23.82% POV-Ray SDL 5.23%

fluidsolver2d's Introduction

FluidSolver2D

2D fluid simulator in c++ using OpenCL based on the paper "Real-Time Fluid Dynamics for Games" by Jos Stam

Screenshot

Dependencies

This project requires the SFML 2.0 and OpenCL 1.2. The main configuration variables are located in config.h where you can change the screen resolution, the OpenCL device you want to use and the fluid properties.

Usage

  • ESC - exit the program
  • Left mouse button - add density under the cursor within a certain radius
  • Right mouse drag - add velocity to the velocity field in the direction of the mouse within a certain radius
  • Mouse wheel - change the radius
  • Space - reset the simulation

3D Solver

A 3D solver is available in the fluid_solver_3d/ folder. The user interface is still in 2D but, you can record the state of the fluid in 3D in .df3. These file can be read by POV-Ray to render an animation of the fluid, see the example in povray_scene/.

Usage

  • Everything works like the 2D solver
  • D Key - start or stop the record of the state of fluid

Example of output

Screenshot

fluidsolver2d's People

Contributors

slallement avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.