Skip navigation links
(Wind-US Documentation Home Page) (Wind-US User's Guide) (GMAN User's Guide) (MADCAP User's Guide) (CFPOST User's Guide) (Wind-US Utilities) (Common File User's Guide) (Wind-US Installation Guide) (Wind-US Developer's Reference) (Guidelines Documents)

(b4wind User's Guide) (Converting Files) (Computing Initial Conditions) (Interpolation) (Computing the Reynolds Number) (Preparing NPARC or XAIR Namelists) (Installation and Execution) (Conclusions) (Computing the Mach Number From the Area Ratio) (Trilinear Interpolation)

Converting Files

b4wind can convert from PLOT3D, NPARC or Common File files to PLOT3D, NPARC or Common File files. You can convert the boundary conditions from an NPARC namelist to a Common File grid file. Descriptions of all of these files follow.

PLOT3D

PLOT3D is one of the oldest formats for CFD data and is widely used. A PLOT3D file format is defined for either a grid or a solution. It can be written in a single-zone format or multizone. The files can be either 2D or 3D and can be written in binary, unformatted or formatted. 3D Files can be written whole or by planes and a grid file can be iblanked or not. You must know all of this information before you can read a file.

Note that 3D PLOT3D files can be converted to 2D files. When this is done then for each block the data for the k index, KMAX/2 + 1 is used. Only X and Y are written for grid files. For solution files it is assumed there the standard 5 variables are in the solution and only RHO, RHOU, RHOV and E are written.

Only single-zoned geometries can be written in the single-zone format; however single-zoned geometries can also be written in the multizone format which is the preferred format. 3D geometries can be written out by planes, that is, a separate record for each IJ plane, but the preferred format is one zone per record. Binary files must be read and written with C programs. Formatted and unformatted files are read and written in FORTRAN with the asterisk and no format, respectively. Unformatted format is preferred; however sometimes it is convenient to write a file as formatted so that it can be examined.

Grid files may be iblanked. An IBLANK array is defined for each zone of the geometry and is dimensioned identically to the zone. The value is defined as zero in all no-flow regions. At an interface it is defined as the negative of the zone number it interfaces with. It is two at solid walls and everywhere else (interior flow regions) it is one.

The only extra flow data kept in a PLOT3D solution file other than the flow variables are the EMINF, ALPHA, RE and TIME specified for each block. EMINF is the freestream Mach Number, ALPHA is the angle of attack, RE is the Reynolds number, and TIME is a time.

The various formats follow.

If multizoned (skip if single-zoned)

   READ NZONES (the number of zones)

For all files read the dimensions (IDIM, JDIM, [KDIM]) of the zones into the array IDIMS.

   IF (NDIM.EQ.3)
      N=3*NZONES
   ELSE
      N=2*NZONES
   ENDIF
   READ (IDIMS(J), J=1,N)

For each zone JZONE:

   If a solution file (skip if grid file)
      READ EMINF, ALPHA, RE, TIME

   If by planes (must be a 3D file):
      If a grid file:
         If iblanked:
            DO K=1,KDIM
               READ
                  ((     X(I,J,K), I=1,IDIM), J=1,JDIM),
                  ((     Y(I,J,K), I=1,IDIM), J=1,JDIM),
                  ((     Z(I,J,K), I=1,IDIM), J=1,JDIM),
                  ((IBLANK(I,J,K), I=1,IDIM), J=1,JDIM)
            END DO
         If not iblanked:
            DO K=1,KDIM
               READ
                  ((X(I,J,K), I=1,IDIM), J=1,JDIM),
                  ((Y(I,J,K), I=1,IDIM), J=1,JDIM),
                  ((Z(I,J,K), I=1,IDIM), J=1,JDIM)
            END DO
      If a solution file:
         DO K=1,KDIM
            READ
               (( RHO(I,J,K), I=1,IDIM), J=1,JDIM),
               ((RHOU(I,J,K), I=1,IDIM), J=1,JDIM),
               ((RHOV(I,J,K), I=1,IDIM), J=1,JDIM),
               ((RHOW(I,J,K), I=1,IDIM), J=1,JDIM),
               ((   E(I,J,K), I=1,IDIM), J=1,JDIM)
         END DO

   If by zones:
      If a grid file:
         If iblanked:
            If 2D:
               READ
                  ((     X(I,J), I=1,IDIM), J=1,JDIM),
                  ((     Y(I,J), I=1,IDIM), J=1,JDIM),
                  ((IBLANK(I,J), I=1,IDIM), J=1,JDIM)
            If 3D:
               READ
                  (((     X(I,J,K), I=1,IDIM), J=1,JDIM), K=1,KDIM),
                  (((     Y(I,J,K), I=1,IDIM), J=1,JDIM), K=1,KDIM),
                  (((     Z(I,J,K), I=1,IDIM), J=1,JDIM), K=1,KDIM),
                  (((IBLANK(I,J,K), I=1,IDIM), J=1,JDIM), K=1,KDIM)
         If not iblanked:
            If 2D:
               READ
                  ((X(I,J), I=1,IDIM), J=1,JDIM),
                  ((Y(I,J), I=1,IDIM), J=1,JDIM)
            If 3D:
               READ
                  (((X(I,J,K), I=1,IDIM), J=1,JDIM), K=1,KDIM),
                  (((Y(I,J,K), I=1,IDIM), J=1,JDIM), K=1,KDIM),
                  (((Z(I,J,K), I=1,IDIM), J=1,JDIM), K=1,KDIM)
      If a solution file:
         If 2D:
            READ
               (( RHO(I,J), I=1,IDIM), J=1,JDIM),
               ((RHOU(I,J), I=1,IDIM), J=1,JDIM),
               ((RHOV(I,J), I=1,IDIM), J=1,JDIM),
               ((   E(I,J), I=1,IDIM), J=1,JDIM)
         If 3D:
            READ
               (((   RHO(I,J,K), I=1,IDIM), J=1,JDIM), K=1,KDIM),
               (((  RHOU(I,J,K), I=1,IDIM), J=1,JDIM), K=1,KDIM),
               (((  RHOV(I,J,K), I=1,IDIM), J=1,JDIM), K=1,KDIM),
               (((  RHOW(I,J,K), I=1,IDIM), J=1,JDIM), K=1,KDIM),
               (((     E(I,J,K), I=1,IDIM), J=1,JDIM), K=1,KDIM)

This completes the zone loop and after the data for each zone has been read, it is the end of the file.

NPARC

NPARC restart files (which are identical to the initial conditions file) keep the grid and solution for a geometry on one file. They are written unformatted. The only other information on an NPARC file other than the usual geometry and flow variables is GAMMA, the ratio of specific heats, and NC, the step number. All other data is provided by namelist. The only thing you must know to read an NPARC restart file is whether it is 2D or 3D.

The format follows.

   READ NC, GAMMA

For each zone:

   If 2D:
      READ IDIM, JDIM
      READ
         ((X(I,J), I=1,IDIM), J=1,JDIM),
         ((Y(I,J), I=1,IDIM), J=1,JDIM)
      READ
         (( RHO(I,J), I=1,IDIM), J=1,JDIM),
         ((RHOU(I,J), I=1,IDIM), J=1,JDIM),
         ((RHOV(I,J), I=1,IDIM), J=1,JDIM),
         ((   E(I,J), I=1,IDIM), J=1,JDIM)

   If 3D:
      READ IDIM, JDIM, KDIM
      READ
         (((X(I,J,K), I=1,IDIM), J=1,JDIM), K=1,KDIM),
         (((Y(I,J,K), I=1,IDIM), J=1,JDIM), K=1,KDIM),
         (((Z(I,J,K), I=1,IDIM), J=1,JDIM), K=1,KDIM)
      READ
         (((   RHO(I,J,K), I=1,IDIM), J=1,JDIM), K=1,KDIM),
         (((  RHOU(I,J,K), I=1,IDIM), J=1,JDIM), K=1,KDIM),
         (((  RHOV(I,J,K), I=1,IDIM), J=1,JDIM), K=1,KDIM),
         (((  RHOW(I,J,K), I=1,IDIM), J=1,JDIM), K=1,KDIM),
         (((     E(I,J,K), I=1,IDIM), J=1,JDIM), K=1,KDIM)

This completes the zone loop and after the data for each zone has been read, it is the end of the file.

Wind-US

Wind-US uses the Common File Format (CFF). Using CFF, data can be written with one machine and read by another. If needed a file can be modified instead of having to be completely rewritten. The data has a tree-structured topology with a root node which has subnodes which has subnodes and so on. Each node contains integer, real, and character data plus pointers to variables and to its subnodes. The units for the variables of a node can be specified along with reference and scaling data. There are routines in the CFF library to provide unit conversions. Detailed documentation can be found in the Common File User's Guide.

The 2D and 3D files for Wind-US are identical. For 2D, KDIM is one and the variables z and rho*w must be present, but should be all zeros. Wind-US reads a grid Common File with an assumed suffix of .cgd and reads a solution file with a suffix of .cfl. The structures of these files as recognized by b4wind are as follows where IPAR, FPAR and CPAR are the integer, real and character (up to 80 characters per element) data, respectively for each node.

The root node of a .cgd file contains:

    IPAR(1)   IMAX (the maximum IDIM over all the zones)
IPAR(2) JMAX (the maximum JDIM over all the zones)
IPAR(3) KMAX (the maximum KDIM over all the zones)
IPAR(4) NZONES (the number of zones)
IPAR(5) MXPTS (the maximum total number of points in any one zone)

FPAR(1) XMIN (the minimum X over all the zones)
FPAR(2) XMAX (the maximum X over all the zones)
FPAR(3) YMIN (the minimum Y over all the zones)
FPAR(4) YMAX (the maximum Y over all the zones)
FPAR(5) ZMIN (the minimum Z over all the zones)
FPAR(6) ZMAX (the maximum Z over all the zones)

CPAR(1) Main Title
CPAR(2) Subtitle

A pointer to a subnode for each zone.

This completes the contents of the root node of a grid (.cgd) file.

If ZONNAM is a character variable, then the JZONE'th zone name can be created in FORTRAN by

   WRITE (ZONNAM, '(A4, I4)') 'ZONE', JZONE

Each zone node of a grid file contains the following:

    IPAR(1)   IDIM (the I-dimension of the zone)
IPAR(2) JDIM (the J-dimension of the zone)
IPAR(3) KDIM (the K-dimension of the zone)
IPAR(4) NFRGPT (the number of fringe points)

IPAR(20) Boundary type for a I = 1 boundary.
IPAR(21) Boundary type for a I = IDIM boundary.
IPAR(22) Boundary type for a J = 1 boundary.
IPAR(23) Boundary type for a J = JDIM boundary.
IPAR(24) Boundary type for a K = 1 boundary.
IPAR(25) Boundary type for a K = KDIM boundary.

A pointer to the variables, x, y, z, all having dimensions IDIM, JDIM KDIM.

Optionally, there may be a pointer to IBLANK, having dimensions IDIM, JDIM, KDIM. Note that IBLANK for Wind-US is defined differently than for PLOT3D. For Wind-US, IBLANK is 1 for normal points, -(label+1) for hole points and (label+1) for fringe points. The label is a positive number used in GMAN (the Grid MANagement program, a utility program of Wind-US) to label holes and boundaries.

If NFRGPT > 0 then there must be a pointer to a subnode with the name "FRNG BND".

This completes the contents of a grid file zone node.

If a zone node of a grid file has a IPAR(3) = NFRGPT greater than zero then it must have a pointer to a subnode named "FRNG BND". This subnode contains pointers to the following variables, all dimensioned by NFRGPT.

    IFRG   Specifies the I-index of a grid point in the zone
JFRG Specifies the J-index of a grid point in the zone
KFRG Specifies the K-index of a grid point in the zone
ZHOLE 1 if IFRG = 1
2 if IFRG = IDIM
3 if JRFG = 1
4 if JRFG = JDIM
5 if KFRG = 1
6 if KFRG = KDIM
8 if the grid point is in the interior
NZN If > 0, specifies a zone the grid point is coupled to.
If ≤ 0, specifies a boundary condition.

If NZN is less than or equal to zero, then I1, I2 and I3 are all 0 and F1, F2 and F3 are all 0.0. If NZN is greater than zero, then

    I1   Specifies the I-index of a node in zone NZN
I2 Specifies the J-index of a node in zone NZN
I3 Specifies the K-index of a node in zone NZN
F1 The first parameter of the trilinear interpolation of the (I1,I2,I3)'th element in zone NZN of the node (IFRG,JFRG,KFRG) in the current zone.
F2 The second parameter of the trilinear interpolation of the (I1,I2,I3)'th element in zone NZN of the node (IFRG,JFRG,KFRG) in the current zone.
F3 The third parameter of the trilinear interpolation of the (I1,I2,I3)'th element in zone NZN of the node (IFRG,JFRG,KFRG) in the current zone.

This completes the contents of the subnode "FRNG BND".

The root node of a .cfl file contains:

    IPAR(1)   IMAX (the maximum IDIM over all the zones)
IPAR(2) JMAX (the maximum JDIM over all the zones)
IPAR(3) KMAX (the maximum KDIM over all the zones)
IPAR(4) NZONES (the number of zones)
IPAR(5) MXPTS (the maximum total number of points in any one zone)

FPAR(1) PTINF (freestream stagnation pressure)
FPAR(2) TTINF (freestream stagnation temperature)
FPAR(3) ATINF (freestream stagnation speed of sound)
FPAR(4) RTINF (freestream stagnation density)
FPAR(5) EMINF (freestream Mach number)
FPAR(6) PSINF (freestream static pressure)
FPAR(7) TSINF (freestream static temperature)
FPAR(8) ASINF (freestream static speed of sound)
FPAR(9) ASINF (freestream static density)
FPAR(12) REFVIS (reference viscosity)
FPAR(13) RE (Reynolds number)
FPAR(14) ALPHA (angle of attack)
FPAR(15) BETA (angle of yaw)
FPAR(25) RG (the gas constant)
FPAR(26) GAMMA (the ratio of specific heats)
FPAR(27) PR (Prandtl number)
FPAR(28) PRT (turbulent Prandtl number)

CPAR(1) Main Title
CPAR(2) Subtitle

A pointer to a subnode for each zone.

This completes the contents of the root node of a solution (.cfl) file.

Each zone node of a solution file contains the following:

    IPAR(1)   IDIM (the I-dimension of the zone)
IPAR(2) JDIM (the J-dimension of the zone)
IPAR(3) KDIM (the K-dimension of the zone)
IPAR(3) NFRGPT (the number of fringe points)

Each zone node of a solution file also contains pointers to the following variables all having dimensions IDIM, JDIM, KDIM.

    rho   density
rho*u x-component of momentum per unit volume
rho*v y-component of momentum per unit volume
rho*w z-component of momentum per unit volume
rho*e0 stagnation energy per unit volume
p pressure

Note that it necessary to include the pressure or else the file will bomb in CFPOST (a utility program for Wind-US for post processing). This completes the contents of a solution file zone node.

Boundary Conditions

B4wind can read an NPARC namelist and will interpret the boundary conditions as much as possible into Wind-US Chimera boundary conditions. To do this, in each grid zone node (described in the previous section), it sets IPAR(4), NFRGPT, to the total number of boundary points specified by the NPARC namelist for that zone. In the same grid zone node it sets elements 20 through 25 of IPAR to 18 which specifies a Chimera boundary. It then defines the best it can all of the variables of the "FRNG BND" subnode; that is IFRG, JFRG, KFRG, ZHOLE, NZN, I1, I2, I3, F1, F2 and F3. In particular NZN is translated by the following table:

NPARC   Wind-US
< 0 (FIXED) −17 (fixed)
0 (FREE) −3 (inflow/outflow)
2 (SUBSONIC OUTFLOW) −8 (internal outflow)
3 (EXTRAPOLATION) −3 (inflow/outflow)
7 (FREESTREAM) −3 (inflow/outflow)
50 (SLIP WALL) −9 (inviscid wall)
51 (AXIS OF SYMMETRY) −11 (singular axis)
52 (ALTERNATE SLIP WALL) −9 (inviscid wall)
60 or 61 (NO-SLIP ADIABATIC) −4 (wall)
77 (ABUTTING-CONTIGUOUS) Coupling Zone Number
81, 82 or 83 (POLE SINGULARITY) −11 (singular axis)
XX (everything else) 0 (Undefined)

F1, F2 and F3 are set to zero. They can be determined in GMAN along with the other undefined boundary conditions.

Execution of the GUI

If you choose "Convert files" from the main menu of b4wind, then you will be presented with the read menu of the conversion program:

When you click an option, the help box at the bottom of the screen describes the option. The first three options are to read a file in the respective format presenting to you all of the available options. The fourth option, NAMELIST, reads an NPARC namelist and converts the boundary conditions to Wind-US boundary conditions. The fifth option, Parms, can be used to set units and reference conditions which can be used to write a Common File solution file. The definition of these parameters are described in the section Dimensional Units and Reference Values. Choose the desired option and click the "Ok" button. The GUI then calls the appropriate program to read the desired data and writes it to a temporary file (which incidentally is in Common File Format). Note that the desired data is either grid data, solution data, namelist boundary condition data, or unit and reference value data. The buttons on the right will become active as the data is obtained and can be used to keep track of what has been read in as well as to perform the indicated deletion.

When you have finished reading all of the desired data then click the "Go to the Write Menu" button and you will be able to write either a Plot3d file, an NPARC restart file, or a Common File. The GUI calls on the appropriate program which will read the data from the temporary file and write it in the proper format.


Last updated 2 May 2003