Jul 1, 2016 - Bachelor Thesis by Björn Schilling. â 3 â. Confirmation. I hereby confirm that I,. Björn S c h i l l i n g, have written this thesis by myself, have not ...
Bachelor Thesis
Modeling a Turbulent Boundary Layer with OpenFOAM Modellierung einer turbulenten Grenzschicht mit OpenFOAM
Björn S c h i l l i n g
Renewable Energies Department Mechanical Engineering / Environmental Engineering
1. Validator:
Prof. Dr.-Ing. Stefan Beer
2. Validator:
Prof. Dr.-Ing. Andreas P. Weiß
Release date:
01.07.2016
Closing date:
30.09.2016
Modeling a Turbulent Boundary Layer with OpenFOAM
–2–
Bachelor Thesis by Björn Schilling
Confirmation I hereby confirm that I, Björn S c h i l l i n g, have written this thesis by myself, have not handed this thesis in for examination purposes before, have not used other references or resources than the ones declared and have marked literal and analogous quotations as such.
Amberg, 7. September 2016
.....................................................................
Abstract This thesis describes the assembly and execution of a simple turbulent test case in a way that is easy to recreate from the ground up, especially in terms of software-related aspects. The composed OpenFOAM fluid simulation working environment is found to be highly adjustable, which brings great advantages for advanced users, additionally to being free of charge. CFD beginners, however, might get discouraged by the complexity of the software and the accompanied steep learning curve. It is found that there are some definitive differences between the OpenFOAM simulation results and the consulted results from NASA, as well as in the regarded theories.
Keywords OpenFOAM, turbulent, boundary layer, guide, open-source, CFD
–3–
Modeling a Turbulent Boundary Layer with OpenFOAM
Acknowledgment I would like to thank my family for giving me the aim and all of their support to get me here. I would like to thank all my friends and colleagues for going through this together with me, in the fulfilling and successful times as well as in the stressful times, always influencing in an enhancing manner. I also would like to thank and credit all the contributors of the open source community for setting the foundations of this work for free.
–4–
Bachelor Thesis by Björn Schilling
Table of Contents 1
Introduction and Aim of the Thesis ................................................................................ 8
2
Turbulent Boundary Layer Theory ................................................................................ 9
3
Setting up the Working Environment ........................................................................... 13 3.1 Setting up the Operating System ............................................................................... 13 3.1.1. Preparation of a Windows Computer for a Dual Boot Ubuntu Installation .............. 13 3.1.2. Preparation of a Bootable Ubuntu USB Stick on Windows ...................................... 16 3.1.3. Ubuntu Installation from a Bootable USB Stick ....................................................... 17
3.2 Setting up the Simulation Software ........................................................................... 20 4
Reproduction of NASA’s 2D Zero Pressure Gradient Flat Plate Validation Case... 24 4.1 Setup of the Basic Case Structure .............................................................................. 24 4.2 Mesh Conversion and Import .................................................................................... 26 4.3 Adjustment of the Case File Settings ......................................................................... 29 4.3.1. Constant Directory .................................................................................................... 30 4.3.2. 0 Directory ................................................................................................................ 31 4.3.3. System Directory ....................................................................................................... 33
4.4 Execution and Post-Processing of the Simulation ..................................................... 35 5
Results and Conclusion................................................................................................... 38
6
References ........................................................................................................................ 41
7
Appendix .......................................................................................................................... 44
–5–
Modeling a Turbulent Boundary Layer with OpenFOAM
Formula Symbols and Abbreviations Constants Avogadro constant Von Kármán constant
mol–1 –
= 6,022 142 ∙1023 = 0.41
NA κ
Formula Symbols Quantity Amount of substance Cartesian coordinates Density Isentropic exponent Kinematic viscosity Mach number Mass Molar mass Shear stress Specific gas constant Specific isobaric heat capacity Specific isochoric heat capacity Speed of sound Temperature Temperature Velocity components in x,y,z-direction
Symbol n x, y, z ρ κ υ Ma m M τ R cp cV c T t u, v, w
–6–
Unit mol m kg m–3 – m2 s-1 – kg g mol–1 N m-2 J kg-1 K-1 J kg–1K–1 J kg–1K–1 m s-1 K °C m s-1
Bachelor Thesis by Björn Schilling
Abbreviations CFD
Computational Fluid Dynamics
DNS
Direct Numerical Simulation
HDD
Hard Disk Drive
LTS
Long Time Support
RAM
Random Access Memory
RAS
Reynolds-Averaged Simulation
SI-Units
International System of Units (Système International)
SSD
Solid State Drive
–7–
Modeling a Turbulent Boundary Layer with OpenFOAM
1
Introduction and Aim of the Thesis OpenFOAM is a wide-ranging CFD software toolbox that is free of charge. This seems to be the crucial base of decision-making for the usage of OpenFOAM instead of commercial applications. Transparency, customizability and extendibility of the code are decisive arguments as well. On the other hand, OpenFOAM is developed by independent specialists and is not always easy to handle for CFD beginners. The aim of this thesis is to describe the assembly and execution of a simple turbulent test case in a way that is easy to recreate from the ground up, especially in terms of software-related aspects. OpenFOAM is an abbreviation for Open Field Operation And Manipulation, already indicating what the code is meant to be, an open source CFD toolbox. OpenFOAM is distributed by the OpenFOAM Foundation under the GNU General Public License v3 (1). (2) NASA’s 2D Zero Pressure Gradient Flat Plate Validation Case (3) is chosen to be the simulated case because all the related data is publicly available and well defined in a transparent manner.
–8–
Bachelor Thesis by Björn Schilling
Turbulent Boundary Layer Theory
2
The following theory is going deeper into the universal law of the wall, as found in Schlichting; Gersten. (4) The velocity distribution of the Couette flow’s boundary layer is exemplary because of its universal character. Almost every turbulent flow of high Reynolds numbers and limited wall shear stress has a small boundary layer with the same velocity distribution. The Couette flow has the constant shear stress ̅ in the entire flow field which can be written as: ̅
̅
̅̅̅̅ ,
Equation 2-1
with the time averaged viscous shear stress ̅ and the turbulent shear stress , which in sum are equal to the wall shear stress ̅̅̅̅ . The time averaged viscous and the turbulent shear stress are again defined as ̅̅̅̅ ̅ ̅̅̅̅ Equation 2-2
and ̅̅̅̅̅ . Equation 2-3
These two components represent the two mechanisms which transport the wall-parallel shear stress through the fully developed flow; namely the molecular momentum transmission due to viscosity ( ̅ ) and the momentum transmission due to turbulent fluctuation motion ( . The aim is to determine this time averaged velocity (in flow direction) ̅ as a function of the wall distance y. The dependencies of ̅ are given in Equation 2-4: ̅̅̅̅ ̅ ( ) Equation 2-4
with H as the total height of the considered flow and by value much greater than the boundary layer’s thickness. Since ̅̅̅̅ / is the only occurring combination from Equation 2-1 to Equation 2-3, Equation 2-4 is a relation of pure kinematic units with the basic units m and s. The Buckingham Π theorem says that this dependency can be simplified to a correlation of three dimensionless parameters. For this cause, the wall shear stress velocity, often referred to as shear stress velocity, is brought into use: ̅̅̅̅ √
Equation 2-5
–9–
Modeling a Turbulent Boundary Layer with OpenFOAM
With the other dimensionless parameters: ̅
Equation 2-6
Equation 2-4 is replaced to: ( Equation 2-7
The function of Equation 2-7 has the following boundary conditions:
Equation 2-8
The system of Equation 2-7 and Equation 2-8 cannot be closed since there is only one equation for the ( ( two unknown functions and . The necessary second equation, which has to give a second correlation between
and the derivations of the velocity
,
and so on, is
obtained from turbulence modeling. In the overall flow with the height H, molecular momentum transmission due to viscosity can be neglected compared to the momentum transmission due to turbulent fluctuation motion, except for the slim region of the boundary layer. For this boundary layer, the characteristical wall coordinate
Equation 2-9
is brought into use. Now the velocity distribution in the boundary layer can be written as: ( Equation 2-10
– 10 –
Bachelor Thesis by Björn Schilling
The boundary layer is subdivided into three sections, as shown in Figure 2-1.
Figure 2-1: Universal distribution of u+ = f (y+) in the boundary layer
The viscous sublayer in the range of with the dependency
Equation 2-11
is the one closest to the wall. The transition layer or buffer layer in the range of with the dependency [
√
√(
(
√
Equation 2-12
with ( Equation 2-13
is the one in the middle.
– 11 –
)]
(
)
Modeling a Turbulent Boundary Layer with OpenFOAM
The logarithmic overlapping region also often referred to as log-law region, in the range of with the dependency
Equation 2-14
is the connection between the boundary layer and the main flow. The constant C+, also referred to as C, is set to the value of 5.0. The literature values differ, as C+ can have any value in between 5.0 and 8.0, depending on the surface roughness. The parameter definitions match the ones given by NASA. The only deviation is in the formula for the theoretical u+(y+) plot. Unlike Equation 2-11 to Equation 2-14, NASA states the formula [
(
)]
Equation 2-15
and specifies (Coles, D., J. Fluid Mech. 1:191-226, 1956 and Coles, D., RAND Corp Rept. R-403-PR, 1962) as reference. (3) Figure 2-2 shows a diagram, comparing NASA’s given theoretical u+(y+) plot data to a plot made with the formulas from Schlichting; Gersten (4).
Figure 2-2: Comparison of two theoretical u+(y+) approaches
– 12 –
Bachelor Thesis by Björn Schilling
3
Setting up the Working Environment
3.1
Setting up the Operating System To run OpenFOAM and other required open source tools in a proper manner it is important to use the appropriate operating system. Since OpenFOAM is an open source code, the development aims for usage on open source operating systems. There is an OpenFOAM version compiled for Windows, but OpenFOAM in general runs more stable and faster on open source operating systems and the versions are more up to date. Some of the other required open source tools are not available for Windows. In this case the recommended open source operating system is Ubuntu. Ubuntu is widely distributed throughout the community and most installation guides and already compiled software downloads are made especially for Ubuntu, also its very friendly for beginners. Ubuntu is a GNU/Linux-kernel based operating system. The kernel is the base of an operating system, it communicates from higher programs to the basic machinery of a personal computer and vice versa.
3.1.1. Preparation of a Windows Computer for a Dual Boot Ubuntu Installation Dual boot in this case means that one can choose between running Windows or Ubuntu during the computer’s boot process. First one has to make sure that there is enough unpartitioned space for the Ubuntu installation on the computer’s hard disk drive (HDD) or solid state drive (SSD). Unpartitioned spaces are areas of a data storage device, which are not allocated to any partitions. A partition is a clearly defined area of a data storage device which is formatted with a specific file system. A file system defines the structure and logic rules used to manage the groups of information on a data storage device. There should be about one to two times the amount of the random access memories (RAM) size, of free space available to become Ubuntu’s swap partition. Ubuntu uses the swap partition to store RAM data when the RAM gets overfilled. Using the hard disk to store RAM data makes the accessing software very slow and should be avoided when doing computational fluid dynamics, though it is better to be on the safe side by applying two times the amount of the RAM to the swap partition. The root partition, also referred to as “/” by Ubuntu, is where Ubuntu’s operating system files are stored. This partition should be about at least 8 GB to 15 GB, up to 30 GB is useful. (5) The third partition is the partition for the home folder, referred to as “/home” by Ubuntu. It is basically not necessary to have the home folder separated from the root partition, but the operating system will crash when its partition is full. This can easily be avoided by having the home folder (where most CFD programs are installed to and the user’s files are stored) on another partition. For simulating with OpenFOAM the /home directory should be about 50 GB at least but more is always better. If there is a SSD available in the targeted computer, most importantly the swap partition, but also the root partition and if possible even the home partition should be located on it. The exact partition configuration will be done from within Ubuntu’s operating system installation. Only the sum of unpartitioned space for the planned partitions must be given on the targeted physical HDD / SSD beforehand. One usually has to downsize an existing partition, if possible not the one where Windows is installed on. In case there is no other partition with enough free space except the one – 13 –
Modeling a Turbulent Boundary Layer with OpenFOAM
Windows is installed on, one has to make sure to leave as much free space to the Windows partition as one might need in the future, but at least 10 GB. With this in mind one can start to prepare the free space on the corresponding drives. EaseUS Partition Master Free (6) is a nice freeware for this task. It is recommended to have a backup of all the important files, stored on another data storage device, the best option is an external device that can be disconnected during the whole process until Ubuntu is up and running. A graphical step by step example of a possible partition set up for a computer with a preinstalled Windows on a 265 GB SSD is given in Figure 3-1, Figure 3-2 and Figure 3-3. The corresponding file systems for the partitions are given in the brackets.
Windows (NTFS)
256 GB
Figure 3-1: Existing 256 GB SSD with a Windows partition
Windows (NTFS) Ubuntu root (ext4)
80 GB 140 GB
Ubuntu swap (linuxswap)
16 GB
Ubuntu home (ext4)
20 GB
Figure 3-2: Planed 256 GB SSD partition set up
– 14 –
Bachelor Thesis by Björn Schilling
116 GB
140 GB
Windows (NTFS) unpartitioned
Figure 3-3: Prepared 256 GB SSD with a downsized Windows partition
In case that the targeted computer is booting in the so-called UEFI mode, more preparations will be necessary. UEFI boot is the successor to BIOS boot and should be the first choice if there is the option. (7) It is important to install Ubuntu in the same boot mode as the preinstalled Windows. (8) To find out about the computer’s boot mode, one has to press Windows + R, and enter msinfo32 into the appearing window, the needed information will be given in the BIOS Mode entry in a list in another appearing window. (9) If the issue indeed is an UEFI boot system, the corresponding preparation depends on the installed Windows version. In Windows 8 and Windows 10, Fast Startup must be turned off. To turn off fast startup, one has to go to the Windows Power Options, click on Choose what the power buttons do, then click on Change settings that are currently unavailable, uncheck the Turn on fast startup check box, save the these settings, shut the computer down and start it again. Using the Restart function will not apply the changes, done to the fast startup options. (10) In Windows 7, 8 and 10 one should also disable hibernation by executing powercfg /h off as admin from a command prompt. (11) (12) To open a command prompt in administrator mode in Windows 7, one has to type cmd into the run box (the input field at the very bottom of the start menu), and run cmd.exe as admin. To open a command prompt in admin mode in Windows 8 or 10, one has to press Windows + X and click on Command Prompt (Admin). (13) For all Windows versions the fast-boot should be disabled in the EFIBIOS. (11) Instructions on how to get into the BIOS menu should be given at the motherboard manufacturer’s website. See also Chapter 3.1.3, for further information on motherboards and their correlation to the early booting process.
– 15 –
Modeling a Turbulent Boundary Layer with OpenFOAM
3.1.2. Preparation of a Bootable Ubuntu USB Stick on Windows To start, one has to download Ubuntu (14) from the official website. The selection between the 32 bit Ubuntu version and the 64 bit Ubuntu version depends on the targeted computer’s processor (32 bit or 64 bit). If there are uncertainties, it’s better to double-check with the manufacturer’s website, but if the computer was bought later than 2011 or has more than 4 GB RAM, it usually has a 64 bit processor built-in. The second version specification is desktop, that is the casual user version, the counterpart would for example be the server version. Now there are still different 64 bit desktop Ubuntu versions, as there are different 64 bit desktop Windows versions (XP, 7, etc.). For newcomers it is recommended to take the latest LTS (long term support) version. Only if the latest LTS version is younger than 3 months one should consider taking the previous LTS version, as many installation guides and programs will not be available for the latest LTS version so shortly after its release. In the second step the downloaded Ubuntu image (.iso-file) must be copied on to the USB stick. The USB stick should have 2 GB or more. There are many possible tools for this task, the official Ubuntu website recommends the open source freeware Rufus (15). Within Rufus one has to select the targeted USB stick in the Device drop down menu, click the CD Rom icon in the Create a bootable disk usingline, select the downloaded Ubuntu image and confirm it by clicking Open. After this, the Rufus window should look like in Figure 3-4. After clicking Start, one has to click Yes to the Syslinux download, write in ISO Image mode and confirm the formatting warning. (16) Also if following these guidelines from the official Ubuntu website will do fine, removing the check mark from the Quick format check box or activating the Check device for bad blocks check box will not do any harm, especially in this sensitive case.
Figure 3-4: Rufus, prepared settings
– 16 –
Bachelor Thesis by Björn Schilling
3.1.3. Ubuntu Installation from a Bootable USB Stick To start the Ubuntu installation, the targeted computer must be turned off and a bootable Ubuntu USB stick must be inserted into one of its USB slots. The next step is to boot the computer from the Ubuntu USB stick. When starting the computer, the very first screen that comes up is an often colorful screen, designed by the motherboard’s manufacturer, (not to be confused with the monitor’s start up screen). The motherboard is the main printed circuit board within a computer, it connects all the other components like the CPU (Central Processing Unit), the data storage devices and the RAM to each other. There should be some information displayed on this motherboard screen, on how to get into the motherboard’s boot menu / boot options. Usually one of the F1 to F12 keys, the Esc key or the Delete key needs to be pressed quickly while the motherboard screen is displayed, to interrupt normal start up and switch to boot options. If it appears to not be as easy as described to get into the boot options, it is also possible to obtain the needed information from the motherboard manufacturer’s website, or to change the boot priority from within the BIOS setup. The BIOS setup is a graphical interface for the motherboard’s operating system, it is entered in the same way as described for the boot menu, only the keys differ. Also the boot-key.org –website (17) might be a good place to find the key to the boot menu. (18) From within the Boot menu one has to select the USB stick to boot from. The USB stick is also often referred to as “Flash”. The next screen should display an option menu, provided by the GRUB boot loader. From these options one has to choose Install Ubuntu. After the Ubuntu installation has been loaded, the real installation begins with the language selection. It is recommended to choose English because most installation guides and how-to guides will be available in English. It is a lot easier and reassuring to follow an English guide on an English operating system, as the button- and menu labeling will be the same as in the guide. On the next screen one can additionally choose to Download updates while installing Ubuntu, and to Install third-party updates for graphics and Wi-Fi hardware, Flash, MP3 and other media. Downloading updates during the installation will take additional time, depending on the speed of the Computer’s internet connection and can also be done easily after the Ubuntu installation. It is recommended to install the third-party software, as they are a basic requirement to watch tutorial videos online. From the Installation type screen one has to choose Something else, to be able to set all partitioning options manually. In the following window one can start to arrange the partitions, according to the partitioning guidelines from Chapter 3.1.1. To add a partition one has to select the targeted free space from the targeted drive and click on the plus button. Please see Figure 3-6, Figure 3-7 and Figure 3-8, for the exact partition settings, referring to the partition set up from Chapter 3.1.1. It is important not to touch any partitions without knowing what they are needed for. In case of an UEFI installation, one has to make sure that one has an EFI System Partition (ESP) set up for the EFI-mode boot loader and related files. If there already is an ESP from a preinstalled Windows, this one should be used for Ubuntu as well. If there is no other operating system preinstalled, one has to manually create an ESP. The ESP must have a minimum size of 100 MB, 200 MB are recommended. The file system needs to be FAT 32 and the partition needs a boot flag, but the Ubuntu installer will do both of these settings automatically. Please see Figure 3-5, for the exact EFI partitioning settings. (8) (11) (19)
– 17 –
Modeling a Turbulent Boundary Layer with OpenFOAM
It is recommended to place the partitions in the order of the figures below on the drive, or to read more online about the partitioning differences between HDDs and SSDs, regarding operating systems.
Figure 3-5: Exemplary partitioning settings for the EFI partition
Figure 3-6: Exemplary partitioning settings for the swap partition
Figure 3-7: Exemplary partitioning settings for the root partition
– 18 –
Bachelor Thesis by Björn Schilling
Figure 3-8: Exemplary partitioning settings for the home partition
As Device for boot loader installation one should choose the physical drive on which the other operating system is installed on, or in case of an Ubuntu-only system the physical drive with the new root partition. In case of an UEFI installation it does not really matter as the EFI partition will be used for the boot loader any way. (11) After confirming the partitioning changes one has to select one’s time zone, for the corresponding locational settings to be set automatically. The following window refers to the keyboard layout. Clicking on Detect Keyboard Layout and following the given instructions is a very easy and reassuring way to set the correct layout. In the next window one has to adjust the personal settings. It is recommended to name the computer in a way so it can easily be identified. The chosen password will be the root password later on, so it is recommended to set a save but memorable and quickly writable one, as one will have to enter it many times, not only for login issues. After rebooting the computer and running the updates, the Ubuntu Installation is finished.
– 19 –
Modeling a Turbulent Boundary Layer with OpenFOAM
3.2
Setting up the Simulation Software OpenFOAM is mainly used as a solver. A fully functional CFD working environment consists of three major components, the pre-processor, the solver and the post-processor. A closer breakdown on this is given in Table 3-1.
Pre-processor
Solver
- Creation, import and conversion of geometry - Derivation, import and conversion of meshes
Post-processor
- Solving of numerical equations on the basis of the data given by the preprocessor
- Reading, visualization and conversion of the data output computed by the solver
- Preparation of boundary zones and boundary conditions Table 3-1: General composition of a CFD working environment
Several different tools are needed to build up such a basic fluid simulation environment around OpenFOAM. In this thesis only freeware tools and open source tools are considered. Since the up-todateness and compatibility of these tools is highly dependent on the developing community or person, it is hard to define a good long term tool composition. A for the time-being and the near future good composition and a short categorization of its tools is given in Table 3-2. Tool name
Tool categorization
Used Version
OpenFOAM
CFD Solver
3.0.1
ParaView
Post-processing (Visualizing)
4.4.0
SALOME
Geometry modeling, meshing and converting
7.7.1
PyFoam
Residual plotter and more
0.6.5
cfMesh
Advanced meshing
1.1.1
HelyxOS
Broad GUI for OpenFOAM with basic pre- and post-processing functions
2.3.1
Table 3-2: Basic open source tool composition for working with OpenFOAM on Ubuntu
OpenFOAM To install OpenFOAM on Ubuntu one has to go to the openfoam.org website (20), to find out about the current OpenFOAM version. As in the selection of the Ubuntu version, the release date of the current OpenFOAM version should be checked and evaluated against the background of decreasing availability of additional tools (especially PyFoam) and workflow descriptions from forums, for very young releases of OpenFOAM. Crucial for the intensity of changes done to the software is the position of the version number’s changing digit in comparison to the former version number. A digit standing on the left side indicates greater changes as a digit further right. OpenFOAM 4.0 is for example the following major release to OpenFOAM 3.0.1.
– 20 –
Bachelor Thesis by Björn Schilling
The simplest and recommended method to install the chosen OpenFOAM version is to follow a step by step instruction from openfoamwiki.net (21). It is very important to double-check that both the OpenFOAM version and the Ubuntu version from the instruction guide, are matching to the chosen OpenFOAM version and the used Ubuntu version.
ParaView A well implemented version of ParaView is already included in the OpenFOAM installation, so an individual installation is not necessary.
Salome The installation files for the current Salome version can be found and downloaded at the salomeplatform.org website (22). In the case of Salome version 7.7.1 it was possible to use an installation guide (23), only by changing the Salome version number in the copy-paste steps from 7.4.0 to 7.7.1.
PyFOAM PyFoam should be installed according to the latest installation guide (24) at openfoamwiki.net (21). This webpage is maintained and kept up to date by the developer of PyFoam, Bernhard Gschaider himself.
cfMesh The official download page (25) for the latest free cfMesh version is at sourceforge.net. The link given in (25) leads to an overview of available cfMesh versions. By clicking on the latest version, one will be redirected to an overview of different variants of the latest version. Clicking on the linux.run variant will start the download of the variant which is already precompiled for Linux. Precompiled means that it is not necessary to manually translate the program code into executable machine code. After the download has finished the file should be moved to the Ubuntu user’s Home folder. Then one has to make sure to have execution rights on the file. The first line in Figure 3-9 gives every user of the computer the rights to read, write and execute the exemplary file “cfMesh-1.1.1-linux.run”. The second line will execute the file. If an already existing installation of OpenFOAM is launched directly from the .bashrc, this may interfere with the cfMesh installer (26). If OpenFOAM was installed according to the openfoamwiki.net (21) instructions (27), OpenFOAM is launched by an alias, that means by an additional terminal command, and should not interfere with the cfMesh installer.
Figure 3-9: Terminal entries to change the access rights of the file “cfMesh-1.1.1-linux.run” and execute it
By the execution of the cfMesh-version-linux.run file a graphical interface is opened, to guide through the installation. It is recommended to additionally install the documentation and the tutorials, as shown in Figure 3-10.
– 21 –
Modeling a Turbulent Boundary Layer with OpenFOAM
Figure 3-10: cfMesh's graphical installation interface with recommended settings
HelyxOS To install HelyxOS (without OpenFOAM Kernel) one should start off by following the official installation guide (28), provided by engys ltd. (29), the contributing company of HelyxOS. Since HelyxOS v.2.3.1 needs a working version of OpenFOAM-2.4.0, this must be installed afterwards, following the corresponding installation guide (30) at openfoamwiki.net (21). The last step is to set the right preferences, for OpenFOAM-2.4.0 and the corresponding ParaView installation, in HelyxOS. To do so one has to open a terminal window and activate the OpenFOAM2.4.0 shell environment. If OpenFOAM-2.4.0 was installed according to the corresponding installation guide (30) at openfoamwiki.net (21), the shell environment is activated by executing of240. Then one has to run the commands echo $WM_PROJECT_DIR and $ParaView_DIR to get the directory paths, which are needed later. Figure 3-11 shows an exemplary execution of the commands described above and the expected return. Further one has to start HelyxOS as described in the corresponding installation guide (28), go to Edit/Preferences and enter the directory paths according to the readouts from the terminal commands above. (31) In addition one has to add /bin/paraview to the corresponding ParaView entry, as it is asked for the destination of ParaViews’s executable. The associated exemplary entries are given in Figure 3-12. To work with HelyxOS, it might be necessary in some cases to first activate the OpenFOAM-2.4.0 shell environment in the Terminal, before executing HelyxOS from it.
– 22 –
Bachelor Thesis by Björn Schilling
Figure 3-11: Terminal entries to enter the OpenFOAM-2.4.0 shell environment and readout the exemplary directory paths, needed in HelyxOS (31)
Figure 3-12: Preference settings in HelyxOS with exemplary inserted directory paths
– 23 –
Modeling a Turbulent Boundary Layer with OpenFOAM
4 Reproduction of NASA’s 2D Zero Pressure Gradient Flat Plate Validation Case When it comes to working with Ubuntu for the first time, it is good advice to keep a personal list of already used commands, with a small description of every command and some of the command’s most commonly used syntax parameters. Ubuntu is highly customizable and there are various settings, shortcut keys and terminal commands for almost everything, to ease and improve one’s workflow. They can easily be found, using an online search engine.
4.1
Setup of the Basic Case Structure At first the decision of the used solver is made. The rhoSimpleFoam solver is chosen, as it is a solver for steady-state solutions for turbulent flow of compressible fluids (32). An overview of the available solvers and a brief description is given in Chapter 3.5 of the OpenFOAM User Guide (32). As it is common practice, the next step is to go to the OpenFOAM tutorials folder, which is in the installationDirectory/OpenFOAM/OpenFOAM-version-directory. From there, one has to navigate to the folder of the chosen solver and select the case most similar to the own problem. If the folder contains an Allrun script the complete tutorial case can be executed by opening a terminal in the folder, activating the OpenFOAM shell environment and running the Allrun script by executing ./Allrun . A terminal can be opened in a folder easily from the window, by right-clicking in the folder-window and selecting Open in Terminal. To have a graphical view of the tutorial case with ParaView, one would have to run the paraFoam command with the same preconditions as the ./Allrun command. The best fit for NASA’s 2D Zero Pressure Gradient Flat Plate is the squareBend tutorial case, found in installationDirectory/OpenFOAM/OpenFOAM-version/tutorials/compressible/rhoSimpleFoam. The squareBend tutorial case directory is copy-pasted into the preferred working directory and renamed in a descriptive manner, for example 2DZP69x49. It is important that there is no blank character in the case folder’s naming. The case directory contains three basic folders which again contain all the information input for the solver. For a better overview over the folder and file placement of the 2D Zero Pressure Gradient Flat Plate case directory, a graphical layout of the fully modified case is given in Figure 4-1. The 0 folder contains x-csrc text-files, also called field files, for the start value of every regional adjustable variable. These files can be read and manipulated with a range of text editors, preferable the pre-installed GNOME-Editor also known as gedit, in which the file is automatically opened in by double-clicking it. The constant folder contains the x-csrc files for the basic settings and inputs, like the mesh, physical and chemical information and files to set the general solution algorithms for the problem. An important file
– 24 –
Bachelor Thesis by Björn Schilling
in the polymesh folder in the constant folder is the boundary file, in which the boundary settings are defined for the individual cell regions. The system folder contains the text files to control the solver and handle the output.
Figure 4-1: Folder and file placement of the - 2D Zero Pressure Gradient Flat Plate - case directory
– 25 –
Modeling a Turbulent Boundary Layer with OpenFOAM
4.2
Mesh Conversion and Import For absolute comparability of the results, the original NASA mesh is used in this OpenFOAM simulation. NASA provides publicly available downloads (33) of the mesh in various high grid resolutions. To save computing time while testing various OpenFOAM settings, a mesh with coarse grid resolution is used (69 x 49 cells). A visualization of the grid is given in Figure 4-2.
Figure 4-2: Visualization of the 69 x 49 NASA grid structure (33)
The NASA grids are available in two file formats, PLOT3D and CGNS. The OpenFOAM solver can only read mesh files in the OpenFOAM mesh format. Before inserting any new mesh data into the constant/polyMesh directory, the original polyMesh folder from the squareBend tutorial is deleted, to make sure that there are no unintended intersections with the new mesh data. OpenFOAM 3.0.1 comes with a PLOT3D conversion tool, executed by the command line plot3dToFoam, as described in Chapter 3.6 of the OpenFOAM User Guide (32). The additional syntax option –help can be used to get further information about commands and tools in general. Using the corresponding command line plot3dToFoam –help returns a list of the other available syntax options for this command. In case of NASA’s plot3d file, the additional syntax option –noBlank is needed to run the conversion. The boundary patch zones cannot be translated, so the tool adds them to one patch which includes all outward faces. With the autoPatch command (32) this patch is split by angle into six independent patches, one per side of the rectangular continuum. A new mesh can always be checked for quality, using the checkMesh OpenFOAM command. To identify the patches, the case is opened in ParaView. To prevent ParaView from crashing because of the empty case, the p and U Volume Fields are unchecked before clicking Apply in the Properties tab of the Pipeline Browser. As one can see in Figure 4-6, the bottom surface needs to be split into two separate boundaries at the origin of the x-axis. Since it is a 2D case, the bottom surface has multiple cell faces only along the x-axis. The approach here is to manually edit the boundary file in the caseFolder/constant/polyMesh directory. The number of cells of the bottom patch is decreased by a few, by editing the nFaces entry of the corresponding patch. – 26 –
Bachelor Thesis by Björn Schilling
At the same time a new patch is created by copy-pasting the bottom patch. For clarity, the new patch is renamed. The first digit after the header declares the number of patches within the file and is always adjusted to the correct value. The number of cells detracted from the original bottom patch, is now assigned to the new patch. The start face of the new patch is guessed, taking the start face and the number of detracted faces from the original bottom patch into account. The correct outcome is found empirically, by reviewing the results in ParaView. Creating a SpreadSheetView in ParaView is very helpful to determine mesh surfaces and the Cartesian coordinates of their defining points. A graphical example of the boundary file manipulation and the visualized outcome in ParaView is given in Figure 4-3. The defaultFaces patch entry, which does not include any faces, is deleted from the boundary file.
Figure 4-3: Manual adjustments to the boundary file and the visualized outcome in ParaView
Another approach is to download the CGNS file and prepare it in Salome. The CGNS file is imported into Salome by clicking file/import/CGNS file from within Salome’s meshing environment. The imported CGNS file has no surfaces, so those are derived from the volume mesh, using the Create boundary elements tool. Please see Figure 4-4 for the exact tool configuration. It is important that the mesh, also referred to as Base in the example, is selected in the Object Browser.
– 27 –
Modeling a Turbulent Boundary Layer with OpenFOAM
Figure 4-4: Recommended settings to create faces from a volume mesh in Salome
The outward faces are automatically joined together in one group. For the boundary zones to be detectable by the OpenFOAM conversion tool, they must be assigned to separate Groups of Faces. This is done manually with the Create Group tool, as exemplarily shown for the inlet boundary zone in Figure 4-5. The groups of nodes, which are given by NASA and named as the corresponding boundary condition in the area, are used as orientation when defining the boundary face groups.
Figure 4-5: Preparation of the inlet boundary zone in Salome by defining the corresponding Group of Faces
– 28 –
Bachelor Thesis by Björn Schilling
In the next step the now useless Groups of Nodes and the all including face group, which was called allSides in the example, are deleted. The mesh is converted to a UNV file by File/Export/UNV file and saved into the OpenFOAM 2D Zero Pressure Gradient Flat Plate case directory. The conversion is easily done by the ideasUnvToFoam OpenFOAM command (32).
4.3
Adjustment of the Case File Settings The entries in the former squareBend tutorial case’s x-csrc text-files and in the replaced mesh x-csrc text-files are edited to fit the required boundary conditions, as defined by NASA in Figure 4-6. The reference Temperature of 540 R is converted to 300 K and 26.85 °C, using Equation 4-1 and Equation 4-2.
Figure 4-6: Boundary conditions of NASA's 2D Zero Pressure Gradient Flat Plate Validations Case (3)
Equation 4-1
Equation 4-2
Since there is no graphical user interface in OpenFOAM, that shows the different options for a setting in a dropdown menu, it is common practice to start a simulation with an incorrect keyword in a text file, to force an error message that contains a list of possible keywords for this keyword entry.
– 29 –
Modeling a Turbulent Boundary Layer with OpenFOAM
A good overview and description of commonly needed boundary conditions can be found in the Boundary conditions in OpenFOAM subsection (34) of the OpenFOAM® Training – CFD Support website (35).
4.3.1. Constant Directory thermophysicalProperties The comparison of values from the mixture sub header concludes that the file properties for air are already implemented. The molWeight is dimensionless set to 28.9 with a number of moles nMoles of 1. These values are accepted as consistent with the value of 28.9586 g/mol, given for dry air on page 196 of the VDI Wärmeatlas (36). From this point onward the VDI Wärmeatlas (36) is referred to as VDI-WA. The cP value of 1007 is also considered as consistent with the cP values of 1006 J/kg K at 20 °C and 1007 J/kg K at 30 °C, given on page 197 of the VDI-WA (36).
turbulenceProperties In the turbulenceProperties text file, the RAS turbulence model is changed from kEpsilon to kOmegaSST, by editing the RASModel entry as shown in Figure 4-7. Turbulence modeling can be switched off for the simulation by changing the turbulence entry from on to off. An overview of the available turbulence models and their corresponding entries is given in Table 3.9: Libraries of RAS and LES turbulence models in Chapter 3.7 of the OpenFOAM User Guide (32).
Figure 4-7: Selection of the RAS turbulence model
polyMesh/boundary The base types of each boundary zone are defined in the boundary text file, accordingly to their function in Figure 4-6. The inlet, outlet and topwall patch zones are assigned to be patches and the bottomwall patch zone is assigned to be a wall, as further detailed functionality is applied later, in the field files of the 0 directory. The sidewall1 and sidewall2 patch zones are assigned to be empty, as it is common practice for 2D simulations. The startsymmetry patch zone is assigned to be a symmetryPlane. A full list of possible basic patch types is given in Table 5.1: Basic patch types in Chapter 5.2 7 of the OpenFOAM User Guide (32). A graphical overview of the fully modified 2D Zero Pressure Gradient Flat Plate’s boundary file is provided in Figure 4-8.
– 30 –
Bachelor Thesis by Björn Schilling
Figure 4-8: Modified boundary zones of the 2D Zero Pressure Gradient Flat Plate boundary mesh file
4.3.2. 0 Directory The parameter’s dimensions of every field file are given in the first line beneath the header. Each value sets the power of a SI-Unit. They are ordered in the way kg / m / s / K / mol / A / cd. Figure 4-9 shows exemplarily the dimension declaration of a pressure field file, set to kg m-1 s-2. (32)
Figure 4-9: Dimension declaration of a pressure field file
– 31 –
Modeling a Turbulent Boundary Layer with OpenFOAM
alphat The alphat field file contains the volume and patch values for the turbulent thermal diffusivity. The values and functions are kept the same as in the squareBend case and logically transferred to the new patches. The numerical patch type zeroGradient is set on patches, which do not influence the variable’s value in the volume. As in the boundary file, the sidewall patch zones are set to empty for the 2D simulation, likewise is the startsymmetryplane patch zone set to symmetry. The Prt entry of the compressible::alphatWallFunction sets the turbulent Prandtl number. A copy of the fully modified alphat file and every other field file is given in the appendix.
k The k field file contains the volume and patch values for the turbulent kinetic energy. The values and functions are modified in the exact same manner as in the alphat file. Since the values from the kqRWallFunction of the bottomwall boundary are recalculated in the next time step, the initial value is just a guess to start the simulation.
nut The nut field file contains the volume and patch values for the turbulent viscosity. The values and functions are modified in the same manner as in the alphat file. Since the nutkWallFunction of the bottomwall does not return a calculated value for every cell in the next time step, the initial entries from the squareBend case are removed to ensure universal comparability by running the program on the standard settings.
omega The omega field file contains the volume and patch values for the specific dissipation rate. There is no omega file in the square bend tutorial, so the reference file is taken from the installationDirectory/OpenFOAM/OpenFOAM-version/tutorials/compressible/rhoPimpleFoam/ras /cavity/0 folder. Since the cavity case has no inlet to use as a reference, the compressible::turbulentMixingLengthDissipationRateInlet (37), found on the CFD Support website (35), is chosen as the best fitting option. From the produced error message, the turbulentMixingLengthDissipationRateInlet is found to be the corresponding option in OpenFOAM3.0.1. The initial value estimation of 126 s-1 is found empirically from a former simulation run, where the inlet value converged to 126.673 s-1.
p The p field file contains the volume and patch values for the pressure. The values and functions are modified in the same manner as in the alphat file. The reference pressure (Figure 4-6) of 101325 Pa is taken from the VDI-WA (36), where it is given as the reference pressure for the dry air values, which are also used as a reference in the thermophysicalProperties. Since the CFD-concept velocity-inlet/pressure-outlet is used in this simulation, the reference pressure is only applied to the outlet and set as an initial value for the internalField. – 32 –
Bachelor Thesis by Björn Schilling
T The T field file contains the volume and patch values for the temperature. The values and functions are modified in the same manner as in the alphat file. The temperature at the outlet is set to the reference temperature of 300 K and the inlet temperature is set to 302.4 K, which is the 1.008 multiple of the reference temperature as specified in Figure 4-6.
U The U field file contains the volume and patch values for the velocity. The values and functions are modified in the same manner as in the alphat file. Unlike the other field files, the U field file is defined as volVectorField and the values are set separately for every direction, as shown in Figure 4-10.
Figure 4-10: Velocity settings at the inlet boundary: u = 69.5 m s-1, v = 0 m s-1, w = 0 m s-1
The value of 69.5 m s-1 is calculated based on the Mach number of 0.2 and the reference temperature of 300 K, given in Figure 4-6, using the formulas:
Equation 4-3
√ Equation 4-4
and
Equation 4-5
With the substance properties of air at 30 °C: found in the VDI-WA (36). The value difference to the corresponding substance properties of air at 20 °C is so insignificantly small that it is not necessary to interpolate to the reference temperature of 26.85 °C.
4.3.3. System Directory controlDict The controlDict case control file defines the basic solver settings. The application entry sets the solver, in this case the rhoSimpleFoam solver.
– 33 –
Modeling a Turbulent Boundary Layer with OpenFOAM
The startFrom entry indirectly declares the time folder for the initial values. The keyword startTime points to the startTime entry in the next line, which directly declares a time folder. The corresponding file segment is represented in Figure 4-11. For a new simulation this is the 0 directory. The simulation can also start from a different time directory, the latestTime keyword for the startFrom entry for example points to the latest time directory in the case folder, to be consulted for the initial conditions. The stopAt entry with the endTime keyword behaves similar to startFrom and startTime.
Figure 4-11: Declaration of the initiation directory
The deltaT entry sets the calculated time steps for the solver. In combination with the endTime entry this affects only the number of calculation steps, for steady state simulations. The writeControl entry indirectly declares the criteria for the solver, when to create a new time directory, which will be available for post-processing later. The timeStep keyword for example correlates to the amount of calculated time steps, whereas runTime correlates to the preceded simulated time and clockTime to real time. The writeInterval entry in the line beneath then sets the exact amount of time steps or time. All keyword entries and options are well described in Chapter 4.3 of the OpenFOAM User Guide (32). A copy of the controlDict and every other case control file is given in the appendix.
decomposeParDict The decomposeParDict case control file is needed to run the simulation, using multiple CPUs in parallel. To do so, the mesh is divided into several sub volumes which are distributed to separate CPUs for computing. There are several methods available to set the exact splitting parameters. Those methods can be found well described in Chapter 3.4.1 of the OpenFOAM User Guide (32). The easiest method is applied by the keyword scotch in the method entry. Scotch needs no geometric input from the user and aims to minimize the number of processor boundaries. (32) Only the numberOfSubdomains entry is needed by scotch, to define the number of volume parts which the mesh is split into.
fvSchemes The fvSchemes case control file sets specific numerical schemes for the solver. A div(phi, omega) Gauss upwind entry is implemented manually under the divSchemes sub header, as it is required by the kOmegaSST RAS model. A wallDist sub header is created at the end of the document, as it is necessary for the kOmegaSST model. Different methods can be set for the wall distance calculation here. The meshWave method is used, since it was the standard method in previous OpenFOAM versions and works great for orthogonal meshes. (38) The Poisson keyword, which refers to the usage of the Poisson’s equation for the wall distance calculation, is used in a separate simulation and is accepted to return no significant deviations for this mesh. (39) The fully implemented wallDist sub header is shown in Figure 4-12.
– 34 –
Bachelor Thesis by Björn Schilling
Figure 4-12: Setting of the wall distance calculation method
fvSolution The fvSolution case control file sets the equation solvers, algorithms and tolerances. (32) Under the solver sub header, the epsilon entry is removed and replaced by the implementation of omega. Beneath the SIMPLE sub header, the density limiting entries rhoMin and rhoMax are removed completely. The residual convergence criteria in the residualControl entry are set to at least 1e-9, so the simulation’s residuals become as low as possible. The relaxation factors are kept the same but are important to mention, as manipulating these values is a good approach to enhance the stability of a simulation.
4.4
Execution and Post-Processing of the Simulation To start the simulation, one has to open the case directory in a terminal, activate the OpenFOAM shell environment and execute the solver command, in this case rhoSimpleFoam. To be able to watch the residuals during the run one has to use the pyFoamPlotRunner.py rhoSimpleFoam command instead, which accordingly requires PyFoam to be installed. The residuals and the continuity of the simulation are given in Figure 4-13 and Figure 4-14. To run the case in parallel a decomposeParDict must be in place in the system directory. Then one has to execute decomposePar first, followed by mpirun –np 6 rhoSimpleFoam > log& with the digit set to the number of sub domains, as it is stated in the corrsponding decomposeParDict entry. To watch the residuals of the parallel run, one has to use the pyFoamPlotWatcher.py log command. When the simulation has finished, the separately computed results are put together using the reconstructPar command.
– 35 –
Modeling a Turbulent Boundary Layer with OpenFOAM
Figure 4-13: Residuals of the reproduced 2D Zero Pressure Gradient Flat Plate Validation Case
Figure 4-14: Continuity of the reproduced 2D Zero Pressure Gradient Flat Plate Validation Case
The wall shear stress is additionally computed after the simulation run by using the wallShearStress OpenFOAM command in the case directory. Since some of these commands take some time to type and might be used several times, it is useful to create aliases for them in the .bashrc file. To access the .bashrc file, one has to open the Ubuntu home directory in a terminal and execute the gedit .bashrc command. Since the .bashrc file is a sensitive operating system file, one should be careful when editing it. An example of some useful alias entries is given in Figure 4-15. Depending on the used software installation guides, some alias entries as for example the of301 alias should already be in place.
– 36 –
Bachelor Thesis by Björn Schilling
Figure 4-15: Useful alias links for the workflow optimization
Once the simulation stops and at least one time directory is written, the results can be viewed in paraView by executing the paraFoam command from a terminal in the case directory within the OpenFOAM shell environment. The required information is separated by using the Slice tool twice at the defined position, so first a plane and hereafter a line is separated for plotting, as shown in Figure 4-16. The data is plotted by usage of the Plot Data tool, which grabs the data from every cell and therefore exceeds over the Plot Over Line tool, in terms of resolution on the small cell area near the bottomwall patch. To extract the data one has to highlight the PlotData1 entry in the Pipeline Browser and click on File/Save Data. By saving the data to a CSV File for example, the data can easily be accessed by Libre Office Calc, a tabular calculation tool which comes with Ubuntu. The wall shear stress is extracted similarly from the bottomwall patch.
Figure 4-16: Data processing in ParaView
– 37 –
Modeling a Turbulent Boundary Layer with OpenFOAM
5
Results and Conclusion Figure 5-1 shows the final outcome of the NASA 2D Zero Pressure Gradient Flat Plate Validation Case OpenFOAM-reproduction, in comparison to NASA’s simulation and the theories from Chapter 2. The graph is calculated by usage of Equation 2-5, Equation 2-6 and Equation 2-9 from Chapter 2. The inserted kinematic viscosity of υ = 1.262e-5 m2 s-1 of air at 30 °C is taken from the VDI-WA (36).
Figure 5-1: Comparison of the OpenFOAM simulation results to other references
The differences of the individual graphs in the y+ range between 1 and 10 are very small but increasing in the y+ range from 10 to 1000. In the y+ range from 1000 to 5000, the graphs are clearly different, except for the theory used by NASA and the results of NASA’s simulation. To make the correlations more obvious, Figure 5-2 shows the same data as Figure 5-1 until y+ = 9000, but with exchanged x- and y-axis and without logarithmic scaling. Figure 5-2 can be seen as a dimensionless velocity profile.
– 38 –
Bachelor Thesis by Björn Schilling
Figure 5-2
The y+ section from 1000 to 5000 represents the transition zone from the logarithmic overlapping region (Chapter 2) of the boundary area into the main flow’s free turbulent stream area. As can be seen in Figure 5-2, both the OpenFOAM plot and the theory plot by Gersten (4) define a rather smooth transition zone, unlike the results found by NASA. Though, both the OpenFOAM and the NASA simulation reach the main flow’s mean velocity in the relatively close y+ section between 3000 and 4500. The theoretical plot by Gersten (4) agrees in this point with the OpenFOAM plot, as it reaches OpenFOAM’s approximate final u+ value at a y+ value of about 4000. In contrary to that, NASA’s simulated approximate final u+ value coincides with the Gersten; Herwig theory (4) at a y+ value of at least 10000, as derivable from Figure 5-1. The reason for this major divergence in the u+ values is assumed to originate from the wall shear stress component in the u+ calculation, as the velocity and the density are assumed to be reliable. Gomez (40) suits this assumption to the point that OpenFOAM results have much lower u+ values than the experimental/DNS data in the wake region of the boundary layer because of a deviation in OpenFOAM’s velocity averaging calculation very close to the wall, which follows through into the wall shear stress calculation. Though, this is stated in the context of a Launder-Reece-Rodi isotropization of production (LRR-IP) model. Another comparison by Gomez (40) between OpenFOAM’s SST and NASA’s SST simulation results shows almost perfect conformity, although Gomez (40) changed the OpenFOAM code for this simulation to match NASA’s definitions of the SST model. In conclusion it can be said that there are some definitive differences between NASA’s and OpenFOAM’s simulation results, but even though NASA’s simulation results match Coles’s theory very well, the OpenFOAM simulation agrees obviously better to the theory by Gersten; Herwig (4). The composed OpenFOAM fluid simulation working environment is found to be highly adjustable, which brings great advantages for advanced users, additionally to being free of charge. However, CFD beginners might get discouraged by the complexity of the software and the steep learning curve. – 39 –
Modeling a Turbulent Boundary Layer with OpenFOAM
Further noteworthy sources on OpenFOAM guidance are:
The corresponding OpenFOAM User Guide (41).
The recent course slides from the MSc/PhD course in CFD with OpenSource software by Håkan Nilsson (Chalmers University of Technology, Sweden), which are freely accessible online.
The recent course slides from the Introductory OpenFOAM course-training by Joel Guerrero (University of Genoa, Italy), which are freely accessible online.
The unofficial OpenFOAM wiki (21).
– 40 –
Bachelor Thesis by Björn Schilling
6
References
1. Free Software Foundation Inc. GNU General Public License. GNU. [Online] June 29, 2007. [Cited: August 12, 2016.] http://www.gnu.org/licenses/gpl.html. 2. The OpenFOAM Foundation Ltd. OpenFOAM The OpenFOAM Foundation. [Online] [Cited: August 12, 2016.] http://openfoam.org/. 3. Rumsey, Christopher. 2DZP: 2D Zero Pressure Gradient Flat Plate Validation Case. NASA Langley Research Center Turbulence Modeling Resource. [Online] NASA, August 8, 2016. [Cited: August 9, 2016.] http://turbmodels.larc.nasa.gov/flatplate_val.html. 4. Schlichting, H. and Gersten, K. Grenzschichttheorie 10. überarbeitete Auflage. Berlin Heidelberg : Springer, 2006. 3-540-23004-1. 5. nirvdrum. DiskSpace. ubuntu.com. [Online] May 25, 2014. [Cited: June 18, 2016.] https://help.ubuntu.com/community/DiskSpace. 6. Partition Master Free. EaseUS. [Online] [Cited: June 18, 2016.] http://www.easeus.com/partitionmanager/epm-free.html. 7. What is the difference between UEFI and Legacy Mode which we need to choose while installing the OS? Quora. [Online] [Cited: June 21, 2016.] https://www.quora.com/What-is-the-difference-between-UEFI-andLegacy-Mode-which-we-need-to-choose-while-installing-the-OS. 8. UEFI. ubuntu.com. [Online] [Cited: June 25, 2016.] https://help.ubuntu.com/community/UEFI. 9. Läuft mein PC mit einem BIOS oder mit UEFI? com!professional. [Online] [Cited: June 21, 2016.] http://www.com-magazin.de/tipps-tricks/bios/laeuft-pc-bios-uefi-1036222.html. 10. Fast Startup - Turn On or Off in Windows 10. Windows TenForums. [Online] [Cited: June 21, 2016.] http://www.tenforums.com/tutorials/4189-fast-startup-turn-off-windows-10-a.html. 11. EFI Installieren. ubuntuusers. [Online] [Cited: June 21, 2016.] https://wiki.ubuntuusers.de/EFI_Installieren/. 12. Installation problem - dual boot with W10 on Win certified laptop. askubuntu. [Online] [Cited: June 21, 2016.] https://askubuntu.com/questions/693491/installation-problem-dual-boot-with-w10-on-win-certifiedlaptop. 13. How to Open the Command Prompt as Administrator in Windows 8 or 10. How-To Geek. [Online] [Cited: June 23, 2016.] http://www.howtogeek.com/194041/how-to-open-the-command-prompt-asadministrator-in-windows-8.1/. 14. Download Ubuntu Desktop. ubuntu.com. [Online] [Cited: June 18, 2016.] http://www.ubuntu.com/download/desktop. 15. Create bootable USB drives the easy way. Rufus. [Online] [Cited: June 18, 2016.] https://rufus.akeo.ie/. 16. How to create a bootable USB stick on Windows. ubuntu.com. [Online] [Cited: June 18, 2016.] http://www.ubuntu.com/download/desktop/create-a-usb-stick-on-windows. 17. Boot keys. [Online] [Cited: June 20, 2016.] http://boot-keys.org/. 18. Installation/FromUSBStick. ubuntu.com. [Online] [Cited: June 20, 2016.] https://help.ubuntu.com/community/Installation/FromUSBStick. 19. UEFI Partitioning for Dummies. ask ubuntu. [Online] [Cited: June 25, 2016.] http://askubuntu.com/questions/353683/uefi-partitioning-for-dummies. – 41 –
Modeling a Turbulent Boundary Layer with OpenFOAM
20. The OpenFOAM Foundation Ltd. Release History. OpenFOAM The OpenFOAM Foundation. [Online] [Cited: July 30, 2016.] http://openfoam.org/download/history/. 21. Main Page. Unofficial OpenFOAM wiki. [Online] [Cited: July 30, 2016.] https://openfoamwiki.net/index.php/Main_Page. 22. OPEN CASCADE. Download Salome. SALOME. [Online] OPEN CASCADE; CEA/DEN; EDF R&D. [Cited: July 31, 2016.] http://www.salome-platform.org/downloads/current-version. 23. Tougeron, William. How to install Salome / Salome installation on Linux. SALOME. [Online] [Cited: July 31, 2016.] http://www.salome-platform.org/forum/forum_9/542883894. 24. Gschaider, Bernhard. Contrib/PyFoam. Unofficial OpenFOAM wiki. [Online] [Cited: July 31, 2016.] https://openfoamwiki.net/index.php/Contrib/PyFoam#Installation. 25. Juretic, Franco, et al., et al. cfMesh. sourceforge. [Online] [Cited: July 31, 2016.] https://sourceforge.net/projects/cfmesh/files/?source=navbar. 26. Juretic, Franco and Baburic, Mario. cfMesh v1.1.1. sourceforge. [Online] [Cited: July 2, 2016.] https://sourceforge.net/projects/cfmesh/files/v1.1.1/. 27. Santos, Bruno - (Wyldckat). Installation/Linux/OpenFOAM-3.0.1/Ubuntu. Unofficial OpenFOAM wiki. [Online] [Cited: July 2, 2016.] https://openfoamwiki.net/index.php/Installation/Linux/OpenFOAM3.0.1/Ubuntu. 28. engys ltd. Installation of the Latest 64 Bit Linux Binaries. github. [Online] engys ltd. [Cited: July 3, 2016.] http://engys.github.io/HELYX-OS/installation/. 29. —. home. engys. [Online] [Cited: July 3, 2016.] http://engys.com/. 30. Santos, Bruno - (Wyldckat). Installation/Linux/OpenFOAM-2.4.0/Ubuntu. Unofficial OpenFOAM wiki. [Online] [Cited: July 3, 2016.] https://openfoamwiki.net/index.php/Installation/Linux/OpenFOAM2.4.0/Ubuntu. 31. —. Installation/Helyx-OS/Ubuntu. Unofficial OpenFOAM wiki. [Online] [Cited: July 3, 2016.] https://openfoamwiki.net/index.php/Installation/Helyx-OS/Ubuntu. 32. Greenshields, Christopher J. OpenFOAM User Guide Version 3.0.1. [PDF] s.l. : OpenFOAM Foundation Ltd., 2015. Licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License. 33. Rumsey, Christopher. Grids - 2D Zero Pressure Gradient Flat Plate Verification Case. NASA Langley Research Center Turbulence Modeling Resource. [Online] NASA, March 3, 2013. [Cited: August 8, 2016.] http://turbmodels.larc.nasa.gov/flatplate_grids.html. 34. CFD support, Ltd. Boundary conditions in OpenFOAM. CFD support. [Online] November 2013. [Cited: August 27, 2016.] http://www.cfdsupport.com/OpenFOAM-Training-by-CFD-Support/node85.html. 35. —. OpenFOAM® Training - CFD SUPPORT. CFD support. [Online] November 2013. [Cited: August 27, 2016.] 36. Stephan, Peter, et al., et al. VDI-Wärmeatlas 11., bearbeitete und erweiterte Auflage. [ed.] VDI e.V. Berlin Heidelberg : Springer Vieweg, 2013. 978-3-642-19980-6. 37. CFD support, Ltd. turbulentMixingLengthDissipationRateInlet - omega. CFD support. [Online] [Cited: August 27, 2016.] http://www.cfdsupport.com/OpenFOAM-Training-by-CFD-Support/node99.html. 38. Weller, Henry. meshWavePatchDistMethod.H. GitHub. [Online] [Cited: August 30, 2016.] https://github.com/OpenFOAM/OpenFOAMdev/blob/master/src/finiteVolume/fvMesh/wallDist/patchDistMethods/meshWave/meshWavePatchDistMeth od.H. – 42 –
Bachelor Thesis by Björn Schilling
39. —. PoissonPatchDistMethod.H. GitHub. [Online] [Cited: August 30, 2016.] https://github.com/OpenFOAM/OpenFOAMdev/blob/master/src/finiteVolume/fvMesh/wallDist/patchDistMethods/Poisson/PoissonPatchDistMethod.H. 40. Gomez, Sebastian. Master's Thesis - Verification of Statistical Turbulence Models in Aerodynamic Flows. Albuquerque, New Mexico : The University of New Mexico, 2012. 41. CFD Direct Ltd. OpenFOAM User Guide. CFD Direct. [Online] [Cited: September 1, 2016.] http://cfd.direct/openfoam/user-guide/.
– 43 –
Modeling a Turbulent Boundary Layer with OpenFOAM
7
Appendix
x-csrc Text Files of the NASA 2D Zero Pressure Gradient Flat Plate Validations Case
– 44 –
Bachelor Thesis by Björn Schilling /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object thermophysicalProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // thermoType { type mixture transport thermo equationOfState specie energy } mixture { specie { nMoles molWeight } thermodynamics { Cp Hf } transport { As Ts } }
hePsiThermo; pureMixture; sutherland; hConst; perfectGas; specie; sensibleInternalEnergy;
1; 28.9;
1007; 0;
1.4792e-06; 116;
// ************************************************************************* //
– 45 –
Modeling a Turbulent Boundary Layer with OpenFOAM /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object turbulenceProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // simulationType
RAS;
RAS { RASModel
kOmegaSST;
turbulence
on;
printCoeffs
on;
} // ************************************************************************* //
– 46 –
Bachelor Thesis by Björn Schilling /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class polyBoundaryMesh; location "constant/polyMesh"; object boundary; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 7 ( sidewall1 { type empty; nFaces 3264; startFace 6412; } inlet { type patch; nFaces 48; startFace 9676; } outlet { type patch; nFaces 48; startFace 9724; } startsymmetryplane { type symmetryPlane; nFaces 12; startFace 9772; } bottomwall { type wall; nFaces 56; startFace 9784; } topwall { type patch; nFaces 68; startFace 9840; } sidewall2 { type empty; nFaces 3264; startFace 9908; } ) // ************************************************************************* //
– 47 –
Modeling a Turbulent Boundary Layer with OpenFOAM /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object alphat; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions
[1 -1 -1 0 0 0 0];
internalField
uniform 0;
boundaryField { topwall { type } bottomwall { type Prt value } startsymmetryplane { type } inlet { type value } outlet { type value } sidewall1 { type } sidewall2 { type } }
zeroGradient;
compressible::alphatWallFunction; 0.85; uniform 0;
symmetryPlane;
calculated; uniform 0;
calculated; uniform 0;
empty;
empty;
// ************************************************************************* //
– 48 –
Bachelor Thesis by Björn Schilling /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object k; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions
[0 2 -2 0 0 0 0];
internalField
uniform 1;
boundaryField { topwall { type } bottomwall { type value uniform 1; } startsymmetryplane { type } inlet { type intensity value } outlet { type } sidewall1 { type } sidewall2 { type }
zeroGradient;
kqRWallFunction;
symmetryPlane;
turbulentIntensityKineticEnergyInlet; 0.05; uniform 1;
zeroGradient;
empty;
empty;
} // ************************************************************************* //
– 49 –
Modeling a Turbulent Boundary Layer with OpenFOAM /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object nut; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions
[0 2 -1 0 0 0 0];
internalField
uniform 0;
boundaryField { topwall { type } bottomwall { type value uniform 0; } startsymmetryplane { type } inlet { type value 0; } outlet { type } sidewall1 { type } sidewall2 { type } }
zeroGradient;
nutkWallFunction;
symmetryPlane;
calculated
zeroGradient;
empty;
empty;
// ************************************************************************* //
– 50 –
Bachelor Thesis by Björn Schilling /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object omega; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions
[0 0 -1 0 0 0 0];
internalField
uniform 126;
boundaryField { topwall { type zeroGradient; } bottomwall { type omegaWallFunction; value 126; } startsymmetryplane { type symmetryPlane; } inlet { type turbulentMixingLengthDissipationRateInlet; mixingLength 0.1; phi phi; k k; value $internalField; } outlet { type zeroGradient; } sidewall1 { type empty; } sidewall2 { type empty; } } // ************************************************************************* //
– 51 –
Modeling a Turbulent Boundary Layer with OpenFOAM /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions
[1 -1 -2 0 0 0 0];
internalField
uniform 101325;
boundaryField { topwall { type } bottomwall { type } startsymmetryplane { type } inlet { type } outlet { type value } sidewall1 { type } sidewall2 { type } }
zeroGradient;
zeroGradient;
symmetryPlane;
zeroGradient;
fixedValue; uniform 101325;
empty;
empty;
// ************************************************************************* //
– 52 –
Bachelor Thesis by Björn Schilling /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object T; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions
[0 0 0 1 0 0 0];
internalField
uniform 300;
boundaryField { topwall { type } bottomwall { type } startsymmetryplane { type } inlet { type value } outlet { type value inletValue } sidewall1 { type } sidewall2 { type } }
zeroGradient;
zeroGradient;
symmetryPlane;
fixedValue; uniform 302.4; //Tt/Tref=1.008
inletOutlet; uniform 300; uniform 300;
empty;
empty;
// ************************************************************************* //
– 53 –
Modeling a Turbulent Boundary Layer with OpenFOAM /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions
[0 1 -1 0 0 0 0];
internalField
uniform (0 0 0);
boundaryField { topwall { type } bottomwall { type value } startsymmetryplane { type } inlet { type value } outlet { type } sidewall1 { type } sidewall2 { type } }
zeroGradient;
fixedValue; uniform (0 0 0);
symmetryPlane;
fixedValue; uniform (69.5 0 0);
zeroGradient;
empty;
empty;
// ************************************************************************* //
– 54 –
Bachelor Thesis by Björn Schilling /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; location "0"; object wallShearStress; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions
[0 2 -2 0 0 0 0];
internalField
uniform (0 0 0);
boundaryField { sidewall1 { type } inlet { type value } outlet { type value } startsymmetryplane { type } bottomwall { type value } topwall { type value } sidewall2 { type } }
empty;
calculated; uniform (0 0 0);
calculated; uniform (0 0 0);
symmetryPlane;
calculated; uniform (0 0 0);
calculated; uniform (0 0 0);
empty;
// ************************************************************************* //
– 55 –
Modeling a Turbulent Boundary Layer with OpenFOAM /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object controlDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // application
rhoSimpleFoam;
startFrom
startTime;
startTime
0;
stopAt
endTime;
endTime
7.1;
deltaT
3.5e-5;
writeControl
timeStep;
writeInterval
1e5;
purgeWrite
0;
writeFormat
ascii;
writePrecision
6;
writeCompression off; timeFormat
general;
timePrecision
6;
graphFormat
raw;
runTimeModifiable true; // ************************************************************************* //
– 56 –
Bachelor Thesis by Björn Schilling /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object decomposeParDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // numberOfSubdomains 6; method
scotch;
/* simpleCoeffs { n delta }
(8 1 1); 0.001;
hierarchicalCoeffs { n delta order } manualCoeffs { dataFile }
(4 2 1); 0.001; xyz;
"";
distributed
no;
roots
( );
*/ // ************************************************************************* //
– 57 –
Modeling a Turbulent Boundary Layer with OpenFOAM /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object fvSchemes; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ddtSchemes { default } gradSchemes { default } divSchemes { default
steadyState;
Gauss linear;
none;
div(phi,U) bounded Gauss upwind; div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear; div(phi,e) bounded Gauss upwind; div(phi,epsilon) bounded Gauss upwind; div(phi,k) bounded Gauss upwind; div(phi,omega) Gauss upwind; //selbst eingefügt(aus anderem Tut.) div(phid,p) Gauss upwind; div(phi,Ekp) bounded Gauss upwind; div((phi|interpolate(rho)),p) Gauss upwind; } laplacianSchemes { default }
Gauss linear corrected;
interpolationSchemes { default linear; } snGradSchemes { default }
corrected;
wallDist { method meshWave; } // ************************************************************************* //
– 58 –
Bachelor Thesis by Björn Schilling /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvSolution; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solvers { p { solver GAMG; tolerance 1e-08; relTol 0.1; smoother GaussSeidel; nPreSweeps 0; nPostSweeps 2; nFinestSweeps 2; cacheAgglomeration true; nCellsInCoarsestLevel 20; agglomerator faceAreaPair; mergeLevels 1; } "(U|k|e|omega)" { solver GAMG; tolerance 1e-08; relTol 0.1; smoother GaussSeidel; nPreSweeps 0; nPostSweeps 2; nFinestSweeps 2; cacheAgglomeration true; nCellsInCoarsestLevel 20; agglomerator faceAreaPair; nCellsInCoarsestLevel 20; } }
– 59 –
Modeling a Turbulent Boundary Layer with OpenFOAM SIMPLE { nNonOrthogonalCorrectors 0; consistent yes; transonic no; residualControl { p 1e-10; U 1e-12; e 1e-09; // possibly check turbulence fields "(k|epsilon|omega)" 1e-09; } } relaxationFactors { fields { p rho } equations { p U e k epsilon omega 0.9; } }
1; 1;
1; 0.9; 0.9; 0.9; 0.9;
// ************************************************************************* //
– 60 –