3D Visualization Modules for Chemical Engineering •Fi a Web
Total Page:16
File Type:pdf, Size:1020Kb
University of Tennessee, Knoxville TRACE: Tennessee Research and Creative Exchange Masters Theses Graduate School 12-2003 3D Visualization Modules for Chemical Engineering – A Web- Based Approach Using Java and OpenGL Sharad Anant Gupta University of Tennessee - Knoxville Follow this and additional works at: https://trace.tennessee.edu/utk_gradthes Part of the Computer Sciences Commons Recommended Citation Gupta, Sharad Anant, "3D Visualization Modules for Chemical Engineering – A Web-Based Approach Using Java and OpenGL. " Master's Thesis, University of Tennessee, 2003. https://trace.tennessee.edu/utk_gradthes/1969 This Thesis is brought to you for free and open access by the Graduate School at TRACE: Tennessee Research and Creative Exchange. It has been accepted for inclusion in Masters Theses by an authorized administrator of TRACE: Tennessee Research and Creative Exchange. For more information, please contact [email protected]. To the Graduate Council: I am submitting herewith a thesis written by Sharad Anant Gupta entitled "3D Visualization Modules for Chemical Engineering – A Web-Based Approach Using Java and OpenGL." I have examined the final electronic copy of this thesis for form and content and recommend that it be accepted in partial fulfillment of the equirr ements for the degree of Master of Science, with a major in Computer Science. Peter Cummings, Major Professor We have read this thesis and recommend its acceptance: Robert Ward, Jian Huang Accepted for the Council: Carolyn R. Hodges Vice Provost and Dean of the Graduate School (Original signatures are on file with official studentecor r ds.) To the Graduate Council: I am submitting herewith a thesis written by Sharad Anant Gupta entitled “3D visualization modules for chemical engineering – A web-based approach using Java and OpenGL ”. I have examined the final electronic copy of this thesis for form and content and recommend that it be accepted in partial fulfillment of the requirements for the degree of Master of Science, with a major in Computer Science. Peter Cummings Major Professor We have read this thesis and recommend its acceptance: Robert Ward Jian Huang Accepted for the Council: Dr. Anne Mayhew Vice Provost and Dean of Graduate Studies (Original signatures are on file with official student records) 3D visualization modules for chemical engineering - A web-based approach using Java and OpenGL A Thesis Presented for the Master of Science Degree The University of Tennessee, Knoxville Sharad Anant Gupta December 2003 DEDICATION I would like to dedicate this thesis to my parents, Anant Gupta and Anita Gupta, and my family for all their love and support over the years. I would also like to dedicate this to my fiancée Akanksha, for her love and encouragement to pursue this goal. ii ACKNOWLEDGEMENT I would like to thank a number of people whose help and guidance have allowed me to reach this milestone. First, I would like to specially thank my thesis advisor, Dr. Peter Cummings for his guidance and endless support. His knowledge and expertise in the areas of Computer Graphics and Chemical Engineering proved invaluable in the completion of this thesis. His patience and faith in me were a constant source of inspiration. I am grateful to Dr. Clare McCabe for her great support and guidance in the development of the 3D visualization modules and also to Dr. Ariel Chialvo for his support in the development of the molecular simulation module. I would like to sincerely thank Dr. David Kofke, Professor at SUNY-Buffalo, for his co-operation and support in the development of the molecular simulation module. I would also like to thank my thesis committee members, Dr. Ward and Dr. Huang for taking time to review and direct my thesis work. Lastly, I would acknowledge the support of the NSF grant DUE-9752243, with the help of which this thesis project could be completed successfully. iii ABSTRACT The main objective of this work is to implement web-based educational modules for chemical engineering students. Phase behavior is a topic with which the students seem to struggle with, particularly for mixtures, where a 2-D representation of the phase diagram falls far short of the understanding a 3-D model can provide. Using the platform- independence of Java and the graphics capability of OpenGL, three phase diagram Java applets have been developed. Users can view these web-based 3D applets by installing a plug-in. These modules provide users with an ability to rotate the 3D models, slice through them, zoom into them and view their various 2D projections. Also, a molecular simulation applet for measuring chemical potential of binary mixtures has been developed, using a Java-based molecular simulation application-programming interface (API). First, the thesis presents a brief overview of phase diagrams and explains why modeling them using computer graphics is useful. While visualization involves the merging of data with the display of geometric objects through computer graphics, it is important to study the software issues involved in web-based visualization. The paper explains the visualization framework by describing the visualization pipeline and then using it as a guideline for the development of the modules. Next, the paper describes the development of the molecular simulation applet using a molecular simulation API - Etomica. The Java applet provides for dynamic modification and interrogation of the simulation, while it is in progress, which enables students to see directly the effect of changing state conditions or molecular interactions on the behavior of the molecules and on the outcome of the simulation. It is hoped that by using these web-based 3D phase diagrams the chemical engineering students would gain a better understanding of the complicated 3D models, making this package a useful instructional aid. It is also hoped that the molecular simulation applet would be an effective tool to help students understand molecular simulations. iv CONTENTS Chapter Page Part One – Introduction ..........................................................................................1 1 Introduction .........................................................................................................2 1.1 World Wide Web (WWW) as a medium of education ............................2 1.2 Objective .................................................................................................3 Part Two - Visualization of Phase Diagrams .........................................................6 2 Phase Diagrams ..................................................................................................7 2.1 Phase Diagram of Pure Substances .........................................................7 2.2 Phase Diagram of Binary Mixtures .........................................................8 2.3 Interpreting Phase Diagrams .................................................................11 3 Visualization Framework ..................................................................................13 3.1 Understanding the Visualization Pipeline..............................................14 3.1.1 Step I – Data Gathering and Analysis .....................................14 3.1.2 Step II – Filtering and Geometric Modeling............................15 3.1.3 Step III – Rendering and Interactivity ....................................16 3.2 Software ................................................................................................17 3.2.1 Java3D..................................................................................... 20 3.2.2 Java-OpenGL Bindings ...........................................................20 3.2.3 Java3D vs. Java-OpenGL Bindings ........................................21 3.2.4 Our Choice ..............................................................................21 4 Visualization Pipeline ........................................................................................25 4.1 Step I – Data Gathering and Analysis ...................................................25 4.1.1 Observations ............................................................................26 4.1.2 Analysis .................................................................................26 4.2 Step II – Filtering and Geometric Modeling .........................................27 4.2.1 Large Data Set Visualization ..................................................27 4.2.2 Filtering (Sampling) ................................................................28 4.2.3 Geometric Modeling ...............................................................28 4.2.4 Non-Uniform Rational B-Splines (NURBS) ...........................30 4.2.4.1 Bezier Surfaces .....................................................31 4.2.4.2 B-Spline Surfaces ..................................................31 4.2.4.3 NURBS .................................................................32 4.3 Step III – Rendering and Interactivity ...................................................32 4.3.1 NURBS Rendering ..................................................................33 4.3.2 Interactivity..............................................................................33 v 5 Analysis and Implementation ...........................................................................36 5.1 Analysis (Data Flow Diagrams) ............................................................36 5.1.1 Context-Level Diagram (CLD) ............................................. 36 5.1.2 Level-0 Diagram ....................................................................37