PRELUDE Tutorial VWT4
Simulating flow around a simple object - two-dimensional case
In this tutorial, you will continue learning how to use PRELUDE's Virtual-Wind-Tunnel
Gateway to simulate the flow around a simple object.
The fourth tutorial (VWT4) in the VWT series will explain how, making use of the symmetry of shape for an object inside the Virtual Wind Tunnel, transform the existing three-dimensional flow pattern into a two-dimensional one.
- How to start
- Making a simulation and inspecting results for the half-cylinder test-item
- Making a series of runs
- Inspecting results for the series of runs
- Saving the results of your work
- Concluding remarks
1. How to start
- Start the Prelude Editor in any of the ways described in earlier Tutorials.
- Type into the casename box the words, say, 'VWTd' to distinguish the present case from the previous one. You may also wish to create another working directory for a new case by any possible means accepted by your computer's operating system.
- Click on the button 'Load Other..' and navigate to the folder, which was your working directory during the previous session with the half-cylinder test-item, to select the corresponding Q3 file.
If this is your first session or for some reason you did not keep the results of your previous work, go to /phoenics/d_prelud/VWT and select cyl.q3 - the corresponding file which we created for you. The Prelude Editor will open the virtual wind tunnel (VWT) with already familiar half-cylinder test-item, only one-half of it being inside the domain, i.e. inside the VWT.
- The purpose of this tutorial is to help a user convert a three-dimensional case into a two-dimensional one when it is possible. The advantage of this operation is evident:
- a two-dimensional case is much simpler;
- less time will be be needed for its simulation, and finally
- there is a possibility to increase the accuracy of simulation without serious increase of the calculation time.
- Such conversion will be achieved if we simply prohibit the flow to move either above or below the test-item, i.e. if we reduce the Z-size of the domain to the Z-size of the test-item.
- So click on the object tree icon to reveal it, and select the 'DOMAIN' object.
- Then click on the red-tick icon in the tool bar. You will see that the domain sizes are as follows.
- Make the domain Z-size equal to that of the test-item to get what follows.
As you can see the half-cylinder fits the domain exactly and no flow is possible either on top or below it.
2. Making a simulation and inspecting results for the half-cylinder test-item
Let us run this case without introducing further changes to default settings.
- Click on 'Options' in the Menu bar, and then on 'Run Solver'.
- In the end of the simulation process the solver will close and the PHOENICS Viewer Package will present the image shown here:
- Click on 'OK' in the 'File names' window, thus accepting the default files for presenting the results of the simulation by another module of PHOENICS, the VR-Viewer.
- Let us display pressure contours on a constant-Z plane. For that purpose click the 'Z' button on the Control Panel or on the tool bar.
- Then click the icon, which selects pressure contour plotting.
You will see a picture like this:
- You can change the Z-coordinate of the probe (the red-and-yellow pencil) clicking on either arrow to the right of the Z-box on the Control Panel.
Changing Z from zero to unity will result in the same image of pressure contours.
The symmetry of the test-item shape about the constant Y-plane coming through its center, enabled us to make simulation for one half of the test-item only. (See VWT3 Tutorial.)
- It would be also interesting to display velocity vectors clicking on the velocity vector toggle . You will then see a picture like this.
- For better visualization of velocity vectors let us change vector options by increasing the vector scale factor. Right-click the velocity vector icon in the tool bar or in the Control Panel to open the Viewer Options window.
- Click and hold the upper button to the right of the scale factor box to increase vectors until you can clearly distinguish them.
It is obvious that behind the half-cylinder test-item there is a low-pressure region with a swirl flow being formed there.
- Close the VR Viewer window, clicking on the top-right cross, and return to the Prelude Editor. Click 'OK' in the 'Exit PHOENICS' window.
- Open the Prelude window which might now display the result file.
At the very bottom of the file you will see the following:
Pay attention to the calculation time which is 6 seconds.
- Switch on to the graphics window by clicking on the 'Graphics' tab.
- Click on the object tree icon to reveal it, then select the 'CELLGRID' object.
It is now time to mention that the accuracy of the results obtained depend on the calculation grid fineness: the smaller are the grid cell sizes, the more accurate will be the results we shall get.
- Click on the 'red-tick' icon in the tool bar to show its attributes.
It will result in the picture like this.
The number of cells in X-direction is 37, there are 8 cells both in Y- and Z-direction.
- As we have found out after the simulation, the flow pattern is the same on each constant Z-plane, what makes us possible to change the cell numbers in each box. Let us have only one cell in Z-direction and double the number of cells both in X and Y-direction. See the picture below.
- Now run the Solver by clicking on 'Options', then on 'Run Solver'; after that repeat all the other steps of your first run.
- In the VR Viewer window we advice you to display the same image, viz pressure contours on a constant Z-plane with velocity vectors, to admit of comparison of the results obtained.
As you can see, although quantitatively pressure values did not change very much, qualitatively pressure contours became more intricate.
- Let us also display forces and moments acting on the test-item for easier comparison of the results. Click on the test-item to select it, then right-click to display the contextual menu and select the 'Show results' command. At the very bottom you will read the following.
- Let us now close the VR Viewer window and return to the Prelude Editor. At the very bottom of the opened tab with the result file you will see the following.
The calculation time has been even reduced to 2 seconds at the expense of diminution of the number of cells in Z-direction.
- It is convenient to to test the accuracy of the results obtained by making a series of runs. We already explained how to do this in the 'VWT1 Tutorial'.
3. Making a series of runs
In this series of runs we are going to increase the number of cells in X- and Y-direction proportionally, leaving each time only one cell in Z-direction.
You can continue experimenting and expand the range of FACTOR variations further, if you wish. The final solution will be attained when the fineness of the grid does not affect the results of simulation any longer.
- In the Prelude Editor window click on the 'Functions' tab. We are going to introduce a new function - a coefficient that will be changed during each run and during each run a new number of cells will be obtained by multiplication of the base number by a specific value of this coefficient.
- In the 'Add' box type the word 'factor' and click 'OK'.
- Set the type of this parameter to 'int', meaning 'integer', and its initial value to '3'.
- Return to the 'Graphics' window clicking on its tab.
- In the cellgrid attributes window let us restore the initial values for cells in X- and Y-direction multiplied by the function called 'FACTOR'.
You should get the following.
You can see X Cells and Y Cells values have been tripled as compared with their initial numbers. The picture confirms this.
- Now click the 'Make Runs' tab above the graphics window.
- Select the newly introduced function FACTOR from the list which will open if you click on the right-side arrow of the box 'Use these values to run a series of calculations'. Then specify how this function will vary in the series of runs, say from its initial value '3', to '5' with a step of '1'.
You will have a picture like this.
- Finally click on the 'Run Solver for cases' button.
- Simulations for three cases (FACTOR equal to 3, 4 and 5) will be made one after another. To get access to their results, return to the 'Make runs' window to see the following.
- Clicking on a corresponding button you will view the results of each run. We are going to compare these, displaying pressure contours on a constant Z-plane and forces and moments on the test item. In the end we shall give the time of calculation.
- In the end we shall provide you with the results obtained with FACTOR=20. That means that the number of cells in X- and Y-direction are 740 and 160, respectively. At the same time we increased the number of sweeps, i.e. iterations, for this very run from 50 to 200, going to the 'Functions' tab and there setting LSWEEP - the number of iterations - to 200.
That has been done because for a larger number of cells more iterations are needed to achieve convergence.
We suggest that you should stop here, although judging by graphical and numerical results the accurate solution has not been obtained yet. However, balancing between achieving more accurate results and spending larger time on simulation, we advice you to keep to the "golden" mean and not be carried away by excessive desire for accuracy. All CFD simulations are based on certain physical and mathematical assumptions; thus their accuracy is always limited.
4. Inspecting results for the series of runs
You can find numerical results of all the simulations made in your working directory that could look like what follows.
Pay attention to the subfolders created inside your working directory: they contain all the files created by PHOENICS for each run. The one that is called 'result', which can be opened with any text editor (Notepad, for example), contains numerical results of each run.
You can find there information on forces and moments on the test-item, as well the machine time needed for simulation.
It is indeed the file which is visible in the Prelude screen, immediately a PHOENICS run has been completed.
5. Saving the results of your work
If you intend to return to the present case in future and continue investigate further, all the changes that you have introduced to the domain, test-item and grid settings should be saved. Otherwise you will have to repeat all your previous work in the Prelude Editor once again. Consult the previous VWT Tutorials how to do it.
6. Concluding remarks
In this tutorial,
- you learned how to convert the three-dimensional case with the half-cylinder inside the VWT into a two-dimensional one;
- you observed the effect of the calculation grid fineness on the accuracy of the results;
- finally, you made a series of runs, varying the number of cells in two directions (X and Y), to confirm this effect.