OpenFoam: Flate plate
Hello,
This post will detail the process of running a flate plate simualtion within OpenFoam.
As I'm a newbie when it comes to OpenFoam I thought the best place to start would be running a simple simulation to understand the pre-processing which is my main goal for this simulation.
Flate Plate
A flat plate is as it says in the name, you have a plate that is flat and the fluid will pass over it at the specified inlet velocity condition.
The importance of running this type of simulation is to model the no-slip effect of the wall. No slip occurs because of the friction caused by the particles interacting with the surface. The further from the surface the velocity increases until it reaches the free stream velocity.
Accuratly modelling the boundary layer will provide accurate predictions of wall shear stress which in turn leads to improved predicitons for surface pressure, pressure gradient and forces such as lift and drag (aerofoil).
The image below displays fluid passing along a wall detailing the boundary layer effects of turbulent flow.
figure 1 - boundary layer
Solving a plate of 3m length with a free-stream velocity of 1m/s nets a Reynolds number of 300,000 so the flow will be turbulent. (Re=(U*l)/nu)
Block Mesh
There are two types of meshing within OpenFoam. they're named 'block mesh' and 'snappy hex mesh'. For this problem block mesh will be used due to the simplistic nature of the domain.
For this problem the inital solving folders from the tutorial 'PitzDaily' will be copied to the flate plate directory and modified.
Firstly looking at the transport properties file nu is given as 1e^-5 and has been used to help previously calcualte the reynold number.
One thing that I didn't know was that properties dimnesional units are given by a single line of 7 numbers each representing the power of each base unit. For example nu is written as [0 2 -1 0 0 0 0] because it is m^2/s. The 7 base units are written below in the table.
figure 2 - standard units for OpenFoam properties
Within the BlockMeshDict file, the goemetry will be created by typing the co-ordinate locations of the vertices. To produce the domain 8 vertices are required numbered from 0-7.
The crude drawing I made in paint in figure 3 illustrates how the domain is constructed and figure 4 displays the co-ordinate locations.
figure 3 - drawing of vertices for domain
figure 4 - co-ordinate locations of each vertices
With the vertices created, the faces of the domain need to be written. For this problem there will be an inlet, outlet, lower wall and upper wall. The front and back surface will be made empty as the problem is solving for 2d.
creating the faces is simple as you just type the vertices in that make up the face. However it is important to remember that the have to to anti-clokwise from the starting number this can be done by using the right hand screw rule. The resultant code is shown in figure 5.
figure 5 - code for Boundary faces
With the mesh settings finalised, the blockmesh can be generated and viewed in ParaView. This is done through the console. The resultant mesh can be seen in figure 7.
figure 7 - generated block mesh in ParaView
Boundary conditions
The boundary conditions need to be modified before the simulation can be run. For example the velocity inlet is corrected to 1m/s in the x-direction and the upperWall has been changed to slip as we don't want the boundary effect to occur at that surface.
The turbulance model used is K-epsilon Rans.
Simualtion
With the pre-processing complete the simulation can now be run from the console. the simualtion lasted 144 iterations before converging. From the figure below you can see that there is low velocity near the wall with it increasing towards free-stream when increasing y. the boundary also increases along the x-axis which is to be expected.
The mesh of the simulation could be improved as the mesh was leaning slightly more to the coarse end of the metaphorical scale. As I learn more about pre-processing and post-processing I can hopefully revisit this case and work to validate it against exisitng work such as this: https://turbmodels.larc.nasa.gov/flatplate_val.html
Comments
Post a Comment