PRELUDE Tutorial VWT1
Simulating flow around a simple object
Author: E.O. Pankova, Moscow Baumann State Technical University
Summary
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:
- the object,
- the inlet and outlet conditions,
- the grid fineness, and
- other aspects of the simulation,
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:
- it allows display of results directly, as well as via the Viewer;
- it can handle unstructured as well as structured grids;
- a companion, i.e. a step-by-step explanation and execution of the VWT scenario, has been suppied;
- 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:
- run Prelude by clicking on the
icon on the desktop;
- click on Help in the Menu bar, point to Companion and click on VWTPCO;
- 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.
Contents
- How to start
- Inspecting the object tree
- Making the simulation
- Inspecting the results
- by means of the VR Viewer
- by means of the VTK
- 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:
- Start this tutorial by
clicking on the
icon on the desktop.
- 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.)
- 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.
- 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.
- 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".
- 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:
![[tut2_1.gif]](vwt1/tut2_1.gif)
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
- Click on the
icon in the
toolbar.
- Then click on the "+" sign close to the word 'world', 'materials' and 'variables'.
What you will see, is:
![[tut2_2.gif]](vwt1/tut2_2.gif)
Selecting the object around which the flow is to be calculated
- Select the object in the tunnel by clicking on its image. You will then
see the following image:
![[tut2_3.gif]](vwt1/tut2_3.gif)
about which the following remarks must be made:
- the surface of the object has been made prominent by having white
lines drawn on it;
- the top-right-hand-corner message is:
'Selected testitem Attached to world'
which indicates that 'testitem' is the object's name;
- also high-lighted is the word 'testitem' in the tree on the left of the
picture, where the object is indeed shown to be a 'child' of the 'parent'
world.
- Click now on the word 'INLET' in the tree. You will see
the following:
![[tut2_4.gif]](vwt1/tut2_4.gif)
As before:
- the word 'INLET' appears in the top-right-hand corner;
- the relevant name in the object tree is high-lighted; and
- the white-shaded rectangle on the left of the object in the Graphics window shows where the inlet is situated.
- To find out what are the attributes of the inlet click on the 'red-tick'
icon
. You will then see the following:
![[tut2_5.gif]](vwt1/tut2_5.gif)
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.
- The 'Attributes' tab when clicked will look as follows.
![[tut2_5a.gif]](vwt1/tut2_5a.gif)
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):
![[tut2_5b.gif]](vwt1/tut2_5b.gif)
- Xvelocity: windspeed, directed into the wind-tunnel, is set to 2.0 m/s;
- Yvelocity: 0.0 m/s, directed across the inlet horizontally;
- Zvelocity: 0.0 m/s, directed across the inlet vertically.
- 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.
- Click on the right arrow to open the following drop-down menu.
![[tut2_6.gif]](vwt1/tut2_6.gif)
- Select from that list any parameter you are specifically interested in and would like to control, say 'pressure'.
- 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.
![[tut2_7.gif]](vwt1/tut2_7.gif)
- Investigate the attributes of 'OUTLET' in the same way as you did for 'INLET', namely by:
- displaying the 'object tree',
- selecting (i.e. clicking on) 'OUTLET',
- selecting 'Attributes',
- adding a certain parameter (apart from 'pressure') from the 'Add Parameter' box,
- revealing the pull-down menu of the middle-left-hand box.
- '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.)
![[tut2_8.gif]](vwt1/tut2_8.gif)
- 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.
![[tut2_9.gif]](vwt1/tut2_9.gif)
-
Click on the 'store cupboard' tab and you will see which objects you can place in the VWT i.e. the Virtual Wind Tunnel.
![[tut2_10.gif]](vwt1/tut2_10.gif)
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.
- However, the 'wind tunnel setting' tab is probably worth discussing. The next picture shows how it looks like.
![[tut2_11.gif]](vwt1/tut2_11.gif)
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.
- Apart from the green sphere representing the point of the coordinate system origin, you will see another green-sphere object.
![[tut2_13.gif]](vwt1/tut2_13.gif)
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:
- the running of the PHOENICS Pre-Processor module (SATELLITE) in non-interactive mode, while it processes the information provided for it by PRELUDE;
- the activation and running of the PHOENICS Solver Module (EARTH) while it processes the information which it has received from SATELLITE;
- after some time when the computation is finished, the initial picture with the Graphics window will be visible on the screen.
To analyze the convergence, you can open the file with the course-of-computation plots, gxmoni.gif from your working directory that looks as follows:
To those interested in such matters, it may here be remarked that:
- the downward profile of the curves in the left-hand panel shows that the 'corrections' to the solved-for variables diminish to very small values as the calculation proceeds.
- the downward trend of the curves in the right-hand panel explains the reason: the 'errors', i.e. imbalances in the equations being solved, are also diminishing. The values in the right-hand panel are calculated for the MONITOR we spoke about. In pricipal any point inside the DOMAIN can be specified as a MONITOR and flattening of curves for variables at this point is a sign that a certain accuracy of the solution has been achieved;
- it is these imbalances (in units, say, of kg/s or joules per second), which cause the PHOENICS solver module to make the corrections (e.g. of pressure or temperature);
- In CFD parlance, these curves show that the calculation has satisfactorily 'converged'.
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
- Go to Options - Run VR Viewer. You will see the image shown here:
- 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:
- Click the
icon, which selects contour plotting.
- Click the 'Y' button to select 'contours on constant-y planes'.
- 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.
- Now toggle 'contours off' by clicking on
again; then click on
the Object management button
so as to reveal the Object Management
panel:
![[tut2_17.gif]](vwt1/tut2_17.gif)
- 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:
- 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.
- Lastly, observe what happens when you click on the
button which
activates velocity vectors, the
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.
- 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'.
- 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.
- 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.
- 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.
- Click on the VTK button
from the tool bar.
- You will be invited to the window as follows:
![[tut2_18a.gif]](vwt1/tut2_18a.gif)
- 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.
![[tut2_18b.gif]](vwt1/tut2_18b.gif)
- Now click on the object properties button
to
open the window as follows.
![[tut2_18c.gif]](vwt1/tut2_18c.gif)
- 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.
- 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
![[tut2_18d.gif]](vwt1/tut2_18d.gif)
to get a picture like this one.
![[tut2_18e.gif]](vwt1/tut2_18e.gif)
The pressure contours presented by the Viewer are qualitatively and quantitatively similar.
- 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.
![[tut2_18f.gif]](vwt1/tut2_18f.gif)
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.
- Select the contour box and you will get the picture like this one.
![[tut2_18g.gif]](vwt1/tut2_18g.gif)
- If you prefer to display the lines of constant velocity, select the 'Lines' box to get the picture as follows.
![[tut2_18h.gif]](vwt1/tut2_18h.gif)
- Eventually you can as well display velocity vectors if you select the 'Vectors' box.
![[tut2_18i.gif]](vwt1/tut2_18i.gif)
- 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:
- 'x grid', 'y grid' and 'z grid' boxes that reveal the grid in the corresponding plane; and
- 'none' boxes which hide the images that have been displayed in the corresponding direction.
- 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.
- Answer 'yes' or 'No' to the invitation 'Save the unsaved changes'
![[tut2_18j.gif]](vwt1/tut2_18j.gif)
- and open Prelude in already familiar way.
- 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.
![[tut2_18k.gif]](vwt1/tut2_18k.gif)
- 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.