Description of the BG/L Driventurbulence dataset in HDF5 format

A converter has been written that can take the direct i/o output of the driven turbulence dataset (which contains 32768 files all in big endian native binary format) and produce a single hdf5 file that more or less conforms to the Flash3 data format. What follows is a description of the dataset and an example with corresponding code that extracts a single cell thick plane in x and z from the entire domain volume.

First here is a list of the datasets with their corresponding dimensionality:

  • "integer scalars" A commpund data type of a char and an integer. This contains the following simulation information: nxb,nyb and nzb , which is the number of cells in each dimension for a block, in the case of this data this is nxb=29,nyb=29,nzb=29 , globalnumblocks which is 32768, nstep which is the time step of the simulation and globalnumparticles which is 16777216 in this case. Functions in the flashhdf5 class that read this dataset are GetNumberOfBlocks, GetCellDimensions and GetNumberOfDimensions

  • "real scalars" A commpund data type of a char and a real (double precision). This contains the following simulation information: time which is the current simulation time, and dt which is the current simulation timestep.

  • "coordinates" Dimension: (32768,3). The coordinates dataset contains the x,y,z location of the center of a block. The coordinates data set changes fastest in x, then y, then z. The index of a given x,y,z set of coordinates corresponds to the index of a block of scalar data in the "dens", "pres", "xvel", "yvel", "zvel" and "vort" datasets that will be described below.

  • "block size" Dimension: (32768,3). The block size data set contains 3 values that specify the length of a block in x, y and z. For this dataset since it is a uniform grid this is the same for every block: 0.03125,0.03125,0.03125.

  • "bounding box" Dimension: (32768, 3, 2). The bounding box data set contains 2 x,y,z coordinate values for the min in x and z max in y corner of a block and the max in x and z and min in y corner of a block.

    The next datasets define the oct tree as if this was an amr dataset. This was done just for convienience so that existsing tools that can process Flash3 data can immediately process this data as well.
  • "refine level" Dimensions (32768). An integer that defines the level of refinement a block is at. This is just 1 for all blocks in this case.

  • "node type" Dimensions (32768). An integer that describes whether a block is a leaf node in an amr dataset. In this dataset all blocks are leaf nodes, so again every block has a value of 1.

  • "gid" Dimensions (32768, 15). The gid dataset contains an array of 15 integers for each block index. The values of the integers are as follows index 0: a blocks neighbor to the left in X. index 1: a blocks neighbor to the right in X. index 2: a blocks neighbor below it in Y: index 3: a blocks neighbor above it in Y: index 4: a blocks neight to the "left" in Z: index 5: a blocks neighbor to the "right" in Z: The remaining indicies would describe what the parent blocks id would be and what children may be on a block if this was an amr dataset, since it isn't the rest of these indicies have a default value of -21.

    Next are the 5 scalar variable datasets. These are "dens" "pres" "xvel" "yvel" "zvel" and "vort". The dimensions of each of these datasets is (32768,29,29,29) so there are 32768 29^3 blocks. Again the index of a given block is the same in these datasets as it is in all the datasets above. In these datasets x changes fastest, then y, then z. A program is included that can extract and arbitrarily sized plane or any 3d rectangular shape.

    GET_PLANE

    The program is called get_plane.c. In get_plane you can specify what the range of blocks you want to read as well as what the slices are that you want to copy from a block. It is ran as follows:

    ./get_plane inFile outFile varName start_bx count_bx start_by count_by start_bz count_bz start_cx count_cx start_cy count_cy start_cz count_cz

    Here are three examples that would extract a single cell thick xz plane, in the middle of the domain. The fist example extracts the plane from the lower bound of the block, the second from the middle, and the third the upper bound

    #1 ./get_plane inFile outFile varName 0 32 16 1 0 32 0 29 0 1 0 29 (lower bound)

    #2 ./get_plane inFile outFile varName 0 32 16 1 0 32 0 29 15 1 0 29 (middle)

    #3 ./get_plane inFile outFile varName 0 32 16 1 0 32 0 29 28 1 0 29 (upper bound)

    To figure out which block contains a given coordinate range the following formula holds. For a block index bidx (1-32768) the coordinate range for that block in any direction is the following:

    lower_bound = ((bidx - 1) * 0.03125)
    upper_bound = ((bidx - 1) * 0.03125) + 0.03125
    inbetween = ((bidx - 1) * 0.03125) + ((0.03125/29) * N) for N = 1, 28

    Below is an image of the middle of the domain, colored by z velocity. The volume renderer cannot draw a single cell layer, so what you are seeing below is the full blocks in the middle. But they were extracted in the same way as the program above works.

    Click on the image for larger version