POV-Ray : Newsgroups : povray.binaries.animations : Liquid animation Server Time
12 Oct 2026 08:28:01 EDT (-0400)
  Liquid animation (Message 1 to 20 of 20)  
From: Claudio Pozzoli
Subject: Liquid animation
Date: 12 Nov 2003 10:53:45
Message: <3fb25789@news.povray.org>
Hi all ; )
I would like to show the results of my work on liquid simulation; well,
just a little animation about a breaking dam problem in a complex
environment and the following inflow of water through a pipe from a
higher tank. Physical simulation has been realized using Smoothed Particle
Hydrodynamics. The triangle mesh exported in PovRay for the final
rendering is an approximation (Marching Cubes here), of the isosurface
defined selecting an appropriate value over the global
scalar field generated by the particles. I know... the liquid is a little too
much viscous to be real water, but it's a "problem" of the method (I'm
gonna give some explanations if you're interested in) and I'm investigating
a way to work it out.

What do you think?


Thx all

Claudio

(sorry for my english)


Post a reply to this message

From: Claudio Pozzoli
Subject: Re: Liquid animation
Date: 12 Nov 2003 11:00:49
Message: <3fb25931$1@news.povray.org>
Sry :) Here the link

http://digilander.libero.it/stajaame/index.html

Claudio


Post a reply to this message

From: Tim Nikias v2 0
Subject: Re: Liquid animation
Date: 12 Nov 2003 11:54:52
Message: <3fb265dc@news.povray.org>
> What do you think?


I think it looks awesome! Is it all POV-SDL, or some external program? How
long was the parsing time for the frames? Rendering times? I'm not so much
interested into the inner workings (they're sure interesting, but I don't
have the time right now to wrap my head around that) but more how easy it
could be used by some average guy? Like, do I need to build my scene with an
isosurface, or can I just hand a POV-object to the program? How about
setting up frames/steps?

-- 
"Tim Nikias v2.0"
Homepage: <http://www.nolights.de>
Email: tim.nikias (@) nolights.de




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.538 / Virus Database: 333 - Release Date: 10.11.2003


Post a reply to this message

From: Rafal 'Raf256' Maj
Subject: Re: Liquid animation
Date: 12 Nov 2003 12:53:37
Message: <Xns9431C00C7F3F0raf256com@204.213.191.226>
cla### [at] liberoit news:3fb25931$1@news.povray.org

> http://digilander.libero.it/stajaame/index.html

Can You please recompress it with some "standard" codec like mpeg-1, divx, 
vxid?


-- 
#macro g(U,V)(.4*abs(sin(9*sqrt(pow(x-U,2)+pow(y-V,2))))*pow(1-min(1,(sqrt(
pow(x-U,2)+pow(y-V,2))*.3)),2)+.9)#end#macro p(c)#if(c>1)#local l=mod(c,100
);g(2*div(l,10)-8,2*mod(l,10)-8)*p(div(c,100))#else 1#end#end light_source{
y 2}sphere{z*20 9pigment{function{p(26252423)*p(36455644)*p(66656463)}}}//M


Post a reply to this message

From: Christoph Hormann
Subject: Re: Liquid animation
Date: 12 Nov 2003 13:42:02
Message: <3vaa81-lin.ln1@triton.imagico.de>
Claudio Pozzoli wrote:
> Hi all ; )
> I would like to show the results of my work on liquid simulation; well,
> just a little animation about a breaking dam problem in a complex
> environment and the following inflow of water through a pipe from a
> higher tank. Physical simulation has been realized using Smoothed Particle
> Hydrodynamics. The triangle mesh exported in PovRay for the final
> rendering is an approximation (Marching Cubes here), of the isosurface
> defined selecting an appropriate value over the global
> scalar field generated by the particles. I know... the liquid is a little too
> much viscous to be real water, but it's a "problem" of the method (I'm
> gonna give some explanations if you're interested in) and I'm investigating
> a way to work it out.
> 
> What do you think?

It looks very good.  If you wrote the simulation engine yourself i guess 
a lot of people here would be interested in it.

Note that you don't need to generate a mesh from the scalar field, 
POV-Ray can directly render isosurfaces.  I did renders of fluid 
simulations before by generating a density file from the simulation data 
and using it in an isosurface.

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 25 Oct. 2003 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Claudio Pozzoli
Subject: Re: Liquid animation
Date: 12 Nov 2003 15:28:52
Message: <3fb29804@news.povray.org>
> Can You please recompress it with some "standard" codec like mpeg-1, divx,
> vxid?

http://digilander.libero.it/stajaame/index.html

Uploaded a mpeg-1 compressed video ; )

Claudio


Post a reply to this message

From: Chris Johnson
Subject: Re: Liquid animation
Date: 12 Nov 2003 16:48:11
Message: <3fb2aa9b$1@news.povray.org>
Very, very impressive. I'd be interested in some more information about the
algorithm used. Is it similar to the one used in
http://graphics.stanford.edu/~fedkiw/papers/stanford2001-02.pdf?

-Chris


Post a reply to this message

From: Claudio Pozzoli
Subject: Re: Liquid animation
Date: 12 Nov 2003 20:31:29
Message: <3fb2def1@news.povray.org>
> "Tim Nikias v2.0" wrote
> I think it looks awesome! Is it all POV-SDL, or some external program? How
> long was the parsing time for the frames? Rendering times?

I've wrote and external program responsible for the physical simulation of the
liquid. Every time step (user defined) it saves in a file the surface of the liquid
in mesh2 format (around 12000 vertex and 22000 triangles for the simulation
posted). All those file are then processed by PovRay for final rendering
(Pov is used only for that purpose). Rendering times are a problem, though:
8 min / frame with radiosity and photons on (~360 frames in the animation
you've seen). Maybe an advanced user could optimize
some parameters and speed up rendering without a loss in quality... :)

> I'm not so much
> interested into the inner workings (they're sure interesting, but I don't
> have the time right now to wrap my head around that) but more how easy it
> could be used by some average guy? Like, do I need to build my scene with an
> isosurface, or can I just hand a POV-object to the program? How about
> setting up frames/steps?

Right now the program is not user-friendly (well, I was in a hurry to complete
my thesis so I postponed that aspect...). It provides a graphical interface
for preview purposes only but you have to setup your scene through a text
file whose sections define:
-) external time step - frame save time.
-) particles number
-) initial position of fluid blocks (if any).
-) fluid emitters (if any - with start / end time).
-) boundary definition (just planes for the moment)
-) ...
Just a word: boring : (

Once started the simulation you only have to wait (a lot... : P): 100 secs / frame
for that animation (~100000 fluid particles). Computational time and memory
requirements increase quickly raising the number of particles involved.
The program advance internally by a time step that respect stability conditions
(for example, if the average inner step is 0.0001250s (realistic value), the
program have to update the simulation ~160 times from a frame to another,
if the user defined a 0.02s external time step).

I'm working on a user-friendly editor in my spare time (not that much), so who
knows... :)

Claudio

Ps: I've uploaded another animation (ogl preview of a different simulation).


Post a reply to this message

From: Claudio Pozzoli
Subject: Re: Liquid animation
Date: 12 Nov 2003 20:35:55
Message: <3fb2dffb@news.povray.org>
> It looks very good.  If you wrote the simulation engine yourself i guess
> a lot of people here would be interested in it.

The simulation is based over Smoothed Particles Hydrodynamics, a
pure lagrangian method introduced in late '70 by Gingold and
Monaghan and originally used to model compressible flows in
astrophysical simulations. Successively it has been adapted to the
simulation of quasi-incompressible - incompressible flows.
The liquid is approximated by a finite number of particles, each carrying
physical informations like density, pressure, speed, viscosity...
The value of every physical quantity at any point is estimated by taking a
weighted average of the same quantities associated with the particles
located in a surrounding volume. Navier-stockes equations are
"rewritten" as inter-particles interaction laws. I don't have a english
paper based over my work right now but many articles have been
published this year and last one (it seems like the raise in computational
power increased the attention of computer graphics community over this
method, really time-consuming :) ). Here some references (try google
as well, though many papers are mainly focused over astophysical
applications):

http://mec-mail.eng.monash.edu.au/~mct/mct/docs/sph/sph.html
http://www.eg.org/EG/DL/WS/SCA03/154-159-mueller.pdf
http://cggmwww.csie.nctu.edu.tw/images/jwchiu/ModelingLiquid.pdf

> Note that you don't need to generate a mesh from the scalar field,
> POV-Ray can directly render isosurfaces.  I did renders of fluid
> simulations before by generating a density file from the simulation data
> and using it in an isosurface.

How could I do this? I mean: once I've generated a density file, following
the examples in pov documentation, I have to use it as a pattern (media,
pigment-normal) and associate it with a primitive. Do you use an isosurface
as object? densityfile as a media pattern? I would like to test it out! : )

Claudio


Post a reply to this message

From: Claudio Pozzoli
Subject: Re: Liquid animation
Date: 12 Nov 2003 20:43:51
Message: <3fb2e1d7$1@news.povray.org>
> http://www.eg.org/EG/DL/WS/SCA03/154-159-mueller.pdf

Update: use this instead http://graphics.ethz.ch/~mattmuel/publications/sca03.pdf


Post a reply to this message

From: Claudio Pozzoli
Subject: Re: Liquid animation
Date: 12 Nov 2003 20:45:25
Message: <3fb2e235$1@news.povray.org>
> Very, very impressive. I'd be interested in some more information about the
> algorithm used. Is it similar to the one used in
> http://graphics.stanford.edu/~fedkiw/papers/stanford2001-02.pdf?

No ; ) the approach they used is semi-lagrangian (particles + level set method,
they combined a lagrangian approch with a eulerian approch).

Smoothed Particle Hydrodynamics, used (with some changes) in the program
I wrote, is a pure lagrangian method. Fluid evolution is tracked following
the movements of many pseudo-particles during the simulation. Have a look at the
links I've posted in the previous message, you'll find a good description
of the technique there. ; )

Feel free to ask if you need more details.


Post a reply to this message

From: Fernando Gonzalez del Cueto
Subject: Re: Liquid animation
Date: 13 Nov 2003 00:40:58
Message: <3fb3196a$1@news.povray.org>
Wow...  è impressionante!

Very very nice. We want to see more :)

Fernando


Post a reply to this message

From: Christoph Hormann
Subject: Re: Liquid animation
Date: 13 Nov 2003 04:42:01
Message: <ktvb81-2i7.ln1@triton.imagico.de>
Claudio Pozzoli wrote:
>>It looks very good.  If you wrote the simulation engine yourself i guess
>>a lot of people here would be interested in it.
> 
> 
> The simulation is based over Smoothed Particles Hydrodynamics, a
> pure lagrangian method introduced in late '70 by Gingold and
> Monaghan and originally used to model compressible flows in
> astrophysical simulations. Successively it has been adapted to the
> simulation of quasi-incompressible - incompressible flows.
> The liquid is approximated by a finite number of particles, each carrying
> physical informations like density, pressure, speed, viscosity...
> [...]

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.

>>Note that you don't need to generate a mesh from the scalar field,
>>POV-Ray can directly render isosurfaces.  I did renders of fluid
>>simulations before by generating a density file from the simulation data
>>and using it in an isosurface.
> 
> 
> How could I do this? I mean: once I've generated a density file, following
> the examples in pov documentation, I have to use it as a pattern (media,
> pigment-normal) and associate it with a primitive. Do you use an isosurface
> as object? densityfile as a media pattern? I would like to test it out! : )

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.

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 25 Oct. 2003 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Rick [Kitty5]
Subject: Re: Liquid animation
Date: 13 Nov 2003 07:47:06
Message: <3fb37d4a@news.povray.org>
Claudio Pozzoli wrote:
> What do you think?

That is very very impressive!!
-- 
Rick

Kitty5 NewMedia http://Kitty5.com
POV-Ray News & Resources http://Povray.co.uk
TEL : +44 (01270) 501101 - ICQ : 15776037

PGP Public Key
http://pgpkeys.mit.edu:11371/pks/lookup?op=get&search=0x231E1CEA


Post a reply to this message

From: Rafal 'Raf256' Maj
Subject: Re: Liquid animation
Date: 13 Nov 2003 23:28:00
Message: <Xns9433377F137C9raf256com@204.213.191.226>
cla### [at] liberoit news:3fb29804@news.povray.org

>> Can You please recompress it with some "standard" codec like mpeg-1,
>> divx, vxid?
> http://digilander.libero.it/stajaame/index.html
> Uploaded a mpeg-1 compressed video ; )

wooow
 
*realy* nice :) I quess it's nices water I had even seen in pov :)


-- 
#macro g(U,V)(.4*abs(sin(9*sqrt(pow(x-U,2)+pow(y-V,2))))*pow(1-min(1,(sqrt(
pow(x-U,2)+pow(y-V,2))*.3)),2)+.9)#end#macro p(c)#if(c>1)#local l=mod(c,100
);g(2*div(l,10)-8,2*mod(l,10)-8)*p(div(c,100))#else 1#end#end light_source{
y 2}sphere{z*20 9pigment{function{p(26252423)*p(36455644)*p(66656463)}}}//M


Post a reply to this message

From: Claudio Pozzoli
Subject: Re: Liquid animation
Date: 14 Nov 2003 10:29:10
Message: <3fb4f4c6@news.povray.org>
> 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

From: JimT
Subject: Re: Liquid animation
Date: 14 Nov 2003 12:25:01
Message: <web.3fb50eed16bb28727c8049c20@news.povray.org>
Claudio Pozzoli wrote:
>
>I've wrote and external program responsible for the physical simulation of the
>liquid. Every time step (user defined) it saves in a file the surface of the liquid
>in mesh2 format (around 12000 vertex and 22000 triangles for the simulation
>posted). All those file are then processed by PovRay for final rendering
>(Pov is used only for that purpose). Rendering times are a problem, though:
>8 min / frame with radiosity and photons on (~360 frames in the animation
>you've seen). Maybe an advanced user could optimize
>some parameters and speed up rendering without a loss in quality... :)
>
Very convincing, and good luck with your thesis. A bit of flash always goes
down well!

I can understand that the photons are giving you some very nice caustics,
but I'm not sure radiosity is contributing much. Do you save much time with
it off?


Post a reply to this message

From: Andrew Coppin
Subject: Re: Liquid animation
Date: 14 Nov 2003 15:33:43
Message: <3fb53c27$1@news.povray.org>
OK, so that's downright cool!

*sigh* Makes me wish I could do stuff like that... but last time I read a
paper on the subject, it was totally over my head. (I'm still trying to
figure out how on Earth cubic Bezier splines work... heh)

Thanks.
Andrew.


Post a reply to this message

From: Claudio Pozzoli
Subject: Re: Liquid animation
Date: 18 Nov 2003 07:50:35
Message: <tfm7ucng4gjk.1fptfpdprq5mx$.dlg@40tude.net>
> In data Fri, 14 Nov 2003 12:24:21 EST, JimT ha scritto:
> I can understand that the photons are giving you some very nice caustics,
> but I'm not sure radiosity is contributing much. Do you save much time with
> it off?

I'll post some screenshots with and without photons/radiosity as soon as
possible (I've formatted my hd... I've got to reinstall everything :P).

Claudio


Post a reply to this message

From: ACH Postma
Subject: Re: Liquid animation
Date: 14 Jan 2004 21:23:42
Message: <4005f9ae$1@news.povray.org>
Beautiful !

I always were a liquids freak so this is really nice to watch ! I wished I
had time to study this furthermore !

/~\nne


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.