Giter VIP home page Giter VIP logo

kbladin / fluid_simulation Goto Github PK

View Code? Open in Web Editor NEW
131.0 8.0 13.0 32.88 MB

Self advection, external force and pressure solve to a velocity field represented by a MaC grid.

Home Page: http://kbladin.se/dmt_projects/fluid_simulation.php

License: MIT License

CMake 7.72% C++ 90.24% C 1.06% GLSL 0.98%
fluid-simulation fluid-dynamics fluid-solver fluid-simulation-engine fluid-grid advection grid volume-preservation navier-stokes equation

fluid_simulation's Introduction

Fluid_Simulation

Implemented

  • Staggered MAC Grid
  • Different advection schemes
    • Semi Lagrangian advection with
      • Bilinear interpolation
      • Runge Kutta and Euler solver
    • PIC advection with bilinear interpolation
    • FLIP advection with bilinear interpolation
    • PIC / FLIP combination
  • Pressure solve using the conjugate gradient method with the linear algebra library "Eigen"
  • Enforce Dirichlet boundary condition
  • Marker particles for air/fluid separation
  • Velocity extension using brute force search through grid

Examples:

Youtube video of real time simulation:

Real time fluid simulation

Not Yet Implemented

  • Adaptive time steps
  • Vorticity confinement
  • Make sure marker particles are outside of obstacles
  • Other interpolation alternatives (quadratic, cubic, Catmull Rom)
  • Other air/fluid separation techniques (for example level set)
  • 3D simulation

fluid_simulation's People

Contributors

kbladin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fluid_simulation's Issues

Wondering if the A Matrix is missing a (times) dt factor

Hey!
I'm implementing something similar following Bridson's textbook as well! Sometimes I look at this codebase as a reference ;)
Wondering however whether or not this is a mistake on my end or not. It seems the A Matrix as constructed in your pressureSolve() function has coefficients that are not multiplied by the timestep length, as the textbook suggests they should be.

Maybe you just assume a timestep of 1 and that works out for you?
Thanks

any instructions about how to build and run this project?

find some errors when use cmake to build
And after fix them, there is an Assertion after ./fluidsim_simple

frame 0
Assertion failed: (index >= 0 && index < size()), function operator[], file /usr/local/Cellar/eigen/3.3.7/include/eigen3/Eigen/src/Core/DenseCoeffsBase.h, line 162.
Abort trap: 6

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.