Streamsurface Smoke Effect for Visualizing Dragon Fly CFD Data in Modern Opengl with an Emphasis on High Performance
Total Page:16
File Type:pdf, Size:1020Kb
Wright State University CORE Scholar Browse all Theses and Dissertations Theses and Dissertations 2013 Streamsurface Smoke Effect for Visualizing Dragon Fly CFD Data in Modern OpenGL with an Emphasis on High Performance Jordan Sipes Wright State University Follow this and additional works at: https://corescholar.libraries.wright.edu/etd_all Part of the Computer Engineering Commons Repository Citation Sipes, Jordan, "Streamsurface Smoke Effect for Visualizing Dragon Fly CFD Data in Modern OpenGL with an Emphasis on High Performance" (2013). Browse all Theses and Dissertations. 784. https://corescholar.libraries.wright.edu/etd_all/784 This Thesis is brought to you for free and open access by the Theses and Dissertations at CORE Scholar. It has been accepted for inclusion in Browse all Theses and Dissertations by an authorized administrator of CORE Scholar. For more information, please contact [email protected]. Streamsurface Smoke Effect for Visualizing Dragon Fly CFD Data in Modern OpenGL with an Emphasis on High Performance A thesis submitted in partial fulfillment of the requirements for the degree of Master of Science in Computer Engineering by Jordan D. Sipes B.S.M.E., Cedarville University, 2004 2013 Wright State University Wright State University SCHOOL OF GRADUATE STUDIES April 3, 2013 I HEREBY RECOMMEND THAT THE THESIS PREPARED UNDER MY SUPER- VISION BY Jordan D. Sipes ENTITLED Streamsurface Smoke Effect for Visualizing Dragon Fly CFD Data in Modern OpenGL with an Emphasis on High Performance BE ACCEPTED IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DE- GREE OF Master of Science in Computer Engineering. Thomas Wischgoll, Ph.D. Thesis Director Mateen M. Rizki, Ph.D. Chair, Department of Computer Science and Computer Engineering Committee on Final Examination Thomas Wischgoll, Ph.D. Yong Pei, Ph.D. Michael L. Raymer, Ph.D. R. William Ayres, Ph.D. Dean, School of Graduate Studies ABSTRACT Sipes, Jordan. M.S.C.E., Department of Computer Science and Engineering, Wright State Univer- sity, 2013. Streamsurface Smoke Effect for Visualizing Dragon Fly CFD Data in Modern OpenGL with an Emphasis on High Performance. Visualizing 3D, time dependent velocity vector fields is a difficult topic. Streamlines can be used to visualize 3D vector fields. A smoke effect where the streamline is faded out as time progresses can provide a better visualization of a time dependent flow. This work uses modern OpenGL to create a smoke trail effect with streamsurfaces in the dragon fly data set. Many aspects affecting performance are tested to determine the best options or approach. iii Contents 1 Introduction1 2 Related Work2 2.1 Flow Visualization Background........................2 2.2 Related Works in Flow Visualization.....................3 3 Data7 3.1 Tecplot Velocity Data.............................7 3.2 Wing Data...................................8 4 Numerical Integration 13 4.1 Euler Method................................. 13 4.2 4th Order Runge-Kutta Method........................ 14 4.3 Higher Order Runge Kutta Methods..................... 15 4.4 Error Calculations............................... 17 5 Graphics 18 5.1 OpenGL Library............................... 18 5.2 OpenGL Accumulation Buffer........................ 19 5.3 OpenGL Shaders and Frame Buffer Objects................. 20 5.3.1 OpenGL Shaders........................... 20 5.3.2 Frame Buffer Objects......................... 20 6 Results 24 6.1 Initial Solution Testing............................ 25 6.2 File Loading Comparison........................... 29 6.3 Numerical Error................................ 31 6.4 Compiler Optimization Testing........................ 34 6.5 Data Container Performance......................... 40 6.6 Rendering Comparison............................ 42 6.7 Visualization Results............................. 46 7 Future Work 58 iv Bibliography 59 A Seed Line Picking Program 63 v List of Figures 3.1 Data Mesh Size Viewed in Paraview.....................9 3.2 Initial Wing Data Rendered in Paraview................... 10 3.3 Wing Before Vertex Smoothing in Blender.................. 11 3.4 Wing After Four Passes of Vertex Smoothing in Blender.......... 12 5.1 OpenGL Pipeline from the Version 3.3 Specification............. 21 6.1 Dipol Stream Lines Traced in Paraview................... 25 6.2 Dipol Stream Lines Traced in My Solution Part 1.............. 26 6.3 Dipol Stream Lines Traced in My Solution Part 2.............. 27 6.4 Dragon Fly Stream Lines Traced in Paraview................ 28 6.5 Comparison of Error in Runge Kutta Integration Methods.......... 32 6.6 Comparison of Error, Position and Velocity Gradients............ 33 6.7 Rendering Performance on Computer F1................... 43 6.8 Rendering Performance on Computer G51.................. 44 6.9 Rendering Performance on Computer 535U3C................ 45 6.10 Eight Streamsurfaces 1............................ 47 6.11 Eight Streamsurfaces 2............................ 47 6.12 Eight Streamsurfaces 3............................ 48 6.13 Eight Streamsurfaces 4............................ 48 6.14 Streamsurface Vortex Visualization 1..................... 50 6.15 Streamsurface Vortex Visualization 2..................... 50 6.16 Streamsurface Vortex Visualization 3..................... 51 6.17 Streamsurface Vortex Visualization 4..................... 51 6.18 Streamsurface Vortex Visualization 5..................... 52 6.19 Streamsurface Vortex Visualization 6..................... 52 6.20 Streamsurface Vortex Visualization 7..................... 53 6.21 Streamsurface Vortex Visualization 8..................... 53 6.22 Streamsurface Vortex Visualization 9..................... 54 6.23 Streamsurface Vortex Visualization 10.................... 54 6.24 Streamsurface Vortex Visualization 11.................... 55 6.25 Streamsurface Vortex Visualization 12.................... 55 6.26 Streamsurface Vortex Visualization 13.................... 56 vi 6.27 Streamsurface Vortex Visualization 14.................... 56 6.28 Streamsurface Vortex Visualization 15.................... 57 6.29 Streamsurface Vortex Visualization 16.................... 57 A.1 Seed Line Picking Program Drawing a Streamline.............. 64 A.2 Seed Line Picking Program Done Drawing a Streamline.......... 65 vii List of Tables 6.1 File loading test on F1, Averages....................... 29 6.2 File loading test on F1, Standard Deviation................. 29 6.3 File loading test on 535U3C, Averages.................... 30 6.4 File loading test on 535U3C, Standard Deviation.............. 30 6.5 Execution Time for Various Compiler Optimizations on F1......... 35 6.6 Execution Time for Various Compiler Optimizations on 535U3C...... 37 6.7 Execution Time for Various Compiler Optimizations on DV7........ 38 6.8 Execution Time for Various Compiler Optimizations on G51........ 38 6.9 Data Container Performance on Linux with FX-8150 CPU......... 40 6.10 Data Container Performance on Windows with FX-8150 CPU....... 41 viii Dedicated to My Parents ix Introduction The goal of this project is to create a visualization affect that simulates smoke in a time dependent fluid flow. CFD data for a flapping deformable wing is used. OpenGL 3.3 is used for real time rendering. The software uses C++ and Qt so it can run on Linux, Windows, and theoretically Mac OS X. 1 Related Work 2.1 Flow Visualization Background CFD data typically consists of a velocity vector field in either 2D or 3D, and can be time dependent or static. There are several common approaches to visualizing flow data, the simplest being vector glyphs [1]. With vector glyphs, an arrow or line is drawn at each data point indicating the direction and magnitude of the flow. This method works for simple 2D flow visualizations but this method is very cluttered when 3D flow is visualized with it. Another method for visualizing flow data, streamlines, is less cluttered than the vector glyph method. Streamlines are traces of a mass less particle advected through the flow [1]. The result is a line tracing the path of each particle through the flow. If this method is used for time dependent flow the streamlines are referred to as streaklines. An extension of streamlines are streamsurfaces. A streamsurface is made up of a line of streamlines connected together to form a surface. This project focuses on the use of streamsurfaces in time dependent flow. A third method of visualizing flow data is texture based methods such as line integral convolution or LIC [1]. In order to create an LIC visualization a noise texture is smeared in the direction of the flow at each point. This method works well for 2D flow but is difficult to adapt to 3D flow. 2 2.2 Related Works in Flow Visualization An early attempt at visualizing 3D unsteady flow was done by Bryson and Levit in their 1991 work on a virtual wind tunnel [2]. They created an entire virtual environment for interactively investigating an unsteady 3D flow. Specifically, Bryson and Levit wrote soft- ware to display streamers, streamlines, streamlines, and basic material tracking in real time. What is more interesting is their visualization system used a boom mounted monitor, head tracking, and a data glove for interactive visualization. The computer they used for the vi- sualization is an SGI 380 VGX with only 48 MB of RAM and eight 33 MHz CPUs. Bryson and Levit were able to achieve some real time visualization with this system. They discuss memory and computational limitations with the possibility of using striped RAID disks in the future. An early work on streamsurfaces