Fire Dynamic Simulator to EnSight Result File

Fire Dynamic Simulator (FDS) from NIST outputs to the PLOT3D format.
The filename that FDS writes follows the convention : CASENAME_****_**.q there the * denotes the time. The first four are seconds, the last two (after the underscore) are hundreths of seconds.
When exporting, the user specifies the seconds between file dumps. For example, the user specifies every 4 seconds of elapsed time. Unfortunately, FDS is a dynamic timestep solver, which adjusts the timestep depending upon courrant number. FDS will output to the PLOT3D format at the "nearest" timestep to the requested increment. Therefore, it might output at 4.01 seconds, 8.04, or 12.00 seconds. It depends upon when the nearest timestep iteration is.

This completely throws off our EnSight Result File specification, expecting a constant offset.

Therefore, I have created the following script (for unix), which does two things:
1. Given the .q files in any directory, it will create an EnSight Results File, based on the filename conventions of FDS. This new file is called "ensight-fds.res"
2. It will create a soft link from the original .q files to a sequenced file which has the appropriate name index. There will be soft links from filenames "ensight-fds_<NUMBER>.q" to the FDS original filename "casename_****_**.q"

Both of these mean that you do not have to move the filenames of the .q files around to a new name, nor do you have to manually write the EnSight Result (.res) file.

It should work on any number of files, given the standard FDS filename scheme (casename_****_**.q). All you have to do is execute the script "./es-fds.csh"

The contents of es-fds.csh are as follows:
# Routine to list the current .q files, and create an EnSight Result file
# Assumptions:
# These are FDS Plot3D files, with <casename>_seconds_hundreths.q filename convention
# Assumed the default variables as Temperature, Heat Release Rate and Velocity
# Run on Linux/Unix
# This script creates the EnSight Result file, and creates sequential file links to
# the original PLOT3D .q files (which may not be offset by constant integer)

# Kevin Colburn
# June 2008
# To use : simply run ./es-fds.csh
# Step 1 : List the files with .q ready for parsing filenames
# pull off the suffix and ready the filenames for parsing
echo " Creating ensight-fds.res file ..."
\ls *.q | awk -F.q '{print $1}' > list.tmp

# Step 2 : Create the EnSight Case File
# Construct the EnSight Result file
echo "2 1 0" > ensight-fds.res
wc -l list.tmp | awk '{print $1}' >> ensight-fds.res
cat list.tmp | awk -F"_" 'a=NF, b=NF-1 {print $b "." $a}' >> ensight-fds.res
echo "1 1" >> ensight-fds.res
echo "ensight-fds_*.q S 1 Temperature" >> ensight-fds.res
echo "ensight-fds_*.q S 5 Heat_Release_Rate" >> ensight-fds.res
echo "ensight-fds_*.q S 2 3 4 Velocity" >> ensight-fds.res

# Step 3: Construct a temporary file to create links from the original filename
# to the sequenced file. These can be removed after running EnSight if need be.
cat list.tmp | awk '{print "ln -s " $0 ".q ensight-fds_"NR".q"}' > make-link.csh
chmod a+x make-link.csh

# Cleanup
\rm -f list.tmp
\rm -f make-link.csh

echo "Run EnSight, using your .xyz file and ensight-fds.res file"

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request