Appendix: Space-Time Interpolation Module

The spaceTimeInterpolation module provides users with a general capability for specifying spatially and temporally varying boundary conditions for the various boundary types. This capability is enabled by inserting the following loadModule directive into the run control file as shown below.

loadModule: spaceTimeInterpolation
{
... run control file content
}

The following sections discuss the space-time interpolation module and provide information on the run control file variables required to perform simulations with the spaceTimeInterpolation module.

Space-Time Interpolated BCs

There are currently two supported boundary condition types that can utilize space-time interpolation: inlet and noslip.

Inlet Specification

This boundary condition is enabled by loading this module and specifying the directory that contains the interpolation source files with the variable spaceTimeInterpolateFile. All inflow type boundary conditions that are assigned the flag spaceTimePrescribed will receive the interpolated values. The data in the directory consists of HDF5 files with a description file called data.info. Files in this directory are described with a format of filename:hdf5var where filename is the name of the HDF5 file in the directory and hdf5var is the internal HDF5 dataset name. The filename or dataset name may contain special # symbols which will be substituted for the time step number of the file used for temporal interpolation. If multiple consecutive # characters are used, then the number will be padded to that width using leading 0 characters. The # characters can be used in either the filename or hdf5var portion of the file specifier. The data.info file contains the following variables shown in the table below.

data.info File Contents

Variable

Description

positions

The positions variable specifies the file that contains the spatial locations of the input points. Note that the positions are expected to remain fixed in time and so the # symbol is not used in this file specifier.

initialStep

The initial step is the number of the first file in the time series.

lastStep

The last step is the number of the final file in the time series.

stepIncrement

The step increment gives how much the step increases between input files.

startTime

The start time is the time associated with the initial step.

deltaTime

The delta time is the temporal increment between steps.

Pambient

The reference pressure used for the gage pressure data files.

pg

The file that describes the spatially varying gage pressure at all the points described in positions.

t

The file that describes the spatially varying temperature at all the points described in positions.

v

The file that describes the spatially varying velocity vector at all the points described in positions.

k

The file that describes the spatially varying turbulent kinetic energy at all of the points described in positions.

w

The file that describes the spatially varying turbulent specific dissipation (omega) at all the points described in positions.

fspecies

Any variable that starts with an “f” character is assumed to be a mass fraction file. If no mass fraction files are specified, then the default mixture fraction specified in the chemistry mdl file will be used.

An example of a representative data.info file is given below. The data for this example was extracted from a separate simulation using the clipSurfaces functionality. The files output from this facility using a clipFreq of 10 and run for 600 timesteps were directly used by specifying the following data.info file:

Sample data.info file for inflow boundary condition
positions: pos.0:data
initialStep: 10
lastStep: 600
stepIncrement: 10
startTime: 0
deltaTime: 1e-3
Pambient: 101325
pg: pg_sca.#:data
t: t_sca.#:data
v: v_vec.#:data
k: k_sca.#:data
w: w_sca.#:data
f_Air: fH2_sca.#:data
fH2: f_Air_sca.#:data

As a reminder, the file above as well as the data files described in this file need to be located in a directory that is provided via the run control file variable spaceTimeInterpolateFile. A sample of the required run control file variables for specifying a space-time interpolation on an inlet boundary condition is shown below.

Run control file sample for inflow boundary condition
// Boundary condition information
boundary_conditions:
<
BC_1=symmetry, BC_2=symmetry,
BC_3=subsonicInlet(spaceTimePrescribed)
>

// Data directory for subsonic inlet.
spaceTimeInterpolateFile: output/channel_SURF.xcut

The clip surfaces capability allows a user to place an arbitrary infinite cutting plane within the computational domain. At the intersection of this plane with the CFD volume mesh, data is spatially interpolated using a cloud-of-points interpolator. Data extraction for the plane is controlled during a simulation by using the variables plot_output and plot_freq.

Noslip Specification

A feature for specifying temporally interpolated temperature and/or heat flux data for an arbitrary number of noslip boundary conditions is available. Each boundary that will use this feature must be given the spaceTimeInterpolate option in the boundary condition specification. An example showing the specification for the boundary conditions is given below.

// Boundary condition information
boundary_conditions:
<
   BC_1=symmetry, BC_2=symmetry,
   BC_3=noslip(spaceTimePrescribed, Twall_dir=BC_3_Twall),
   BC_4=noslip(spaceTimePrescribed, Twall_dir=BC_4_Twall),
   // BC_4=noslip(spaceTimePrescribed, qwall_dir=BC_4_qwall)
>

For each boundary condition, the user must provide the name of a data directory using either the Twall_dir or qwall_dir option. This directory needs to contain an informational file named data.info which describes the details of the temporal interpolation process, as well as a series of hdf5 files, which contain the spatial temperature data at each time-step marker. In the example shown above, the data.info file that is present in the BC_3_Twall directory, which is used for boundary condition segment BC_3 is shown below.

Sample data.info file for noslip boundary condition with an interpolated temperature
positions: pos.0:data
initialStep: 0
lastStep: 1000
stepIncrement: 200
startTime: 0
deltaTime: 1e-3
t: t_sca.#:data

With the specification given in this file, one must also supply the corresponding hdf5 files t_sca.0, t_sca.200, t_sca.400, t_sca.600, t_sca.800 and t_sca.1000. Here, the suffix on the file names is the iteration number. In order to simplify the generation of these files, a simple translation utility called csv-to-hdf5, located in bin/spaceTimeInterpolation

A specified heat flux boundary condition can be used instead of a temperature boundary condition. In the sample run control file above, the heat flux boundary condition is specified by providing the qwall_dir option. The data.info file for the heat flux boundary condition is shown below.

Sample data.info file for noslip boundary condition with an interpolated heat flux
positions: pos.0:data
initialStep: 0
lastStep: 1000
stepIncrement: 200
startTime: 0
deltaTime: 1e-3
qwall: qwall_sca.#:data

CSV to HDF5 Utility

The csv-to-hdf5 utility is a simple utility that reads in a CSV file and writes out an hdf5 file. A sample CSV file is shown below.

#Temperature Data
x(m), y(m), z(m), 0, 2, 4, 6, 8, 10
20.0, 0.0, 0.5, 300.0, 320.0, 340.0, 360.0, 380.0, 400.0
25.0, 0.0, 0.5, 325.0, 345.0, 365.0, 385.0, 405.0, 425.0
30.0, 0.0, 0.5, 350.0, 370.0, 390.0, 410.0, 430.0, 450.0
35.0, 0.0, 0.5, 375.0, 395.0, 415.0, 435.0, 455.0, 475.0
40.0, 0.0, 0.5, 400.0, 420.0, 440.0, 460.0, 480.0, 500.0

The first line of the CSV file must contain the column headers. Where the first 3 columns should just be the x(m), y(m), z(m) entries. After those 3 column headers, must be a comma separated list of times. These are the time markers for the data that will be used to interpolate the boundary condition. The remaining lines of the csv file contain the data. The first 3 columns are the spatial coordinates of the data point, the remaining columns are the values of the data at the time markers.

The columns must be in the order x, y, z, <values>. The x, y, and z columns are the spatial coordinates of the data point, and the <values> is a comma separated set of values for the variable that is being spatio-temporally interpolated. The utility will write out a set of hdf5 files with the following naming convention: [CSV file name without extension]_sca.[iteration number]. Additionally a pos.0 file will be written out which contains the spatial coordinates of the data points.