Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Sat May 26, 2012 2:02 am 
Offline

Joined: Sat May 26, 2012 1:09 am
Posts: 17
I've made a bit of progress on integrating FLUIDS v.2 into Bullet.

Currently, only basic one way interaction is implemented. Fluid particles are run through
a discrete collision check, and are accelerated out of btCollisionObjects if collisions are
detected. Since the detection is discrete, it is highly likely that fluid particles will tunnel
through shapes without volume, such as the btHeightfieldTerrainShape or triangle mesh.


Progress/demo at:
https://github.com/rtrius/Bullet-FLUIDS
(Requires bullet-2.80-rev2531 and Visual C++ 2005/2008/2010)

Changes as of
2012 May 20:
(see git commit log for more recent changes)

-Remove: demo code
-Remove: CUDA support
-Remove: OpenGL function calls, GLUT dependence(in FluidSystem)
-Remove: class GeomX (manager of several arbitrarily sized arrays)
-Remove: class PointSet (particle system)
-Remove: unused files(esp. files in fluids/common)
-Remove: unused variables

-Various bugfixes
Grid cell allocation(use m_Resolution)
Stack overflow(on allocation of FluidSystem)

-Convert coding style towards Bullet
-Separate emitter from FluidSystem
-Reimplement Vector3DF as a subset of btVector3
(not yet replaced due to various issues)

-Add: (unoptimized) marching cubes rendering
-Add: OpenCL port(direct C++ port; not optimized for GPU)
-Add: FluidAbsorber(destroys fluid particles)
-Add: rudimentary Fluid-btCollisionObject interaction(no dynamics)
(collisions are somewhat unstable)


Issues in tracker:
Add SPH fluid interaction with rigid body / cloth simulation
http://code.google.com/p/bullet/issues/detail?id=296

Add SPH fluid iso-surface generation
http://code.google.com/p/bullet/issues/detail?id=297


Top
 Profile  
 
PostPosted: Sat May 26, 2012 6:15 am 
Offline
User avatar

Joined: Tue Mar 02, 2010 6:13 am
Posts: 66
nice work !

Tested and works with NVidia OpenCL & Intel OpenCL too.


Top
 Profile  
 
PostPosted: Sat May 26, 2012 6:11 pm 
Offline
Site Admin
User avatar

Joined: Sun Jun 26, 2005 6:43 pm
Posts: 3744
Location: California, USA
Interesting. Do you mind uploading some youtube video(s) of your work?

Will it become available under the zlib license as well?


Top
 Profile  
 
PostPosted: Sun May 27, 2012 11:33 pm 
Offline

Joined: Sat May 26, 2012 1:09 am
Posts: 17
majestik666 wrote:
Tested and works with NVidia OpenCL & Intel OpenCL too.

Thanks for testing; how does the Intel OpenCL implementation perform?

Erwin Coumans wrote:
Interesting. Do you mind uploading some youtube video(s) of your work?
Will it become available under the zlib license as well?

Yes; all files in the Bullet-FLUIDS repository are licensed under ZLib. Furthermore,
the only portion of code in the repository that did not originate from Bullet 2.80,
FLUIDS v.2, or myself are the marching cubes tables from:

http://paulbourke.net/geometry/polygonise/ , which notes that the tables are from:
http://paulbourke.net/geometry/polygoni ... source.cpp (public domain)

Video of the entire demo:
http://www.youtube.com/watch?v=jJ-rjffeFRY
(There were some recording issues at the very end.)


Top
 Profile  
 
PostPosted: Mon May 28, 2012 12:01 am 
Offline
User avatar

Joined: Tue Mar 02, 2010 6:13 am
Posts: 66
The NVidia one was faster but was getting pretty good
performance with both, can't test right now , but i'll
post some numbers tonight.

Edit :
Just did some quick performance test for the 3 demos,
the machine used is a Core i7 2.8GHz w/ NVidia 285

NVidia OpenCL
1 - 55ms for 11340 particles
2 - 70ms for 17496 particles
3 - 40ms for ~10000 particles

Intel OpenCL
1 - 60ms for 11340 particles
2 - 80ms for 17496 particles
3 - 50ms for ~10000 particles


Top
 Profile  
 
PostPosted: Tue May 29, 2012 9:15 am 
Offline
User avatar

Joined: Tue Mar 02, 2010 6:13 am
Posts: 66
forgot to mention the demo seems to be leaking memory a whole lot !

not really a big deal since it's really just a test but should
keep it in mind


Top
 Profile  
 
PostPosted: Tue May 29, 2012 5:53 pm 
Offline

Joined: Thu Sep 08, 2011 11:23 pm
Posts: 1
Hi rtrius,

I have been working on a similar project myself. http://andrewfsu.blogspot.com I currently have two-way interaction. I haven't integrated with the bullet library yet. I am currently working on integrating my SPH with the Bullet experiments repository. I would like to exploit the new opencl based rigidbody simulator. I also have plans to make a more generalized particle system which allows for rigidbody interaction. What plans do you have for your library? Also, all my code is available on github. https://github.com/ayoung200/EnjaParticles The library currently only works correctly in linux. I believe the main problem with the windows build has to do with struct alignment.

I also face similar problems with boundary conditions. SPH is very sensitive to the spring/damper boundary conditions. I have read many papers and found that several other boundary conditions exist which are more involved(and expensive) but generally more stable. Tweaking your values for the spring and dampening parameters can help but then it becomes more susceptible to "leaks". Some of the more accurate methods actually take into account the pressure of the fluid near the interface.

Here is a video with marching cubes enabled. https://vimeo.com/40670094

Regards,
Andrew Young


Top
 Profile  
 
PostPosted: Thu May 31, 2012 4:58 am 
Offline

Joined: Sat May 26, 2012 1:09 am
Posts: 17
majestik666 wrote:
forgot to mention the demo seems to be leaking memory a whole lot !

Thanks for the report; fixed in latest commit.

ayoung wrote:
What plans do you have for your library?

I'm aiming to make SPH fluids usable with Bullet's main/C++ branch, by implementing
and comparing the performance of various SPH-rigid body interaction methods.

Most of the work so far has focused on refactoring the SPH code; at this point
I have only conducted a shallow investigation of collision techniques.

Some of the interaction methods that I plan to look into:
    -One way interaction(penalty force), with and without CCD
    -Representing rigid bodies as particles
    -Combinations of the above two, such as using the penalty force method
    for the interior of a cube and particles for the edges/faces


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group