At the age of 17 I had the chance to pilot a military airplane, and that made me interested in fluid dynamics.
So I started to develop a program on my computer, a Commodore Amiga 500, using the great AmigaBasic.
I used the Euler's equations, and I noticed that the simulation was good for the first iterations,
but then diverged no matter how small the time step was. Just a few years later, at the university,
I found the reason of that behaviour: I had to use an implicit method instead of the intuitive,
single step explicit method I used.
It's a pity I lost the source code of that project.
In the meantime, as I grew up a little, I could afford a PC and I started a new version of my program,
this time using the Pascal programming language on MS-DOS. I choosed to follow a more
conservative path,
solving the potential equation.
The program computes the velocity field of a fluid around a two dimensional object moving with a specified velocity.
The initial data are: the object's profile, its speed, and the number of elements in which the surrounding space is subdivided.
The fluid is supposed to be uncompressible and I used the potential equation getting the velocity from the potential's gradient:
To solve these equations I divided the space surrounding the object in a series of elements.
In each element the potential and the velocity are supposed to be constant.
To solve the potential equation I used multiple linear regression.
In case you were interested in the Pascal programming language (i.e. if you like history), here is the program's source code:
...and in case you did not have a Pascal compiler, you can get the executable (just for DOS, but works on Windows, too):
The following are screenshots of my program:
The fluid comes from the left border. This is a representation of the potential:
Here you can see how the space is divided:
This represents the velocity: the brighter the red, the greater the velocity's module. The yellow segments are the velocity's vectors.
Copyright 2007 Pietro Mele
My homepage:
www.geocities.com/pietromele