Simulating flow around a simple object

Author: E.O. Pankova, Moscow Baumann State Technical University


In this tutorial, you will learn how to use PRELUDE's Virtual-Wind-Tunnel Gateway so as to simulate the flow around a simple object.

How to make changes to:

will be discussed in later tutorials.

It must be mentioned here that PRELUDE (its VWT Gateway specifically), being under constant development, now includes new features, namely:

  1. it allows display of results directly, as well as via the Viewer;
  2. it can handle unstructured as well as structured grids;
  3. a companion, i.e. a step-by-step explanation and execution of the VWT scenario, has been suppied;
  4. the VWT Gateway is being suppplied to selected users as a stand-alone PHOENICS package, without the Viewer module.

So although the VWT tutorials are mainly valid, they still need to be updated as Prelude software is under permanent development. So do not be discouraged if tutorial images do not coinside completely with those on your screen.

It might be useful if before starting this tutorial you will get familiarised with the VWT companion.
To activate the VWT companion, do the following:

  1. run Prelude by clicking on the [chopin.gif] icon on the desktop;
  2. click on Help in the Menu bar, point to Companion and click on VWTPCO;
  3. you will then be guided through the VWT script wherein all its commands will be shown in a separate window and a corresponding link after each command when clicked on will run the command being discussed earlier.
So the aim of the Companion is not only to interpret commands of the Tcl language but to show what is being done in the domain when any of these command is run. Eventually the companions will enable a user to be in control of the case he is going to create, and not being forced to study Tcl for this reason.


  1. How to start
  2. Inspecting the object tree
  3. Making the simulation
  4. Inspecting the results
    1. by means of the VR Viewer
    2. by means of the VTK
  5. Concluding remarks

1. How to start

In this and all further tutorials, what-to-do instructions are indicated by letters and numbers in the left-hand margins, as follows:
  1. Start this tutorial by clicking on the [chopin.gif] icon on the desktop.

  2. Into the casename box, type the words, say, 'VWTa'.
    Preferably use a single short word, because it will be used as the start of the names of files to be saved later. (See section 6.)

  3. First create your working directory under /phoenics/d_prelud in an ordinary way. Then in the drop-down menu of the 'Edit' button, select 'Set Working Directory', navigating thereafter to the directory you have just created.
    Click on that folder. It will remain your working directory for PRELUDE until you change it again.

  4. To load the case which is discussed in this tutorial, click on the arrow to the right of the 'Load Gateway' box and select 'vwt', which stands for Virtual Wind Tunnel.

  5. List of initial settings (options) will appear inviting you to take account of thermal and/or compressibility effects as well as choose an object to be placed into the VWT and some others. We suggest that you should leave default settings at first. Then click on the button "Next".

  6. After PRELUDE has carried out some preliminary actions, the progress of which is indicated by blue bars moving across the screen, you should see a picture like this:


    It displays a solid (a a sphere) placed in a tunnel of rectangular cross-section, with a plane inlet for air on the left and a plane outlet on the right.

    Try rotating the object by moving the mouse, as explained in Tutorial 1, so as better to understand its shape.

2. Inspecting the object tree

As explained in the Beginner Tutorial 1, PRELUDE is an 'object-oriented' program. Now is the time to find out what objects constitute the case under consideration.
Making the 'object tree' visible
  1. Click on the [treen.gif] icon in the toolbar.

  2. Then click on the "+" sign close to the word 'world', 'materials' and 'variables'.
    What you will see, is:


    Selecting the object around which the flow is to be calculated
  3. Select the object in the tunnel by clicking on its image. You will then see the following image:


    about which the following remarks must be made:

  4. Click now on the word 'INLET' in the tree. You will see the following:


    As before:

  5. To find out what are the attributes of the inlet click on the 'red-tick' icon [immov.gif]. You will then see the following:


    You can examine what are the inlet position and sizes, whether it is rotated or not if you click on a corresponding tab. It is more interesting, however, to look at the 'Attributes' tab.

  6. The 'Attributes' tab when clicked will look as follows.


    Click on the arrow to the right of the 'Choose paramete' box and select 'velocity' as a parameter for examination. You can make sure of that three white boxes appear that contain the current values of the three components of velocity at the inlet, namely (from top to bottom):


    1. Xvelocity: windspeed, directed into the wind-tunnel, is set to 2.0 m/s;
    2. Yvelocity: 0.0 m/s, directed across the inlet horizontally;
    3. Zvelocity: 0.0 m/s, directed across the inlet vertically.

  7. Check that you can change these values in any of the ways which you learned in tutorial 1; but then return them to their original values before proceeding.

    However, you can add other parameters affecting the flow around a body in the wind tunnel, choosing them from the 'Add Parameter' box.
    It might be hidden, in this case enlarge the 'Attributes' window by dragging its handle down.

    1. Click on the right arrow to open the following drop-down menu.


    2. Select from that list any parameter you are specifically interested in and would like to control, say 'pressure'.
    3. Make sure that it has now appeared in your list of parameters and you can now edit it, pressing the right arrow and selecting 'pressure' from the Parameters box.


  8. Investigate the attributes of 'OUTLET' in the same way as you did for 'INLET', namely by:

  9. 'Pressure' has been introduced by default.
    Its panel contains a white box in which the 0.0 signifies that the outlet is being represented as a region where the air pressure is fixed to zero, (not 'absolute' of course, but 'relative'; the air is being taken as incompressible, therefore any constant value could be chosen.)


  10. Please note that the solid which has been placed into the virtual wind tunnel can be replaced by some other body. You can choose it from the store cupboard - a folder where objects of different shape are stored. To access the store cupboard, click on an empty space in the graphic window. You will then see the following in the top part of the window opened.


  11. Click on the 'store cupboard' tab and you will see which objects you can place in the VWT i.e. the Virtual Wind Tunnel.


    We do not recommend that you change the object now: you can experiment later and then run Phoenics with different objects placed in the VWT.

  12. However, the 'wind tunnel setting' tab is probably worth discussing. The next picture shows how it looks like.


    The initial velocity is here set by a parameter 'windspeed'. Initially it is equal to 2 m/s as was found out when we discussed the inlet velocity. You can change it entering a new value in place of 'windspeed' in the 'Speed' box. You can as well tilt the body inside the VWT specifying the angle of attack. For example, the body will be put upside-down when the angle of attack is 180 degrees, but not in case with the sphere.

  13. Apart from the green sphere representing the point of the coordinate system origin, you will see another green-sphere object.


    This is called 'monitor' and it marks the position for which 'spot values' are displayed on the graphical monitor when the Solver is making a run. We shall return to this point later, having started the simulation process.

3. Making the simulation

Click on 'Options' in the Menu bar, and then on 'Run Solver'. Then, in quick succession, you will see evidence on the screen of:

4. Inspecting the results

After the calculation is finished, the user is again taken to the Prelude Graphics window to explore the results obtained. It was already mentioned in the beginning that two modules could be used for this purpose, Prelude itself and the Veiwer. Let us try the Viewer first.

4.1. by means of the VR Viewer

  1. Go to Options - Run VR Viewer. You will see the image shown here:


  2. Now click on OK. This will result in the following picture, in which will be recognised the object, the tunnel and the inlet and outlet which you last saw in the graphics window of PRELUDE:


    How to use the PHOENICS Viewer package is a large subject, for which separate tutorials exist. A useful introduction can be found in the on-line document TR324.

    Nevertheless, the following suggestions are made to the newcomer to PHOENICS who wishes to see immediate evidence that he or she has performed a CFD calculation:

  3. Click the [contour.gif] icon, which selects contour plotting.
  4. Click the 'Y' button to select 'contours on constant-y planes'.
  5. Click and hold one of the 'probe-position' arrows to the right of the 'y' box until the plotting plane is in the middle of the tunnel. This will show a picture with maximum colour contrast like this:


    Clearly evident is the higher-pressure region on the left of the object and the lower-pressure region on the right.

  6. Now toggle 'contours off' by clicking on [contour.gif] again; then click on the Object management button [object.gif] so as to reveal the Object Management panel:


  7. Select (i.e. click on) 'TESTITEM'; then click on 'Action'; and then on 'Surface Contours' and finally on the X sign in the top right-hand corner of the Object Management panel to close it. The surface of the object will now be coloured so as to reveal the distribution of pressure over it, as shown here:


  8. When the bottom-right 'mouse' button is depressed, you can look at the scene from various angles by clicking and holding the left mouse button and then moving the cursor over the screen.
  9. Lastly, observe what happens when you click on the [vector.gif] button which activates velocity vectors, the [velocity.gif] button which colours both these and contours with respect to the the absolute values of the local velocity, and the 'X', 'Y' and 'Z' buttons of the VR Viewer Control Panel.

    You will then perhaps have sampled sufficient of the capabilities of the PHOENICS VR Viewer to be ready to move on.

  10. Although graphical displays of results provide much valuable information about flow patterns, etcetera, users are often more interested in numerical data, for example the forces exerted by the fluid on the object held in the wind-tunnel.

    To see how PHOENICS presents such data, click on 'File' (in the top left-hand corner), then on 'Open File for Editing' and then on 'Result (output file)'. Then search for 'force'.

  11. Although graphical displays of results provide much valuable information about flow patterns, etcetera, users are often more interested in numerical data, for example the forces exerted by the fluid on the object held in the wind-tunnel.

    To see how PHOENICS presents such data, click on 'File' (in the top left-hand corner), then on 'Open File for Editing' and then on 'Result (output file)'. Then search for 'force'. You will then see lines such as the following, the meaning of which requires no explanation:

    Integrated force on object: TEST-ITEM       
     Total in X =  5.051056E-01 Pressure=  5.051056E-01 Friction=  0.000000E+00
     Total in Y =  3.072683E-05 Pressure=  3.072683E-05 Friction=  0.000000E+00
     Total in Z =  1.206994E-06 Pressure=  1.206994E-06 Friction=  0.000000E+00
     Total moment about X axis =  2.212822E-05
     Total moment about Y axis = -3.788380E-01
     Total moment about Z axis =  3.787765E-01
     Moment of X force about Y = -3.788427E-01 at Z =  7.500269E-01
     Moment of Y force about X =  2.303352E-05 at Z =  7.496223E-01
     Moment of Z force about X = -8.968853E-07 at Y =  7.430735E-01
     Moment of X force about Z =  3.788286E-01 at Y =  7.499989E-01
     Moment of Y force about Z = -5.214402E-05 at X =  1.697019E+00
     Moment of Z force about Y =  4.883537E-06 at X =  4.046032E+00

    There is much more numerical information contained in the 'RESULT' file; but probably enough has been written for this tutorial concerning PRELUDE.

  12. Before quitting the Viewer, you might wish to save the results of your work there. The results of your PHOENICS runs will all be found in your working directory, where they will remain until deleted or removed by you, or over-written by later runs with the same case name.

    However, the settings which you made during your interaction with PRELUDE will be lost unless you save them.
    If you are still in the VR Viewer inspecting the results of calculations, close its window by clicking the top right-hand button with the cross. This procedure will return you to the PRELUDE Controller window. Drag and pull by the title bar to activate the window if it is not activated.

  13. There, in order to save your settings, click the top-left 'File' button and then on 'Save Q3'. Now you can always display the results of your simulation opening the file with extension *.q3 from your working directory, which is the one which you have just saved.

4.2. by means of the VTK

VTK stands for the Visualization Toolkit that is is an open-source, freely available software system for 3D computer graphics, image processing and visualization. VTK supports a wide variety of visualization algorithms including scalar, vector, tensor, texture, and volumetric methods; and advanced modeling techniques such as implicit modeling, mesh smoothing, cutting, contouring, and others.

We shall use it for display of the simulation results inside Prelude itself, without being in need of some other display module.

  1. Click on the VTK button [vtk.gif] from the tool bar.

  2. You will be invited to the window as follows:


  3. Select any of the three files with 'vtk' extension, say vtkcentre.vtk clicking on it. You will see that the 'vtkvtkcentre' object appeared in the objects tree. Expand it clicking on the sign "+" and you will see its "child" - cplane, standing for "cut plane", i.e. a plane where the calculation results will be displayed.


  4. Now click on the object properties button [properties.gif] to open the window as follows.


  5. Let us first choose the variable that we shall display on the cplane. The first variable chosen by default is pressure, P1. And it is shown in the graphics window on the left.

  6. Let us display pressure contours on the cplane. To do so, click on the Cutplane tab, then select the Y Contour box, i.e. along the VWT


    to get a picture like this one.


    The pressure contours presented by the Viewer are qualitatively and quantitatively similar.

  7. It will be more interesting, however, to display the results for velocity. It is necessary first to make this variable a default one. Click on the Scalar Properties tab, then on the PlotScalar button and choose velocity from the list.


    Let us now display what is really of interest about velocity. And we shall again display the calculation results on the cutplane along the the VWT.

  8. Select the contour box and you will get the picture like this one.


  9. If you prefer to display the lines of constant velocity, select the 'Lines' box to get the picture as follows.


  10. Eventually you can as well display velocity vectors if you select the 'Vectors' box.


  11. You may as well display the results in other planes, in the VWT cross section, in boxes to the right of the x grid one, and those to the right of the z grid box, or even in three coordinate planes. Other display controls in this window are:
  12. We remind you that the results of the simulation were saved in your working directory. In order to open them again without being in need of repeating the simulation, do the following. First close the present Prelude window clicking on the top right cross.
  13. Answer 'yes' or 'No' to the invitation 'Save the unsaved changes'


  14. and open Prelude in already familiar way.
  15. To load your case, click on the tab 'Load other' and you will be asked to run any file having extension *.q1, *.q3 or *.psc from your working directory.


  16. Open the vwtpscrun file and your case will be loaded. You can then make all the steps that were already discribed in this section starting with item a.

5. Concluding remarks

In this tutorial, the already-made settings were inspected but not varied.

In the tutorials which follow, instructions will be given as to how the settings can be changed; and the effects of these changes will be illustrated.