# Virtual Reality for CFD post-processing

##### Introduction

This page presents how the *Virtual Reality Modeling Language* (VRML) is used to present the results of a computation with the commercial viscous flow code COMET. Starting from a simple example illustrating the ability of VRML to display complex geometrys, it is shown how these geometrys can be optimized. Optimizing the VRML models is necessary, as larger models need too much memory and CPU time for rendering. The tools for this process (routines in FORTRAN 77 and shell scripts under the Linux environment to built the VRML models) are made available on this page for download and free use. An example is also given for a slender geometry and routines for optimization are given as well. Finally it is shown on a little example how a complex geometry may be colored and how it also may be optimized by given routines.

As a more complex example the VRML model of a surface effect ship (SES) with streamlines, visualizing the complex three dimensional flow field around the superstructure of this ship, is presented. The aerodynamic flow calculation were carried out with COMET and the streamlines were computed using the IBM tool DX. The geometry and the streamlines were optimized with the presented tools. Additionally a VRML model showing the pressure distribution on the geometry is presented. As also engineers sometimes like something to play with, the SES is also presented together with a helicopter as a VRML model.

The time dependent cavitation pattern on a hydrofoil is presented in another VRML model. For optimizing the geometrys the presented routines were again used. Some scripts controlling the animation may be helpful for own applications.

For details please see the examples below and the references at the bottom of this page.

The VRML models may be viewed using a VRML 97 (VRML 2.0) browser or plug-in.

##### Simple example

This simple example illustrates how to define a complex geometry as *IndexdFaceSet *and a slender geometry as *Extrusion.* Two *scripts* are used: one to switch a geometry on and off (click on the blue ball and the streamline will show up) and another to highlight a geometry by passing over it with the mouse device (pass over the streamline and it will turn red).

Explore VRML model

Download VRML model

##### Optimize geometry defined as *IndexedFaceSet*

The number of polygons used building a geometry ("polygon count") is one of the key factors influencing the performance (= speed and handling) of a VRML model. The polygon count of the cube in the upper row of this example with 9 polygons (*faces*) and 13 *points* is reduced with a FORTRAN 77 routine to the cube in the lower row with 7 *faces* and 8 *points.* Details of the routine are described in the readme file and the source code, which can be downloaded, and in [4]. Part of the download package is also a Linux shell script to construct the VRML model.

Explore VRML model

Download source code, scripts and example

##### Optimize geometry defined as *Extrusion*

A geometry defined as *Extrusion* may be optimized (the number of offsets for the spline are reduced) with the help of a FORTRAN 77 routine. In the example the upper streamline is the original streamline with 9 offsets and the lower one is the optimized with 6 offsets. The VRML model makes use of the scripts "activator" to activate a geometry by clicking with the mouse device on another object (click on the balls in the example to display the streamlines) and "highlighter" to highlighten a geometry (pass with the mouse device over the streamlines and they will turn red). Details of the routine are described in the readme file and the source code, which can be downloaded, and in [4]. Part of the download package is also a Linux shell script to construct the VRML model.

Explore VRML model

Download source code, scripts and example

##### Extract pressure data from COMET

This example shows a cube which is colored with the help of *ColorPerVertex. *The data may come as pressure data from the viscous flow solver COMET. These data can be extracted and turned into colors with the help of the routines and scripts in the download package. Details of the routines are described in the readme files, the source code and in [4]. The scale in this VRML model might also be used for own applications.

Explore VRML model

Download source codes, scripts and example

##### Optimize geometry with color information

In this example the polygon count of the cube is reduced taking into account the geometry and the color in the points defining the cube. The routine performing this task is similar to the one presented above and may be downloaded here. Details of the routine are described in the readme file, the source code and in [4].

Explore VRML model

Download source code, scripts and example

##### SES with streamlines

The geometry of this SES is exported from the commercial viscous flow solver COMET and optimized with the above presented routines. The streamlines were computed with the IBM tool DX with the data coming from COMET. The VRML model makes use of the scripts "activator" and "highlighter". Streamlines can be selected by clicking on the matrix of balls in front of the SES. For details about the flow computation see [3] and about the making of the VRML model see [4]. To convert a geometry from COMET into VRML standard a small FORTRAN routine is used and may be downloaded here.

Explore VRML model

Download VRML model

Download convert routine

##### SES with pressure distribution

Together with the geometry the pressure distribution is exported from the commercial viscous flow code COMET. The pressure values are converted into colors and the geometry is optimized with the above presented routine taking into account geometry and color. The color scale may be moved in the screen plane. Try different viewpoints or take the guided tour. For details about the flow computation see [3] and about the making of the VRML model see [4].

Explore VRML model

Download VRML model

##### SES with helicopter

This SES with helicopter is not only something to play with, but a good example how to work with different coordinate systems and how to animate the path of geometrys. Click on the helicopter and the rotor will start turning before the helicopter makes a short flight around the SES. After a click on the SES it will start turning about its vertical axis.

Explore VRML model

Download VRML model

##### Visualization of cavitation using a VRML model

This is a good example for the presentation of a time dependent geometry. The control scripts and the control buttons may be useful for own applications. Follow the link below to read more about this VRML model.

Read more about VRML model

Explore VRML model

Download VRML model

##### References

[1] Barcellona, M.; Bertram, V. (2000), *Virtual reality for CFD post-processing*, 1st Int. Conf. on Computer and IT Applications in the Maritime Industries, COMPIT, Potsdam, pp. 35-44

[2] Beier, K.-P. (2000), *Web based virtual reality in design and manufacturing applications*, 1st Int. Conf. on Computer and IT Applications in the Maritime Industries, COMPIT, Potsdam, pp. 45-55

[3] Lindenau, O.; et al. (2002), *Aerodynamic flow simulations for an SES employing virtual reality post-processing techniques*, 3rd Int. Conf. on High-Performance Marine Vehicles, Hiper, Bergen, pp. 289-296

[4] Lindenau, O.; Bertram, V. (2003), *The Making of a VRML Model for an SES with Streamlines and Pressure Distribution*, 2nd Int. Conf. on Computer and IT Applications in the Maritime Industries, COMPIT, Hamburg

Contact: Dipl.-Ing. Olaf Lindenau