Fluid simulator

About programs, games and other things related to Algodoo and Phun.

Fluid simulator

Postby Noobody » Sun Jun 27, 2010 7:11 pm

Hello, everyone!

I'm not sure if this counts as Algodoo related, but I'll post it anyway.

Ever since I discovered Phun two years ago, I've been fascinated by phsysics computer simulations. It was Phun that inspired me to code my own simulations and it's also thanks to Phun that I discovered Smoothed Particle Hydrodynamics.

Today, I'd like to share a few fluid demos I made using Smoothed Particle Hydrodynamics. It's of course not as fancy as Algodoo and neither that feature-rich, but it's fun to play with. It features multiple fluids and soft bodies interacting with each other. The soft bodies still need a bit of work, because water particles tend to get stuck in the soft bodies, resulting in strange 'jumpy' behaviour, but other than that it runs more or less stable.

Screenshot:
Image
Download: Link

Controls: Press Key 1 oder Key 2 to switch between the two demos. The first one features an emitter and a soft body. Space turns the emitter on/off (ADVICE: Turn the emitter off at max. 7500 particles, or the simulation starts to get laggy). Left mouse click spawns new soft bodies, right click spawns obstacles.
The second doesn't have any special controls and only shows three fluids interacting (red: very heavy; blue: heavy; green: light).


There is also a 3D (and multithreaded) version:
Image
Download: Link

Controls: Arrow keys turn the container, allowing interaction with the fluid (since the gravitation always points downward). As for the thread count, enter the amount of cores on your CPU for optimal performance (but not more than 8). Other numbers will work too, just not as fast.

The 3D version spawned a side-project, namely an offline raytracer, that I'm working on here and then (Youtube video).


Nothing of this would have been possible without Phun and I just wanted to thank Mr. Ernerfeldt for creating it. I hope you enjoy these demos.
Noobody
 
Posts: 3
Joined: Sun Jun 27, 2010 12:07 pm

Re: Fluid simulator

Postby Sonic » Fri Jul 16, 2010 8:05 pm

That's pretty awesome. How reliable is the fluid simulation? Is it better or worse than Algodoo's?
I do stuff and break things. You know how it is.
Image
User avatar
Sonic
 
Posts: 1467
Joined: Tue Sep 01, 2009 6:18 pm
Location: America!!!

Re: Fluid simulator

Postby Noobody » Sat Jul 17, 2010 12:41 am

Thanks! Well, that's hard to tell. Most probably Algodoo's in terms of stability and accuracy, considering the amount of time and knowledge that went into it. I'm not sure what exactly you mean by reliable, though.
Noobody
 
Posts: 3
Joined: Sun Jun 27, 2010 12:07 pm

Re: Fluid simulator

Postby Sonic » Sat Jul 17, 2010 5:49 am

I mean will it compress, or go through objects if you push hard enough?
I do stuff and break things. You know how it is.
Image
User avatar
Sonic
 
Posts: 1467
Joined: Tue Sep 01, 2009 6:18 pm
Location: America!!!

Re: Fluid simulator

Postby Noobody » Sun Jul 18, 2010 8:35 pm

It's more or less incompressible, but there'll still be slightly noticable changes in the volume under large compression or with more than 5000 particles.

The particles will also go through very small objects sometimes, but under normal circumstances this hardly ever happens.
Noobody
 
Posts: 3
Joined: Sun Jun 27, 2010 12:07 pm

Re: Fluid simulator

Postby Bronie12345 » Mon Aug 09, 2010 9:57 pm

i like the way it is multi-threaded in the 3d one, because then i can see the full power of my computer, incase of only having one core doing all the work (like in algodoo >.>)

nice work on this!!
When you make a comment at a scene, at least be brave enough to subscribe to that scene...
Don't go into a topic unprepared... Read the whole topic, including all the comments, before posting.

92% of teenagers have resorted to rap music. If you are part of the 8% who listens to real music, put this in your signature.
90% of teenagers today would die if Myspace/Facebook were completely destroyed. If you are one of the 10% who would be laughing their heads off, add this to your signature.
User avatar
Bronie12345
 
Posts: 451
Joined: Mon Aug 31, 2009 8:52 pm
Location: The Netherlands


Return to Algodoo related

Who is online

Users browsing this forum: No registered users and 0 guests