

(sorry for poor english use, if you will have problems with understand something - mail me)


 How to built .opt file?


Option file contains:

a) info about size of output and grid
b) specify of fluid, physic properties, dt (delta time) size
c) graphics mode information
d) stability power info
e) configuration of particles
f) boundaries configuration

First - look for examples, try to use fluid with that examples. Now you see that some options are easy to understand. Anyway we will try together to built option file for situation like in image.jpg

/* Config file for "fluid" program. */

/* You Can use typical comments like in c languague */

/*
At the beginning we must specify size of output picture - values in pixels. 
*/

WIDTH = 320
HEIGHT = 200

/*

Now we specify how much cells in x and y direction we want to have. That is important - bigger NX,NY = more stability, accuracy result + longer time of animation rendering. 

*/

NX = 64
NY = 40

/* Physic property - gravity vector. You can give also gravity in x direction */

GX = 0.0
GY = -0.1

/* Time step dt */

DT = 0.5

/* Viscosity of the fluid. Remember, than accuracy and stability of real water (VIS=0.01) it's very low, but it's possible to simulate, but needs much computer time. */

VIS = 0.2


/* Stability criteria. If you don't want to change source code - there you can raise stability criteria. Lower value = more stability, much computer time.*/

STABILITY = 0.1

/* Graphics mode. At the moment possibly:

0 - particles with pressure field color
1 - particles one color set
2 - velocity vectors
3 - particles & vectors

*/

GMODE = 0

/* Particles configuration. At the moment you have 4 posiblities (write it always between "PARTICLES:" and "ENDPAR."):

a) PAR BOX x1,y1,x2,y2,dens,u0,v0 (int,int,int,int,float,float,float)
b) PAR BALL x,y,r,dens,u0,v0 (int,int,int,float,float,float)
c) PAR !BOX x1,y1,x2,y2,dens,u0,v0 (int,int,int,int,float,float,float)
d) PAR !BALL x,y,r,dens,u0,v0 (int,int,int,float,float,float)

ad a)

x1,y1,x2,y2	- screen coordinates. Remember that:

	- x1<x2 and y1<y2
	- x1,x2<WIDTH and y1,y2<HEIGHT

dens		- density of particles per pixel. Like dens=1 mean than there is one particle per pixel, dens = 0.1 mean there are 10 particles per screen pixel.

u0,v0 - beginning x and y direction velocities

*/


PARTICLES:
PAR BOX 1 1 80 130 1 0.0 0.0
PAR BOX 80 1 160 80 1 0.0 0.0
PAR BOX 160 1 240 40 1 0.0 0.0
PAR BOX 240 1 320 180 1 0.0 0.0
ENDPAR.


/*
  "fluid" will take here a cells coordinates for boundaries. Cells
  specify only one closed curve of boundaries. Remember - boundary
  MUST be specified as free slip or no slip boundary - rest as you want.
  You can use 5 types of boundaries.

  FRSLP        -       free slip cell
  NOSLP        -       no slip cell

  i,j are cartesian coordinates of cell (i=(1..nx), j=(1..ny))


You specify always closed curve (really? when you will do 2,3 option files - it will be very easy to use). Anyway you specify points which will be linked by curve. Remember you use [NX x NY] values, becouse you specify bounaries on cells, not on screen. You can use "NX", "NY" values - that is local variable.

*/

/* i j type */


 
BNDCELLS:

 1   1            FRSLP
 NX  1            FRSLP
 NX  NY           FRSLP

 48  NY           FRSLP
 48  7            FRSLP
 46  7            FRSLP
 46  NY           FRSLP
 
 32  NY           FRSLP
 32  7            FRSLP
 30  7            FRSLP
 30  NY           FRSLP
 
 16  NY           FRSLP
 16  7            FRSLP
 14  7            FRSLP
 14 NY            FRSLP

 1   NY           FRSLP
 1   1            FRSLP

ENDBND.


That's All. That and other examples of .opt files in opt/ drawer.

If you do something email me i'm very interesting (i wanna still develop my program).

Maciej Matyka

ul. Kielczowska 137/10
51-315 Wroclaw
Poland

mailto://maq@panoramix.ift.uni.wroc.pl
http://panoramix.ift.uni.wroc.pl/~maq


