CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

Solving 2D airfoil case using simpleFoam

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree2Likes
  • 1 Post By boongsin12
  • 1 Post By McCarra

Reply
 
LinkBack Thread Tools Display Modes
Old   March 26, 2011, 18:54
Default Solving 2D airfoil case using simpleFoam
  #1
New Member
 
Brad Maeg
Join Date: Mar 2011
Posts: 11
Rep Power: 6
boongsin12 is on a distinguished road
Hello everyone,

After struggling for some time to create meshing for a 2D airfoil, I finally figured out how to mesh and import to OpenFoam. Now, I am trying to solve the case by using the simpleFoam solution. I have been looking at the posts in the forum, however, I was not able to find any information about how to set p and U in the 0 folder.

So I would like to ask you what you guys are using for p and U to solve a simple 2D case. I have a feeling that I could possibly just copy the p and U from airFoil2D tutorial but I want to make sure if that is possible.

Also, I have a question about calculating force and force coefficients. I found these posts, Tutorial of how to plot residuals ! and Tutorial of how to plot residuals ! for calculating residuals and forces. However, shown in the latter post, I could not quite understand the term "patches" in the function that has to be added to the controlDict. I am sure it is a very minor term I am not familiar with. Please enlighten me.

Thank you in advance for any help!

Sincerely,

Brad Maeng
tareqkh likes this.
boongsin12 is offline   Reply With Quote

Old   March 28, 2011, 15:26
Default
  #2
Member
 
Usit McCarra
Join Date: Oct 2010
Posts: 51
Blog Entries: 2
Rep Power: 6
McCarra is on a distinguished road
Hi Brad, here's some help

Quote:
I have a feeling that I could possibly just copy the p and U from airFoil2D tutorial but I want to make sure if that is possible.
Yes it is. As long as you have the same patches declared. If you have different patches you have to include them.

Quote:
I could not quite understand the term "patches"
Look at the airFoil2D tutorial (simpleFoam). Go to constant/polyMesh and open boundary. Here you have the different boundaries of the geometry, 2 declared as patch, 1 as wall and 1 as empty. They all are types of patch (patch is a generic type of patch). The idea is that you usually group surfaces of your geometry to apply on them certain conditions (no need to be a group though, just one surfaces can be declared as a patch). Moreover, the several surfaces declared as a same patch don't need to be physically connected.

For example, the boundary file says that it has a surface declared as a patch named inlet, which is composed of 134 faces.

Hope it helps!
Good luck
tareqkh likes this.
McCarra is offline   Reply With Quote

Old   March 29, 2011, 15:43
Default
  #3
New Member
 
Brad Maeg
Join Date: Mar 2011
Posts: 11
Rep Power: 6
boongsin12 is on a distinguished road
Thanks for the reply.

Your response helped me a lot to understand the very basics. However, I have another question. So, does it matter how many patches you have around the airfoil? As you can see in the attachment, there are many patches. I did not generate these patches, I found a MATLAB script that generates .geo format used for gmsh program. Then, this was used to generate mesh in gmsh. Then, this is converted to OpenFoam compatible format in OpenFoam.

I will be using this to find force and forcecoefficients (lift and drag), and i want to make sure if having many patches would cause some problems.

Thanks in advance.!
Attached Images
File Type: jpg 0.jpg (95.0 KB, 189 views)
File Type: png 1.png (28.6 KB, 138 views)
File Type: jpg 3.jpg (96.0 KB, 141 views)
boongsin12 is offline   Reply With Quote

Old   March 29, 2011, 16:25
Default
  #4
Member
 
Usit McCarra
Join Date: Oct 2010
Posts: 51
Blog Entries: 2
Rep Power: 6
McCarra is on a distinguished road
I would say that the number of patches does not matter as long as they are part of a boundary or the complete boundary. However, I must say that the images attached are a bit strange to me. Since the simulation is 2D, the front and back boundaries are normally one patch of type empty and you have multiple patches on the front. You should have a boundary file in constant/polyMesh. What does it say?
McCarra is offline   Reply With Quote

Old   March 31, 2011, 22:03
Default
  #5
New Member
 
Brad Maeg
Join Date: Mar 2011
Posts: 11
Rep Power: 6
boongsin12 is on a distinguished road
Thank you for your response and sorry for kind of late reply. It has been a hectic week. Finally, some time for OpenFoam.

I went to the folder and looked at the boundary file, here is what is says,
There are 6 total patches. There are total 10 sections, at least the ones I could tell, in the gmsh picture I posted earlier. And I can't tell which ones correspond to what....

symmetry
{
type patch;
nFaces 160000;
startFace 159350;
}
airfoil
{
type patch;
nFaces 200;
startFace 319350;
}
walls
{
type patch;
nFaces 600;
startFace 319550;
}
inlet
{
type patch;
nFaces 200;
startFace 320150;
}
outlet
{
type patch;
nFaces 300;
startFace 320350;
}
defaultFaces
{
type patch;
nFaces 0;
startFace 320650;
}

Thanks in advance for any help!
boongsin12 is offline   Reply With Quote

Old   April 1, 2011, 05:14
Default
  #6
Member
 
Usit McCarra
Join Date: Oct 2010
Posts: 51
Blog Entries: 2
Rep Power: 6
McCarra is on a distinguished road
I would say that each color doesn't represent a patch in the figures above. I find a bit strange the fact that inlet and outlet have different amounts of faces. Anyway, try to run the case and see what happens. sometimes the error messages are a good source of information to know what's wrong.

PD: In case you want to check the mesh graphically, I think the best way to check these patches is by looking them in paraView. Run paraFoam (from terminal) in the folder of the case. Then, on the left there is a section called mesh parts with all the patches listed. Select which one do you want to see and click Apply. This will allow you to check if the complete geometry is has its corresponding patch.

See you!
McCarra is offline   Reply With Quote

Old   April 1, 2011, 17:24
Default
  #7
New Member
 
Brad Maeg
Join Date: Mar 2011
Posts: 11
Rep Power: 6
boongsin12 is on a distinguished road
Hi again,

You know what I just found out? I was comparing my mesh to the one in tutorial, aifFoil2D, and found out that my mesh is 3D while the other one is 2D. In other words, airFoil2D mesh is only drawn in x and y directions and my mesh goes x,y and z. The thickness is small, but it is still there.

I thought that what I had was a 2D mesh, but apparently not.. I tried to mesh it in 2D and import it to Foam, but was not successful with some errors. Strangely, when I import 3D mesh, there is no error.

I am starting to think that this is causing the problem. So, I am trying to find a way to generate 2D c-mesh, a proper one now..
boongsin12 is offline   Reply With Quote

Old   April 1, 2011, 18:03
Default
  #8
Member
 
Usit McCarra
Join Date: Oct 2010
Posts: 51
Blog Entries: 2
Rep Power: 6
McCarra is on a distinguished road
Every mesh in OpenFOAM is 3D. All x, y and z directions are included. To indicate that the mesh is 2D the front and back patches are declared empty, but when you visualize the mesh it is actually a 3D geometry. So the mesh in the tutorial is 3D but is treated as a 2D problem.

Look at the constant/polyMesh/boundary in the airfoil2D tutorial and you'll see that a patch frontAndBack is of type empty. That is what I refer to. It is very common and can be found in many other tutorials too.

Mc
McCarra is offline   Reply With Quote

Old   April 6, 2011, 20:52
Default
  #9
New Member
 
Brad Maeg
Join Date: Mar 2011
Posts: 11
Rep Power: 6
boongsin12 is on a distinguished road
Finally, I am able to run simpleFoam, at lease for NACA0012 AOA = 0. I am getting quite reasonable values for cl and cd. But I am still a bit skeptical of the results, mainly due to this reason: When I import a 5 degree angle of attack geometry/mesh with the same boundary conditions as AOA = 0, the solution does not converge any more. The boundary conditions are follows.

airfoil --> U = 0, p = zerogradient
inlet --> U = 203,0,0, p = zerogradient
outlet --> U = zerogradient, p = 0
Top and bottom --> U = 203,0,0, p = freestream.

I have played with the different types of U and p for inlet outlet, however, it seems like the changes do nothing to prevent the divergence.

Also want to mention that I am using RAS turbulence model, which was supplied with the sample SimpleFoam Airfoil2D example.

Any suggestion to why the solution does not converge?

Thanks in advance.
boongsin12 is offline   Reply With Quote

Old   April 7, 2011, 03:44
Default
  #10
Member
 
Usit McCarra
Join Date: Oct 2010
Posts: 51
Blog Entries: 2
Rep Power: 6
McCarra is on a distinguished road
I would try to reduce the time step or decrease nu in constant/transportProperties (which has the effect of an increased Reynolds number)

Mc
McCarra is offline   Reply With Quote

Old   April 20, 2011, 09:27
Default
  #11
Member
 
The True
Join Date: Dec 2010
Posts: 80
Rep Power: 6
Eren10 is on a distinguished road
hi,

I want also simulate the flow around an airfoil, turbulent flow. Which solver should I choose, simpleFoam or pisoFoam ? The boundary conditions will remain the same after a while,. I was concerned with the term "steady state" and turbulent flow in the description of the simpleFoam, can these terms be present on the same time. Which solver will yield better results for cl,cd..

Thanks.
Eren10 is offline   Reply With Quote

Old   April 20, 2011, 22:51
Default
  #12
New Member
 
Brad Maeg
Join Date: Mar 2011
Posts: 11
Rep Power: 6
boongsin12 is on a distinguished road
As far as I know, SimpleFoam is a steady state solver, where as PisoFoam is for transient solver. I have never used PisoFoam for airfoil Cd and Cl calculations. So far, using SimpleFoam, I get more or less realistic Cl and Cd. My suggestion is to use SimpleFoam to look at the steady state solution.

Good luck
boongsin12 is offline   Reply With Quote

Old   April 25, 2011, 12:38
Default 2D running conditions
  #13
New Member
 
anonymous
Join Date: Apr 2011
Posts: 1
Rep Power: 0
yusunVH is on a distinguished road
Hi:
Can you provide the following information about your 2D airfoil run using Openfoam?
1. what is the Mach and Re number?
2. do you run Openfoam modelling flow as incompressible or compressible?
3. what is the turbulence model used?
4. do you think transition model is available if you do not use it in your run?
5. Do you use multi-grid and how it performs?
6. Do you use parallel computing and how it performs?
7. How is cl vs aoa curve compared with WT data and how is Clmax?
8. How is drag polar comparing to WT test data
If possible, can you email me at yusun@vestas.com so we can have a small talk. Thank you.
yusunVH is offline   Reply With Quote

Old   November 2, 2011, 07:49
Default question big one
  #14
New Member
 
André Gama
Join Date: Oct 2011
Posts: 3
Rep Power: 5
AndreGama is on a distinguished road
hello i´m trying work with tutorial AirFoil2D simplefoam my question is how can i modify the position of the air foil, can anyone give something where can i find text to support me?

and how can i make a 2D of something to use in openfoam?

thanks for any help
AndreGama is offline   Reply With Quote

Old   November 3, 2011, 09:12
Default
  #15
Senior Member
 
David Boger
Join Date: Mar 2009
Location: Penn State Applied Research Laboratory
Posts: 146
Rep Power: 8
boger is on a distinguished road
In what way do you want to modify the airfoil's position? To translate, rotate, or scale the airfoil, you can use the transformPoints utility. Running "transformPoints -help" gives some decent documentation on usage.
__________________
David A. Boger
boger is offline   Reply With Quote

Old   November 11, 2011, 19:15
Default bad drag coefficient
  #16
New Member
 
Join Date: Oct 2011
Posts: 4
Rep Power: 5
thinkagain is on a distinguished road
hello

I'm trying to calculate the polar for some 2d airfoil and I create a test case with a NACA 0012 airfoil

I used the simpleFoam system and my case folder is like the 2d airfoil tutorial

I run the solution for a angle of attack of 3° and for 6° to verify that all the numerical setup give a correct resolution for p and U and for the lift, drag and moment coefficient

after some test i used a very fine mesh and I found p and U correct, and Cl, Cd and Cm correct for 3° (Cl=0.324; Cd=0.0071; Cm=0.0015) but for 6° (Cl=0.66; Cm=0029 I found some problem with the drag coefficient that very far from the correct one Cd=0.06

anyone have the same problem?

I want to know which is the best turbolence model for this test (I chose Spalart-Allmaras) and how select the correct wall function, because I suppose that the error depends from that.

Also I want to know how I can can create a structurated mesh with gmesh near my airfoil?

thanks for every good information

(sorry for my bad english)
thinkagain is offline   Reply With Quote

Old   November 18, 2011, 08:12
Default
  #17
New Member
 
Join Date: Oct 2011
Posts: 4
Rep Power: 5
thinkagain is on a distinguished road
I think the problem may be due to the fact that I consider the fully turbulent flow!
someone can tell me how to solve this type of analysis by considering the flow as laminar inlet and then become turbulent once the trasitione due to the profile?

I also read in somewhere tread that before using simplefoam would be useful to use the potentialfoam, you could tell me what it is like and if I should proceed?

thanks for any information

Andrea
thinkagain is offline   Reply With Quote

Old   November 28, 2011, 11:18
Default Create Airfoil2d mesh - URGENT
  #18
New Member
 
André Gama
Join Date: Oct 2011
Posts: 3
Rep Power: 5
AndreGama is on a distinguished road
I´m trying to study a 2D airfoil NACA0012 (a classic) in OpenFoam, but i´m having problems with the mesh, i did the tutorial in simplefoam but the mesh is already done, and do no have a blockMeshDit, how can i create a mesh like the one in SimpleFoam tutorial?

How was created the airfoilmesh in simplefoam tutorial???

please help
AndreGama is offline   Reply With Quote

Reply

Tags
2d airfoil, force, forcecoefficient, simplefoam

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
icoLagrangianFoam OF1.6 myNewParticleSolver heavy_user OpenFOAM 16 February 11, 2012 06:15
Compressible epsilon blows up swahono OpenFOAM 10 November 26, 2010 06:38
SimpleFoam k and epsilon bounded nedved OpenFOAM Running, Solving & CFD 1 November 25, 2008 21:21
IcoFoam parallel woes msrinath80 OpenFOAM Running, Solving & CFD 9 July 22, 2007 02:58
Could anybody help me see this error and give help liugx212 OpenFOAM Running, Solving & CFD 3 January 4, 2006 19:07


All times are GMT -4. The time now is 18:26.