Sign in to follow this  
chrome68

Mass spring systems fluid behaviour

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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 :(

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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