Sign in to follow this  

Does someone plan to simulate Fluid on 3D

This topic is 3725 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I want to simulate 3d Fluid, and found some papers about it. But still cannot implement it in 3d. Does someone have some suggestions. 3d codes of the simulations would be best for me... Thanks for you attention.

Share this post


Link to post
Share on other sites
I have Stam's source from "Real-Time Fluid Dynamics for Games" converted to 3D. If you want it, send me a private message with your email address.

I understand that Crane's chapter in GPU Gems 3 is 3D, but I haven't got my copy yet.

Share this post


Link to post
Share on other sites
Hey this is what I'm doing right now. Like someone suggested read the Stam's paper on his stable solver.

Then visit Mark Harris' page:

http://www.markmark.net/

Read his paper on simulation of clouds. From there follow the references to other papers.

I'm at the point of implementation. At this point I pretty much understand the mathematics behind the stable solver. If you need any help we can work together here.

What I'm doing right now is doing a basic 2D implementation in c++, as a testbed. From there I will probably proceed to a GPU implementation.


Share this post


Link to post
Share on other sites
Quote:
Original post by xissburg
Smoothed Particle Hydrodynamics


Yes, this is a nice technique for modeling fluids with support for splashing, etc. It can be computationally expensive to keep track of the proximities of a large # of particles, e.g., uniform grid is easy to manage but might not cull away enough particles...but hierarchical grid (octree, kd-tree) too expensive to maintain with particles moving around... Also, can be expensive to extract isosurfaces for rendering (though you could use particles to render).

Share this post


Link to post
Share on other sites
Warning: Possible misinformation, proceed with caution.

Awhile ago I implemented a very simple ray-tracer. I implemented an algorithm called Buckysort/search (I wanted to test it against other algorithms).

http://www.mcnett.org/

His algorithm can be implemented on the GPU. So one may want to look into this algorithm and application to SPH.

My ray-tracing implementation (without any SIMD optimizations) was very slow. But from my tests this algorithm is very fast for searching of nearby regions, i.e collision detection of nearby objects. My ray-tracing adaptation was probably not implemented correctly.



Share this post


Link to post
Share on other sites
If all the particles are the same size (or at least nearly?) in the particle-based approach, then I think a grid would be vastly superior to other methods..

..because a grid is very cheap to update dynamically at O(n) whereas the tree-based methods usualy scale at O(n log n) for dynamic updating (often a full rebuild is best)

..The tree based methods do full O(n log n) collision detection, which is pretty good, but because the particles are (nearly?) the same size a very good grid size can be defined and that too should at least approach O(n) in practice.

..standard grid implementations blow off a lot of memory tho..

Share this post


Link to post
Share on other sites
Youying, the link you provide is coded in SDL and OpenGL. It should be trivial to compile it under windows if you know SDL and OpenGL, probably without any code changes. Even if you didn't, the code should be easy enough to read through to understand how 3D fluid simulation works.

Share this post


Link to post
Share on other sites
Quote:
Original post by Numsgil
Youying, the link you provide is coded in SDL and OpenGL. It should be trivial to compile it under windows if you know SDL and OpenGL, probably without any code changes. Even if you didn't, the code should be easy enough to read through to understand how 3D fluid simulation works.



---------------------------------------------
Thanks , I will have a try

Share this post


Link to post
Share on other sites
Hi,

Choosing a fluid simulation scheme greatly depends on your type of fluid :
- Do you need to track the free surface of the flow (as for a liquid and as opposite to a gaz)
- Is it a multi-phase simulation and can there be great differences in viscosities or densities between the fluids
- How do you plan to render the scene (is it for real-time, offline rendering etc.)

But basically I would say that today's reasearch in the area focuses on grid simulations with level sets (which is a signed distance field). You could also use the simple MAC grid for its simplicity.

Revelant articles in this scope would be in my opinion :
- Nick Foster and Dimitri Metaxas, Realistic Animation of Liquids (extended), Graphical Models and Image Processing, 58(5), (1996), pp. 471-483.
- Jos Stam, "Stable Fluids", In SIGGRAPH 99 Conference Proceedings, Annual Conference Series, August 1999, 121-128.
- Douglas Enright, Stephen R. Marschner, Ronald Fedkiw: Animation and rendering of complex water surfaces. SIGGRAPH 2002: 736-744.

Mark Harris' article on GPU Gems2 is a good way to start, even though only gaz is simulated.

Hope this helps,
Jeff.

Share this post


Link to post
Share on other sites
Quote:
Original post by funkeejeffounet
But basically I would say that today's reasearch in the area focuses on grid simulations with level sets (which is a signed distance field). You could also use the simple MAC grid for its simplicity.


However, the only real-time and useable liquid libraries that I've seen - PhysX and Meqon (RIP) - use particle approaches, so I wouldn't really agree with the statement/suggestion above (though I admit I haven't checked up on things in the last few years). When I last looked, most (almost all!) of the grid-based research was concerned with non-realtime solutions.

Also, some non real-time libraries use particle methods too - e.g. RealFlow I think.

And... SPH in 2D is pretty trivial (though the rendering is tricky). Porting it to 3D is easy too (but the rendering gets even more tricky if you want it realtime). The basic method is a lot easier to get working than grid-based methods.

Share this post


Link to post
Share on other sites
Quote:
Original post by erwincoumans
Here are some links to 3D fluid implementations:

Takashi AMADA's SPH + source code

Kenny Erleben's OpenTissue, has some fluids + source code

Harada's GPU fluids, rigidbody and cloth, movies/executables/no source code

Hope this helps,
Erwin
http://bulletphysics.com, Bullet physics library



I hate to piggyback this thread, but are there any more source code examples of SPH? Even a simple one will do. I looked at Takashi Amada's one, but it seems berift of comments, and deals with things in a much more complex way than I'm interested in (I'm really just looking for a simple code-based introduction to SPH).

Share this post


Link to post
Share on other sites
Quote:
Original post by Winegums
I hate to piggyback this thread, but are there any more source code examples of SPH? Even a simple one will do. I looked at Takashi Amada's one, but it seems berift of comments, and deals with things in a much more complex way than I'm interested in (I'm really just looking for a simple code-based introduction to SPH).


My jiglib. Look for water 2D or something...

Share this post


Link to post
Share on other sites
I glanced through the intro materials for that book online, and I think its probably a decent book. The material feels well presented, but perhaps a bit rushed, and I don't expect it to be a great introduction to fluids simulation in general. But, if you are already familiar with fluids simulation or are willing to go elsewhere for more in depth backround material.

Share this post


Link to post
Share on other sites
Quote:
Original post by MrRowl
Quote:
Original post by Winegums
I hate to piggyback this thread, but are there any more source code examples of SPH? Even a simple one will do. I looked at Takashi Amada's one, but it seems berift of comments, and deals with things in a much more complex way than I'm interested in (I'm really just looking for a simple code-based introduction to SPH).


My jiglib. Look for water 2D or something...


hi sorry but i can't see the 2d water there? have i missed it or?

Share this post


Link to post
Share on other sites
Quote:
Original post by Winegums
hi sorry but i can't see the 2d water there? have i missed it or?


4th paragraph on that page says "You can download my test executable that uses the library here (19 May 2007). Extract everything before running it. It includes the source code."

The source code not only includes jiglib, but also jigtest (my test environment for jiglib) but also a directory called water.

Share this post


Link to post
Share on other sites
well i've read the code and it looks promising (you have a very nice, clear style of programming. the fact you use those comment things serves to help this).

my only issue is that it won't compile! trying to compile jiglib generates this error:

1>BSCMAKE: error BK1506 : cannot open file '.\debug\line.sbr': No such file or directory

Share this post


Link to post
Share on other sites
Quote:
Original post by Winegums
my only issue is that it won't compile! trying to compile jiglib generates this error:

1>BSCMAKE: error BK1506 : cannot open file '.\debug\line.sbr': No such file or directory


Hmmm can't help with that. I don't _think_ I had any problems using MS VS Express - but I can't remember for sure if I did compile it with that.

Share this post


Link to post
Share on other sites

This topic is 3725 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this