-
Notifications
You must be signed in to change notification settings - Fork 631
Working with VTK Files
The Visualization Toolkit (VTK) establishes a data format which is designed for use in high performance computing (HPC) applications. Detailed documentation of data format can be found on the website at VTK File Formats. This page provides a high level summary of the data format and a quick start guide to working with VTK files generated by FDS.
The VTK framework uses separate files and pointers to organize the data. The pointer files are small and contain the information required by the visualization to identify which files have sections of data. This allows individual computing processes to identify which files are needed to fulfill a data request by the software without having to read the files containing the data. By convention, the pointer files (or parallel file formats) include the letter p at the front of the extension (e.g., pvtu indicates a parallel vtu file). An example pvtu file for boundary data is shown below.
<?xml version="1.0"?>
<VTKFile type="PUnstructuredGrid" version="1.0" byte_order="LittleEndian">
<PUnstructuredGrid GhostLevel="0">
<PPoints>
<PDataArray type="Float32" NumberOfComponents="3" NAME="POINTS"/>
</PPoints>
<PPointData>
<PDataArray type="Float32" Name="water drops AMPUA" NumberOfComponents="1"/>
<PDataArray type="Float32" Name="WALL TEMPERATURE" NumberOfComponents="1"/>
<PDataArray type="Float32" Name="HRRPUA" NumberOfComponents="1"/>
</PPointData>
<PCellData>
</PCellData>
<Piece Source="storage_BNDF_1_0000000112.vtu"/>
<Piece Source="storage_BNDF_2_0000000112.vtu"/>
<Piece Source="storage_BNDF_3_0000000112.vtu"/>
<Piece Source="storage_BNDF_4_0000000112.vtu"/>
<Piece Source="storage_BNDF_5_0000000112.vtu"/>
<Piece Source="storage_BNDF_6_0000000112.vtu"/>
<Piece Source="storage_BNDF_7_0000000112.vtu"/>
<Piece Source="storage_BNDF_8_0000000112.vtu"/>
</PUnstructuredGrid>
</VTKFile>
The example shows a parallel VTK file for boundary data. Each block contains a pointer to the type of data stored within the individual pieces linked at the bottom of the file. The data files contain three quantities "water drops AMPUA", "WALL TEMPERATURE", and "HRRPUA" stored at the nodes (indicated by the definition within the <PPointData>
block) and no data stored at the cell-centers (indicated by the blank <PCellData>
block). FDS outputs a separate piece for each mesh at each time step.
The individual data files store the data output by FDS. For a detailed discussion of how the data is stored, see the VTK File Formats.
Paraview Paraview is a visualization software which is designed for use with HPC systems. While a user can import the VTK files generated into Paraview manually, the default colormaps and settings are not tuned to fire smoke simulations. FDS generates a state file which can be used to import data to Paraview and set these default parameters. The state file is a python script which searches the result directory for available data to add to the view. The default configuration imports all data generated by FDS and sets the geometry, SMOKE3D fire and smoke, and particles to visible.
This section will demonstrate a basic example to generate VTK data with FDS and visualize the results in Paraview.
- Installed FDS: Examples/VTK/storage.fds
- Source FDS: Verification/VTK/storage.fds
- Add "WRITE_VTK=T" to the &DUMP namelist. This tells FDS to generate VTK data.
- Add "RESULTS_DIR='storage_results'" to the &DUMP namelist. This tells FDS to locate all the VTK and binary data in the subdirectory, "storage_results".
- The namelist should now be:
&DUMP NFRAMES=100, DT_CTRL=1., DT_DEVC=10., DT_HRR=10., SIG_FIGS=4, WRITE_VTK=T, RESULTS_DIR='storage_results' /
- Navigate to the directory with the input file
- Run fds with the command:
mpiexec -np 8 fds storage.fds
- Open Paraview
- Click File->Load State
- Select the "storage_paraview.py" file and click ok
- Manipulate the viewport by using the preset views or clicking in the window and dragging the mouse.
- Click play to start the animation of the fire, smoke, and sprinkler droplets.
- After sprinklers activate, the view should be similar to the following.
- Hide the fire, smoke, and particles by clicking the open "eye" icon next to these two datasets in the pipeline browser
- Show the slice at a z-axis height of 7.4m by clicking the closed "eye" icon in the pipeline browser.
- Click on the z-axis slice in the pipeline browser and the properties window will appear.
- Click the drop down icon under "Coloring" and change it to "TEMPERATURE".
- Use a similar approach to activate the "3D Slice Extraction" in the pipeline browser. Click on "3D Slice Extraction" in the pipeline browser and a plane visualization will appear in the viewport which can be used to translate and rotate extracted plane from the 3D data.
- Move the plane to Origin: -3, 0, 4.5 with Normal 1, 0, 0 and click apply.
- Click on the drop-down icon under "Coloring" and change it to "TEMPERATURE".
- Deselect the "3D Slice Extraction" from the pipeline browser by clicking any of the other datasets or the "builtin" root tree at the top. This will hide the plane which was used to move the slice extraction plane.
- Click the run icon to see the animation of slice data.
- Hide the slice data from the previous step by clicking the "eye" icon for each of the slice datasets in the pipeline browser.
- Click the "eye" icon next to the boundary data and select coloring by "HRRPUA". You may see overlap between the geometry and boundary data. This can be removed by hiding the geometry data.