POV-Ray : Newsgroups : povray.advanced-users : Wind question Server Time
29 Jul 2024 22:29:13 EDT (-0400)
  Wind question (Message 6 to 15 of 15)  
<<< Previous 5 Messages Goto Initial 10 Messages
From: Sigmund Kyrre Aas
Subject: Re: Wind question
Date: 4 Mar 2001 08:05:45
Message: <ls84atol0ukvs4kb7v2roe43d2c0on4ooc@4ax.com>
On Sun, 4 Mar 2001 02:42:20 +0100, "Rune" <run### [at] inamecom>
wrote:
>line. I'm can't figure out if it's supposed to behave that way or not? How
>should the particles move when wind is used?

The drag coefficient is highly speed dependent. A side wind on a
falling sphere will initially give a large wind force, then decrease
as the sphere accelerates to steady state.

Below I've included a drag coefficient function based on experimental
data. I don't have the time to convert it to pov syntax, but you
probably know what to do. (CD is the output, so when this is written
as a macro just type CD at the end.) Input is the Reynold's number. If
hydrodynamic mass and buoyancy is neglected, the following
differential equation is obtained:
dV/dt=-g*y-C*Vr*abs(Vr)*CD
where 
V is speed <vx,vy,vz>
y=<0,1,0>
C=0.75*rho/d
rho=rho_air/rho_sphere
Vr=V_sphere-V_air
abs(V)=vlength(V)
CD=CDkule(Re)=CDkule(abs(Vr)*d/nu)
d is sphere diameter and nu is kinematic viscosity i.e 1.5e-5 for air
when everything is in si units. 

The differential equation can be solved within pov using Euler, or
even better, Heun's method. If you're not familiar with numerical
integration maybe someone else here can help you. I don't have the
time at the moment.

sig

Short explanation of the syntax below:
array=[43 23 13 4]; // defines an array (or row matrix actually)
array(3) // gives 13


%======================== CDkule ==========================
% Computes the drag-coefficient of a sphere as a function
% of the Reynolds nunber Re. Curve fitted after fig. A-56
% in "Fluid Mechanics & Hydraulics", Schaum's Solved Problems
%=============================================================


%-----------------------
function val = qparab(y,x) 
val = y(1)+x*(y(2)+(y(3)+ y(4)*x)*x);


function CD = CDkule(Re)
a2=[0.658 34.87 -14.05 4.22];
a3=[2.41 -17.08 43.72 -30.41];
a4=[11.932 -8.472 2.031 -0.1584];
a5=[14.93 -7.332 1.1905 -0.06335];
if (Re<=0.0)
   CD = 0.0;
   return
end
if (Re> 8.0e6) 
   CD=0.2;
   return
end
x0 = log(Re)/log(10.0);
if (Re> 0.0 & Re<=0.5)
   CD=24.0/Re;
   return
end
if (Re> 0.5 & Re<=100.0)
    CD=qparab(a2,1.0/Re);
    return
end
if (Re> 100.0 & Re<=1.0e4)
    CD=qparab(a3,1.0/x0);
    return
end
if (Re> 1.0e4 & Re<=3.35e5)
    CD=qparab(a4,x0);
    return
end
if (Re> 3.35e5 & Re <=5.0e5)
    x1 = log(Re/4.5e5)/log(10.0);
    CD=91.08*x1^4 + 0.0764;
    return
end
if (Re> 5.0e5 & Re<=8.0e6)
    CD=qparab(a5,x0);
    return
end


-- 
ICQ 74734588


Post a reply to this message

From: Duncan Gray
Subject: Re: Wind question
Date: 4 Mar 2001 12:19:22
Message: <3aa2791a@news.povray.org>
Rune wrote:
> I have implemented wind in my particle system, but I'm not sure it's
working
> correctly. <SNIP>

Sounds like your wind might be directly accelarating the particles (via the
drag factor). Should this effect be divided by a factor of the mass of the
particle to reflect it being a force rather than an accellaration ?

As the drag is related to the area (i.e. radius^2) and mass is related to
the volume (radius^3), you should be able to get away with dividing the wind
effect by some factor of the blob size.

Maybe not entirely accurate, but I think it would tend to make the tiny
water droplets get blown further off course than the larger (heavier)
droplets. I guess it should work in reverse also, for a particle stream shot
at say 45 degrees from horizontal, with no wind, the lighter particles will
tend towards the wind direction(i.e. none) more than the heavier particles.
i.e. the heavier particles will travel further.

I'm not sure, but I think this is the effect I would expect to see.

--
Duncan Gray
(warning: may contain traces of nut)


Post a reply to this message

From: Tony[B]
Subject: Re: Wind question
Date: 4 Mar 2001 19:14:16
Message: <3aa2da58@news.povray.org>
Uh, I dunno I haven't really looked into that chapter... I just know it's
there... <goes to check> OK. It talks specifically about "Projectile Motion
with Air Resistance".

Here's the pseudocode they propose:

1) Identify the mass (m), area (A) of the silhouette of the object (as seen
from the front), drag coefficient (C), and density (p) of the air. D =
(p*C*A)/2

2) Choose the time interval DeltaT, and the initial values of x, y, Vx, Vy,
and T. You may want to express velocity as magnitude and direction.

3) Choose a maximum number of intervals N or the maximum time
(T_max=N*DeltaT).

4) Loop steps 5-9 while n < N or T < Tmax

5) Calculate acceleration components: ax = -(D/m)*V*Vx     ay
= -g-(D/m)*V*Vy

6) Plot x, y, Vx, Vy, ax, and ay.

7) Calculate new velocity components:  Vx + DeltaVx = Vx + ax*DeltaT
Vy + DeltaVy = Vy + ay*DeltaT

8) Calculate new coordinates: x + Deltax = x + Vx*DeltaT + ax*(DeltaT^2)/2
y + Deltay = y + Vy*DeltaT + ay*(DeltaT^2)/2

9) Increment the time by DeltaT.

10) Stop.



That should be it. At least, that's all the book has to say about that.
Sorry I couldn't be more helpful.


Post a reply to this message

From: Chris Huff
Subject: Re: Wind question
Date: 5 Mar 2001 07:47:33
Message: <chrishuff-FD52A5.07442605032001@news.povray.org>
In article <3aa19e29$1@news.povray.org>, "Rune" 
<run### [at] inamecom> wrote:

> When I have just gravity the particles accelerate downwards. When I 
> add wind from the side, the particles move downwards and to the side, 
> accelerating, but in a straight line. When I use less drag, they move 
> less to the side and when I use more drag they move more to the side. 
> But always in a straight line. I'm can't figure out if it's supposed 
> to behave that way or not? 
> How should the particles move when wind is used?

In my particle system, I consider particles as infinitely small points, 
with a constant wind resistance (not related to velocity). While it 
doesn't simulate any physical case, it seems to work well for the 
purposes of the particle_system object.
I first figure out the velocity of the surrounding air *relative to the 
velocity of the particle*, by subtracting the velocity of the particle 
from that of the wind. I then multiply by the drag, which is a simple 
number specified by the user, and add the result to the other forces.
If the wind is slower than the particle, air resistance will cause the 
particle to slow down toward the wind speed. Otherwise, it will speed up 
to match...in other words, it always tends toward the wind velocity, 
even if that is < 0, 0, 0>, so it is really just a simulation of air 
drag.
Again, this doesn't match any physical effect, but it's "close enough" 
for graphics and probably a lot faster than computing the actual drag, 
which you would probably have to compute first for a range of speeds, 
and put into an array or spline to look up later, in order to get a 
reasonable speed. Actually, using a spline instead of a plain float 
value might not be a bad idea...

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Greg M  Johnson
Subject: Re: Wind question
Date: 5 Mar 2001 09:38:16
Message: <3AA3A372.2675EB5F@my-dejanews.com>
Rune wrote:

>  How should the particles move when wind is used?

I gave you a suggestion earlier.


Post a reply to this message

From: Sigmund Kyrre Aas
Subject: Re: Wind question
Date: 5 Mar 2001 12:04:02
Message: <bud7atg70uttprelkkek209b7bsfrt7mde@4ax.com>
I've made some code based on a one-dimensional case in "Fluid
Mechanics" by White. I've uploaded the files in pbs-f.

sig
-- 
ICQ 74734588


Post a reply to this message

From: Rune
Subject: Re: Wind question
Date: 5 Mar 2001 18:13:28
Message: <3aa41d98@news.povray.org>
"Greg M. Johnson" wrote:
> Rune wrote:
>
> >  How should the particles move when wind is used?
>
> I gave you a suggestion earlier.

And I used it. Now I'd like to know if it works. Therefore I describe the
results I get. What I'm interested in now is not the method but the result.
Which results have you get using the method?

Rune
--
\ Include files, tutorials, 3D images, raytracing jokes,
/ The POV Desktop Theme, and The POV-Ray Logo Contest can
\ all be found at http://rsj.mobilixnet.dk (updated January 28)
/ Also visit http://www.povrayusers.org


Post a reply to this message

From: Rune
Subject: Re: Wind question
Date: 5 Mar 2001 18:13:31
Message: <3aa41d9b@news.povray.org>
"Chris Huff" wrote:
> In my particle system, I consider particles as infinitely
> small points,

Me too.

> with a constant wind resistance (not related to velocity).
[description snipped]

I do just the same except that I square the resistance, after advise from
several people from this group.

With the method I've used the particles move in a straight line. (The
velocity is not constant but the direction is.) I don't know if it is
supposed to be that way. I've also seen some very complicated methods
described here which I do not plan to implement. A simulation is fine for
me. Still, I'd like the simulation to look good.

I wonder how does the particles in your patch move when under the influence
of wind? (It's not the theory I'm interested in. I'd like to know, when the
experiment is actually done, do they move in straight lines or not?)

Rune
--
\ Include files, tutorials, 3D images, raytracing jokes,
/ The POV Desktop Theme, and The POV-Ray Logo Contest can
\ all be found at http://rsj.mobilixnet.dk (updated January 28)
/ Also visit http://www.povrayusers.org


Post a reply to this message

From: Chris Colefax
Subject: Re: Wind question
Date: 5 Mar 2001 20:14:15
Message: <3aa439e7@news.povray.org>
Rune <run### [at] inamecom> wrote:
> I have implemented wind in my particle system, but I'm not sure it's
working
> correctly.
>
> When I have just gravity the particles accelerate downwards. When I add
wind
> from the side, the particles move downwards and to the side, accelerating,
> but in a straight line. When I use less drag, they move less to the side
and
> when I use more drag they move more to the side. But always in a straight
> line. I'm can't figure out if it's supposed to behave that way or not? How
> should the particles move when wind is used?

That depends on how you define "wind".  In my Liquid Spray include file, I
implemented the same idea, with a constant acceleration added based on wind
direction and strength.  Additionally, particles have a mass based on their
size, so smaller particles are more affected by the wind force.   Finally,
user-controllable turbulence is factored in so that each particle's wind
force is randomised.

For the most effective wind animation I'd probably aim for a dynamic force,
rather than simulating the wind as constant, linear force.  Introducing
vortex-like turbulence should give a convincing "blown-about" appearance to
the particles' movements (imagine feathers, falling leaves, even rain to a
certain extent).  Realistic vortices are notoriously complex, but perhaps
you could base the wind on shifting bozo patterns, so the smooth noise of
the pattern leads to recognisable shifts in wind strength and direction...


Post a reply to this message

From: Chris Huff
Subject: Re: Wind question
Date: 5 Mar 2001 21:06:48
Message: <chrishuff-DC58A9.21032705032001@news.povray.org>
In article <3aa41d9b@news.povray.org>, "Rune" <run### [at] inamecom> 
wrote:

> With the method I've used the particles move in a straight line. (The
> velocity is not constant but the direction is.) I don't know if it is
> supposed to be that way. I've also seen some very complicated methods
> described here which I do not plan to implement. A simulation is fine for
> me. Still, I'd like the simulation to look good.

The particles should move in a curve...it sounds like you are using a 
constant acceleration for the wind, instead of subtracting the velocity.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

<<< Previous 5 Messages Goto Initial 10 Messages

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