View Full Version : Fluid liquid simulation in C++
saggita 09-23-2009, 02:35 PM Fluid simulation
http://www.youtube.com/watch?v=3tNv_buE_gA
This fluid simulation is my personal project. I used finite difference method, semi-Lagrangian advection and conjugate-gradient solver to solve Navier-Stokes equation. Level set was used to trace water free surface. It was rendered using Maya's mental ray. The grid size is 50x50x70.
|
|
Simon
09-23-2009, 07:32 PM
Looks good. Have you got any plans to take it further? optimisation?
saggita
09-24-2009, 06:01 PM
Looks good. Have you got any plans to take it further? optimisation?
Thanks for your comment. I do have a plan to take it further. I will add gpgpu based conjugate-gradient or multigrid solver. Also geometric shader based iso surface. They will enable fluid simulator as real-time or near real-time application.
Also trying hybrid approaches such as PIC\FLIP is also underway. Two-way coupling between fluid and solid/cloth is in my plan list.
Currently, my fluid simulator has two parts: maya plugin and standalone simulator. Once the computation speed goes to near real-time, two parts can be combined as plugin. It would be a commercial quality at that time.
djwarder
09-28-2009, 11:10 AM
Very cool indeed, nice job! I'd be very interested in knowing how you rendered it, did you mesh the surface first? Also, what's your view on levelsets - extremely hard to implement in C++?
saggita
09-29-2009, 09:30 PM
The mesh is generated from level set at each frame. The mesh data is read by Maya plugin which I made. Once the sequence of mesh data is imported into Maya, user can assign materials like blinn and render it using Mental ray or Maya renderer.
Level set was the hardest one to implement liquid simulation. But the actually source code for level set is very short. I used fast sweeping method for reinitialization and velocity extrapolation. If you google fast sweeping, you can see papers.
Thanks.
djwarder
10-05-2009, 11:37 AM
Interesting! Yeah I can imagine the levelset part being the hardest, will have a look round for some source code to see whether I can get my head round it!! Does get some nice results tho ...
CGTalk Moderation
10-05-2009, 11:37 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.