PRELUDE Tutorial VWT1sa
Simulating flow around a simple object
Author: E.O.Pankova, Moscow Baumann State Technical University
In this tutorial, you will learn how to use
Gateway so as to
simulate the flow around a simple object.
How to make changes to:
will be discussed in later tutorials.
- the object,
- the inlet and outlet conditions,
- the grid fineness, and
- other aspects of the simulation,
It must be mentioned here that PRELUDE (and its VWT Gateway specifically), being under constant development, now includes new features, namely:
In this respect we shall concentrate here on the VWT options as as a stand-alone PHOENICS Gateway.
Although VWT tutorials inside PHOENICS package 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 coincide completely with
those on your screen.
- it allows display of results directly, as well as via the Viewer;
- it can handle unstructured as well as structured grids;
- a companion, i.d., 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.
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:
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 without being forced to study Tcl for this reason.
- 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.
- How to start
- Inspecting the object tree
- Making the simulation
- Inspecting the results
- 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:
It displays a solid (namely 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.
2. Inspecting the object tree
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
- 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
- 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:
- 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'
- Click now on the word 'INLET' in the tree. You will see
- 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 properties of the inlet click on the 'red-tick'
icon . 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.
- The 'Attributes' tab when clicked will look as follows.
Click on the arrow to the right of the 'Edit parameter' 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):
- 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.
- 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.
- 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.)
- 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.
Click on the 'store cupboard' tab and you will see which objects such as the following which you can place in the VWT i.e. the Virtual Wind Tunnel. [What you will in fact see, depends on what files having .dat, .3ds, .stl extensions are currently in your /gateways/vwt folder.]
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.
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 and as the number to right of the box shows. 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, this time red-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:
- 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 for the stand-alone VWT Gateway Prelude is the only module needed for editing settings and display of results 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.
- When the graphics window is again opened after the simulation, it will look a bit differently and as follows:
The objects tree contains a new object now, called vtkphi and a small white tetrahedron (a default VTK probe) appeared behind the monitor object in the Graphics window. This probe sets the default position of the cutplane that becomes visible if you click on the sign "+" to the right of the vtk object (vtkphi).
- Select the cplane, standing for "cut plane", i.e. a plane where the calculation results will be displayed.
- Now click on the object properties button to open the window as follows.
- Let us first choose the variable that we shall display on the cplane. The first variable chosen by default is pressure, P1. This can be confirmed if you click on the 'Scalar Properties' tab to get a picture like this one.
- 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.
- 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 VABS from the list standing for absolute velocity.
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.
- If you prefer to display the lines of constant velocity, select the 'Lines' box to get the picture as follows.
- Eventually you can as well display velocity vectors if you select the 'Vectors' box.
- 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'
- 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.
- Open the vwtpscrun file and your case will be loaded.
- Then display the object tree clicking on the corresponding button in the tool bar.
- Click on the VTK button and open the familiar phi.vtk file from the 'Choose VTK results file' window. The phivtk object together with its cplane will be displayed in the object tree and you can make similar steps starting with item b in this section.
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.