Mass spring systems fluid behaviour

Started by
7 comments, last by chrome68 15 years, 7 months ago
I wondered how i could make an exisintg simple mass spring system behave more like a fluid. Say a ball filled with oil. How could i inculde things like viscosity into the standard equations for example. Any other suggestions?
Advertisement
Here's a nice little paper that got me started:

http://panoramix.ift.uni.wroc.pl/~maq/soft2d/howtosoftbody.pdf

It's slightly flawed, though. To find the area of the polygon, simply use a standard polygon area algorithm, not what is used in the paper. If you want the "blob" to behave more like a liquid, simply use Hooke's law of elasticity to find pressure, a la: pressure = Pressurecoefficient*(Area-RestArea)

Here's a more advanced example of mine (exe and source). It's a hack, but it works. Coded in FreeBasic:

http://www.jernmager.dk/stuff/soft_body_03.zip

Cheers,
Michael
Look up smoothed particle hydrodynamics.

My demo with source code (which is a bit old now) can be found here.
Thanks for the replies.

I don't actually want to change the mass-spring system i'm working with so SPH is going to be difficult to revert to.

I have looked at Matyka's 3D softbody model (which is a huge C++ coded project). He maintains the object's gaseous behaviour by keeping a constant pressure applied on the surface faces in the normal direction. As you mentioned the area this presure is distributed to is a problem but not a major one to fix.

However I wondered whether it is possible to include some more equations from other areas (that deal with forces, velocities etc...) describing fluid/viscous behaviour. I know there are groups that deal with deformable models and fluids but 99% of the time they rely on partial differential equations (PDE's) to obtain such a behaviour, which is aplied to hoards of particles appearing and disappearing in time. This is impossible to integrate into discrete mass-springs hence i wondered if there are some alternatives?
As expected: I found an article called "Fluid-Based Soft Object Model" by D.Nixon, not a real-time model and based on Navier-Stokes PDE's. Not of much use :(
Ron Fedkiw seems like a guy with a few tricks.
Yup, seen a lot of his papers before and again, of little use because fluid mechanics has little room for integration into a mass spring systems. Hence i'm looking for alternative heuristic approaches. People got any ideas?
Quote:Original post by chrome68
I wondered how i could make an exisintg simple mass spring system behave more like a fluid. Say a ball filled with oil. How could i inculde things like viscosity into the standard equations for example. Any other suggestions?

I'm not really sure what you're looking for, but the paper + example exe + code I posted earlier describes exactly how to make a mass-spring-damper system behave like - say - a ball of viscous fluid (at least, this is exactly what the example code does).

Did you take a look at it? All you need to do is add a few extra parameters on top of your existing spring system, it's not really that hard, and it's great fun to play around with.

Cheers,
Michael
Hi.

As i mentioned in my first post, i have an existing mass spring system. It is almost the same as the one in the link you posted. And it has been modified using some parts of the corresponding paper by Matyka. So thats why i say that i have looked at it.

But what i would like to do is add some more code and parameters to make the object behave like a fluid. The link you posted does this to some extent by using maintaining a constant pressure inside the ball. But i would like some advice on how to further use some other physics principles to achieve a better fluidlike behaviour, without resorting to PDE's. Thanks for your help thus far.

This topic is closed to new replies.

Advertisement