|
|
> Thanks for the explanation, i was more referring to the actual program
> though. The nice thing about particle based fluid simulation is that
> the fluid can move in large areas without excessive memory requirements
> that would occur with grid based methods. It could even be worth
> considering integrating such a system into POV since for interaction
> with the environment you could rely on the raytracing functions.
In short, there are two different computational phases:
1) Compute change rates for every particle involved in the simulation. In detail:
-) fluid-fluid particles interactions (every particle within a fixed distance from
the particle being updated has to be considered in the process. Check
the papers for more details about the equations... you have to update
accel. and density. ~30-40 neighbours / particle).
-) external forces (gravity... simply add them to the accel. vector of the
particle).
-) boundary-fluid particles interactions (for the moment boundary is
modelled introducing fixed particles in correspondence of the solid
surface and adopting a pure repulsive Lennar-Jones interaction force.
Fixed particles are placed really close in order to form a strong
barrier to the penetration of the fluid). It should be easy to replace
particles and to manage directly particles-solid collisions.
Note: 1a) In order to speed up computations, as the interpolating kernel
presents a compact support (only particles within a fixed distance
interact), it could be used (well, it's obligatory ;) ) a suitable
neighbours
finding algorithm. I've used a simple uniform grid: all the
neighbours of the particle being updated are located checking only
few adiacent cells (you can take advantage of the simmetry in
particle-particle interactions to reduce computations).
1b) Current time-step is determined checking the physical properties
associated to every particle (simply check accel. and speed of sound).
2) Update particles position-density-speed (leapfrog scheme, prediction - correction
formulation) using change rates and timestep found in the previous step.
The first one is the more complex and time consuming phase by far...
1661s computation -> 1558s phase 1 vs 102s phase 2... ;)
> You can use the density file in an isosurface shape just like any other
> pattern:
>
> #declare Fn_Density=
> function { pattern { density_file df3 "file" interpolate 2 } }
>
> isosurface {
> function { Fn_Density(x, y, z) - 0.5 }
> ...
> }
>
> This will show the isosurface with density=0.5.
Gotta try it but I have to rerun simulation to collect data once again, though.
I'll do it in the weekend.
Post a reply to this message
|
|