next up previous contents
Next: User's Guide Up: Random Flow Generation Procedure Previous: Method   Contents

Implementation

Figure 1 shows the main flow-chart of the algorithm. It consists of two functions: (1) spectral generator ($genspec$) and vector-field generator ($genvec$). User supplies the input data in form of the size of a spectral sample (integer parameter, $nspec$), correlation tensor for the vector field and time scale. In case of a turbulent flow modeling this should be the velocity correlation tensor, $\overline{u_iu_j}$ and turbulent time scale, $\tau$. In the case of homogeneous turbulence the correlation tensor and time-scale are constant and are suppled as arguments to the $genspec$ function (link A in the figure). In the case of an inhomogeneous turbulence these parameters are supplied to the $genvec$ function (link B in the figure). Both cases are implemented in the two different versions of the algorithm (see Sec.3.1). Most of the routines are written in a C language with some auxiliary Fortran routines imported from the Netlib library (www.netlib.org).

Figure 1: Application programming interface for RFG algorithm
\fbox{\includegraphics[height=3in, width=3in]{api.eps}}

User input parameters to the algorithm are shown in Fig.1 and include: $nspec$ - number of spectral modes, 6-dimensional array of velocity correlations, $UU$ (for anisotropic inhomogeneous case: $rfg0$), turbulence time scale, $TURB\_TIME$, turbulent length scale $TURB\_LENGTH$ (for isotropic homogeneous case), and space-time coordinates, $x,t$. At the beginning there should be only one call to $genspec$ function, which initializes the spectral data. These consists of four arrays: $Omega$, $U1$, $U2$, and $K$. While the first one is the array of scalar values, the other three are all arrays of 3D vectors. These four arrays are global variables and after they are initialized by $genspec$ they are repeatedly used by the $genvec$ function to generate the random vector field. In the homogeneous isotropic version of the algorithm ($rfg0$) the user supplies the $nspec$, $TURPB\_TIME$, and $TURB_LENGHT$ parameters to $genspec$ function, and then repeatedly calls the $genvel$ functions for different spatial locations and time. In the inhomogeneous anisotropic case ($rfg1$), the user calls $genspec$ with only one parameter, defining the size of the spectral sample ($nspec$), and then repeatedly calls $genvec$ with for different $x,t$, as well as different values of velocity correlation tensor and time scale. In this way one provides spacial inhomogeneity of the generated vector field. The anisotropy is determined by the correlation tensor.

The complete listing of the main RFG routine is given in the Appendix.


next up previous contents
Next: User's Guide Up: Random Flow Generation Procedure Previous: Method   Contents
2004-08-27