

                Preparation of initial conditions
                ---------------------------------
                  and Visualisation of results
                  -----------------------------




Copyright (C) 1997 D.H. Rothman and S. Zaleski. 

Covered by the GNU General Public License, see the file ../README.



I.  Preparation of initial conditions

For the Fhp_... codes, 
the routine Solid.c prepares initial conditions. 
You need to edit the lines

#define NX 64
#define NY 64
#define WALL_THICKNESS 1
#define NR_OF_GRAINS 0
#define MINIMUM_GRAIN_SIZE 8
#define GRAIN_SIZE_DISPERSION 6

to define the size of the lattice, edit NX and NY. Both numbers
should be multiples of the word length on your machine (32 on most machines,
64 on Cray).  NX should always be at least 64. 

The code puts walls parallel to the x direction of thicknes defined by 
WALL_THICKNESS.  A value of 1 is enough for non interacting codes.

To create a model porous medium, a number of grains are put at random. 
In the example above, the number of grains is set to zero to simulate
a porous medium. 

To prepare the initial conditions, 

1. adjust the parameters, 

2.  compile Solid.
The makefile Makefile provides a simple way to do this. Try to type

 make Solid

If you do not have such a workstation, you may need to edit Makefile 
to fit your particular system.

2.  then run 

 Solid

This creates two files , solidm and solid. 
The file solid contains information about the location of solid sites in 
the following way: each solid site is coded by a byte of value 1, 
and each free site has value 0. 
The file solidm is identical, except that solid sites have value 128. 
This second file is intend to be visualized easily by programs that 
display images in raster format such as xmov. 
(xmov is not presently availble for FTP distribution) 
Do

  xmov in=solidm n1=NX n2=NY

and click in the xmov window  (Not all machines have xmov) . 

Another to prepare the initial conditions is to write yourself the solid 
file. Some X tools such as "bitmap" allow to mark pixels easily. 

II. Visualisation and processing

A. Movies

All programs create files, such as dumpfile (for Fhp_...) 
and ilgout (for ilg) that are intended to visualise color and density
using programs that display images in raster format such as xmov.
(xmov is not presently availble for FTP distribution) 

B. Velocity fields

An example of how to process the data in dumpfile to obtain
visualisation is contained in Readout.c . 
Readout performs a spatial and temporal averaging 
of the results in dumpfile and outputs a velocity field in
floating point, fortran format. 

You should edit Readout.c to adjust the following lines:

-----------------------------------------------
  / * If you use 6 velocity coding, then  
   keep this line */

  #include "macros.h"

  / * If you use 7 velocity coding, then  
   uncomment  the line  below and comment the line above */

  /*
  #include "macros_7.h"
  */ 

  #define NX 64
  #define NY 64

  #define BSZ 8
  #define TBSZ 1
-----------------------------------------------


BSZ is the blocksize of the spatial averaging performed by readout. 
TBSZ the lenght of the time averaging. 

Readout writes a file called "floatfile" containing the 
location of the solid sites and the velocity fields every
TPRINT*TBSZ steps. 

This file should then be read by your graphics
program. We use IDL, and an example of the use of idl 
to plot the output is given in the file lat.pro . 

To see the results, type 

Readout

then 

idl

at the idl prompt, type

IDL>  lat, NX, NY


