SCK(5) File Formats Manual SCK(5)

sckStar Correlated K file format

sck is a binary file format for storing the correlated K of a gas mixture. The volumetric mesh to which the CKs are attached is described there but must be defined in a separated file via, for example, the smsh(5) file format.

A sck file begins with a header that describes the layout of the data. Then, the spectral bands on which the CKs have been evaluated are listed. Finally, the entire list of radiative coefficients is stored.

The header consists of 3 64-bit integers. The first integer is a power of two (usually 4096) that defines the pagesize in bytes on which the radiative coefficients are aligned. The remaining two integers store the number of bands and the number of nodes, that is, the number of radiative coefficients per band or per quadrature point, respectively, which is actually the number of nodes in the volumetric mesh to which these coefficients are attached.

After the header comes the list of spectral bands sorted in ascending order relative to their interval. Each spectral band begins with 2 double-precision floating-point numbers that represent the lower and upper limits of the band in nanometers. Another 64-bit integer then gives the number of quadrature points in the band. Finally, the weights of the quadrature points are stored in a list of floating numbers with double precision.

Fill bytes follow the list of spectral bands to ensure alignment of the first radiative coefficients on pagesize. Then, for each band, the diffusion coefficients are listed before the list of absorption coefficients for each quadrature point. Each list of radiative coefficients is followed by a padding, which is a list of bytes that provides memory alignment of the following data to pagesize. Bands and quadrature points are sorted according to the order in which they were previously declared.

Data are encoded with respect to the little endian bytes ordering, i.e. least significant bytes are stored first.

The file format is as follows:

sck ::= pagesize⟩ ⟨#bands⟩ ⟨#nodes
bands
padding
rad-coefs
 
pagesize ::= uint64_t
#bands ::= uint64_t
#nodes ::= uint64_t
padding ::= [int8_t ...] # Ensure alignment on pagesize
 
bands ::= band...
band ::= band-low⟩ ⟨band-upp⟩ ⟨#quad-pts⟩ ⟨quad-pts
band-low ::= double # Inclusive bound in nm
band-upp ::= double # Exclusive bound in nm
 
#quad-pts ::= uint64_t
quad-pts ::= quad-weight...
quad-weight ::= double
 
rad-coefs ::= per-band-k...
per-band-k ::= ks-list⟩ ⟨per-quad-pt-ka
per-quad-pt-ka ::= ka-list...
ka-list ::= ka...padding
ks-list ::= ks...padding
ka ::= float # In m^-1
ks ::= float # In m^-1

smsh(5)

July 28, 2023 UNIX