|
![](/i/fill.gif) |
Why don't you try this one:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
v1, v2 = velocities of particle 1 and 2
p1, p2 = locations of particle 1 and 2
dt = the time step
Dist = vlength(p1-p2);
v1 = v1 + Fluidity * (v2-v1) * exp(-Dist/Range) * dt;
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
this will cause all the particles to approach the same velocity
exponentially within approximately 1/Fluidity time steps. You could
then use Range to control the effect of distance or the "skin depth" of
the fluid.
Implementing viscosity like this might allow you to use a very gentle
force to keep the particles together, like
v1 = v1 + ( Fluidity1 * (v2-v1) + Fluidity2 * (p2-p1)*(Dist-Size) )*
exp(-Dist/Range) * dt
In this case, Size is the average distance the particles will try to
keep from their nearest neighbor.
Let me know if either of these ideas work.
- Ben
Post a reply to this message
|
![](/i/fill.gif) |