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

Airfoil 3D simulation using OpenFoam

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

Like Tree1Likes
  • 1 Post By Joshua14

Reply
 
LinkBack Thread Tools Display Modes
Old   January 5, 2017, 06:43
Default Airfoil 3D simulation using OpenFoam
  #1
New Member
 
Thodoris
Join Date: Apr 2016
Location: Greece
Posts: 22
Rep Power: 3
teodm is on a distinguished road
Hello guys.Happy new year!.In my diploma thesis i have to simulate corrotating vortex which is created by two wings of opposite aoa.I create my geometry on Inventor Autocad and my mesh on Salome.I would like to ask 1)if my geometry and boundary patches are correct.I have inlet outlet wings and walls(bottom,up,front,back) boundary patches.It would more correct if i had separated the front and back with the bottom and up?.2)Also where i can see if my mesh is 3D?. 3)Furthermore, in OPenfoam in boundary folder i put inlet,outlet and walls as patches and wings as walls.Is it correct? 4)The type of boundaries conditions for p and u are zerogradient and fixedvalue.Should it be more correct if i used freestream boundary conditions?.
Thank you very much in advance and excuse for so many questions.
teodm is offline   Reply With Quote

Old   January 12, 2017, 10:06
Default
  #2
New Member
 
John Tsavlidis
Join Date: Nov 2016
Location: Delft, Netherlands
Posts: 22
Rep Power: 2
jeytsav is on a distinguished road
Dear teodm

Happy new year kali xronia!

I ll try to answer to some of your questions. I have no experience with Salome so I ll skip questions regarding this software.

A sketch of your domain along with the wings could help a lot but I will try to explain how I would do it.

I assume that you are simulating two wings in free air conditions (so not a wind tunnel). In this case the inlet (front) and outlet (back) should be defined as patches (patch). All the other sides (top, bottom, left, right) should be defined as symmetries (symmetry). The wings should be defined as walls (wall).

Defining the boundaries like above, would mean that in case you want to change the angle of attack of the wings you have to perform manual changes on the CAD and rotate the wing geometries and then rebuild the mesh.

There is an alternative. You can define multiple inlets (front and bottom) and outlets (top and back) so that you can change the velocity vector to match the angle of attack of your preference. As far as I can remember, there are some posts through this forum where this method is explained.


For velocity you should use fixedvalue at inlet and zeroGradient at outlet while for pressure you should use zeroGradient at inlet and fixedValue at outlet.

I have no experience with freestream bcs so I would suggest sticking to the standards.

Hope I helped a bit

Kind regards
Giannis
jeytsav is offline   Reply With Quote

Old   January 12, 2017, 17:55
Default Airfoil 3D simulation using OpenFoam
  #3
New Member
 
Thodoris
Join Date: Apr 2016
Location: Greece
Posts: 22
Rep Power: 3
teodm is on a distinguished road
Kali xronia sumpatriwth mou!
Thanks a lot for your reply.This is my boundary file.
wings
{
type wall;
nFaces 25510;
startFace 1051391;
}
inlet
{
type patch;
nFaces 856;
startFace 1076901;
}
outlet
{
type patch;
nFaces 858;
startFace 1077757;
}
walls
{
type patch;
nFaces 32938;
startFace 1078615;
}

Where as wall i have defined the top bottom front and back.I think that i can't use the symmetry because my two wings are in different angles so they aren't symmetrical(i could send my geometry to your email address if you would like).Furthermore my nut,p,u files are as show below:
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 2 -2 0 0 0 0];

internalField uniform 0;

boundaryField
{
wings
{
type zeroGradient;
}
inlet
{
type freestreamPressure;
}

outlet
{
type freestreamPressure;

}
walls
{
type freestreamPressure;
}


}

// ************************************************** *********************** //

oamFile
{
version 2.0;
format ascii;
class volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 1 -1 0 0 0 0];

internalField uniform (0 0 0);

boundaryField
{
wings
{
type fixedValue;
value uniform (0 0 0);
}
inlet
{
type freestream;
freestreamValue uniform (20 0 0);
}

outlet
{

type freestream;
freestreamValue uniform (20 0 0);
}

walls
{
type freestream;
freestreamValue uniform (20 0 0);
}

}

// ************************************************** *********************** //

FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 2 -1 0 0 0 0];

internalField uniform 0.015;

boundaryField
{
wings
{
type nutUSpaldingWallFunction;
value uniform 0;
}
inlet
{
type freestream;
freestreamValue uniform 0.015;
}
outlet
{
type freestream;
freestreamValue uniform 0.015;
}

walls
{
type freestream;
freestreamValue uniform 0.015;
}
}


// ************************************************** *********************** //
I have done the simulation with both pimple and simple solver but i haven't got the solutions i expect yet.Thank you very much and i am looking forward for your reply.
teodm is offline   Reply With Quote

Old   January 13, 2017, 04:27
Default
  #4
New Member
 
John Tsavlidis
Join Date: Nov 2016
Location: Delft, Netherlands
Posts: 22
Rep Power: 2
jeytsav is on a distinguished road
Dear teodm

It would be a lot better if you could attach a screenshot of your geometry + domain here in the forum so that someone else could also help you or be helped. Anyway in case you are not willing to share the screenshot publicly, find my e-mail address in your inbox.

Kind regards
jeytsav is offline   Reply With Quote

Old   January 13, 2017, 05:51
Default Airfoil 3D simulation using OpenFoam
  #5
New Member
 
Thodoris
Join Date: Apr 2016
Location: Greece
Posts: 22
Rep Power: 3
teodm is on a distinguished road
Dear John,
I attached my geometry.
Thank you very much in advance.
Attached Images
File Type: png airfoils.png (14.8 KB, 42 views)
File Type: png airfoils2.png (8.3 KB, 34 views)
teodm is offline   Reply With Quote

Old   January 13, 2017, 06:26
Default
  #6
New Member
 
John Tsavlidis
Join Date: Nov 2016
Location: Delft, Netherlands
Posts: 22
Rep Power: 2
jeytsav is on a distinguished road
When using a symmetry type boundary it means that on both sides of the boundary the same conditions exists. It is not related to whether the model is symmetrical or not.

So in my opinion, you should go ahead and change the walls boundary to type symmetry, as well as all the u, p e.t.c.

I have no experience with the freestream type of boundary condition so I am not sure whether it will work well or not. I would suggest to use the boundaries you initially had and I had also mentioned in post #2

Quote:
For velocity you should use fixedvalue uniform (20 0 0) at inlet and zeroGradient at outlet while for pressure you should use zeroGradient at inlet and fixedValue 0 at outlet.
What turbulence model are you using? Maybe you should first try to run the case without turbulence i.e. laminar, to check if everything works fine.

Let me know what you ve done, and if it worked out!

Kind regards
jeytsav is offline   Reply With Quote

Old   January 13, 2017, 06:52
Default Airfoil 3D simulation using OpenFoam
  #7
New Member
 
Thodoris
Join Date: Apr 2016
Location: Greece
Posts: 22
Rep Power: 3
teodm is on a distinguished road
I have been using SpalartAlmarasDDES turbulence model.At first i was going to use fixedValue and zeroGradient but then i used freeStream boundary condition because i saw the airfoil2d tutorial which is using freestream boundary conditions.I will try to do it the way you told me and i will inform you with the results.
Thank you very much in advance
teodm is offline   Reply With Quote

Old   January 13, 2017, 14:13
Default Airfoil 3D simulation using OpenFoam
  #8
New Member
 
Thodoris
Join Date: Apr 2016
Location: Greece
Posts: 22
Rep Power: 3
teodm is on a distinguished road
Dear John,
While running the case with simpleFoam and pimpleFoam everything is ok,running the case with icoFoam(as you suggested) for some reason the courant number become very big and the below error appears:
Courant Number mean: 0.0239956 max: 286.208
#0 Foam::error:rintStack(Foam::Ostream&) at ??:?
#1 Foam::sigFpe::sigHandler(int) at ??:?
#2 ? in "/lib/x86_64-linux-gnu/libc.so.6"
#3 Foam::lduMatrix::residual(Foam::Field<double>&, Foam::Field<double> const&, Foam::Field<double> const&, Foam::FieldField<Foam::Field, double> const&, Foam::UPtrList<Foam::lduInterfaceField const> const&, unsigned char) const at ??:?
#4 Foam::lduMatrix::residual(Foam::Field<double> const&, Foam::Field<double> const&, Foam::FieldField<Foam::Field, double> const&, Foam::UPtrList<Foam::lduInterfaceField const> const&, unsigned char) const at ??:?
#5 Foam::smoothSolver::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const at ??:?
#6 ? at ??:?
#7 ? at ??:?
#8 ? at ??:?
#9 ? at ??:?
#10 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#11 ? at ??:?
Floating point exception (core dumped)

Do you have any idea why is this happening and if it means that my case isn't built well somewhere?


Thank you very much.
With respect,
Thodoris
teodm is offline   Reply With Quote

Old   January 14, 2017, 08:57
Default
  #9
New Member
 
John Tsavlidis
Join Date: Nov 2016
Location: Delft, Netherlands
Posts: 22
Rep Power: 2
jeytsav is on a distinguished road
Dear Thodori

Unfortunately I have no experience with icoFoam.

It is not necessary to use icoFoam in order to simulate laminar flow.

Try using simpleFoam and modifying the turbulence properties in order the solver not to take into account the turbulence model.

You can do this by changing the keyword simulationType to laminar, into the /constant/turbulenceProperties file. See more info here


Maybe you can also try re-running icoFoam now to see what happens, maybe that fixes the problem. Let me know if it works out.

I read that icoFoam is meant for laminar flow, so maybe it is more correct to use this solver, but in your case you are not interested in laminar flow itself, but you just want be sure that the case is first working without turbulence and then move on with the implementation of the turbulence model. This is what I was trying to suggest.


Kind regards
jeytsav is offline   Reply With Quote

Old   February 3, 2017, 10:09
Default
  #10
New Member
 
Thodoris
Join Date: Apr 2016
Location: Greece
Posts: 22
Rep Power: 3
teodm is on a distinguished road
Dear John,
I have successfully run my simulation with 1.7 mil cells (it converged after 960 iterations) but when i create a new mesh with 2.5mil cell it doesnt converge even after 9000 iterations (but the residuals are very small about 2e-5).Do you know why is probably this happening?
Thank you very much in advance you are my only hope to finish my diploma thesis.
With respect,
Thodoris
teodm is offline   Reply With Quote

Old   February 3, 2017, 10:31
Default
  #11
New Member
 
John Tsavlidis
Join Date: Nov 2016
Location: Delft, Netherlands
Posts: 22
Rep Power: 2
jeytsav is on a distinguished road
Hey

What are your convergence criteria ? Residuals of e-5 sound really nice to me in order to have convergence.

You should visually check whether there is convergence or not.

Some indications are, the low residuals (which you already have) and the stability of the force coefficients (Cl and Cd). With stability I mean, whether or not the values are changing. You can also notice a small oscillation around a certain value. This oscillation is acceptable, and in order to have a better result you should use the average of the last few iterations.

Do you log the residuals and the force coefficients at each iteration?
Could you please post the residuals and the force coefficients of both cases so that I can have a better look about the convergence?


Kind regards
jeytsav is offline   Reply With Quote

Old   February 3, 2017, 19:01
Default
  #12
New Member
 
Thodoris
Join Date: Apr 2016
Location: Greece
Posts: 22
Rep Power: 3
teodm is on a distinguished road
By convergence criteria you mean residual control?
SIMPLE

{
nNonOrthogonalCorrectors 0;
pRefCell 0;
pRefValue 0;

residualControl
{
p 1e-5;
U 1e-5;
nuTilda 1e-5;
}
}
I found out that i had computed wrong the initial conditions for nutilda and nut.I changed them and it seems that is going to converge.I will inform you as soon as i get results!
teodm is offline   Reply With Quote

Old   February 4, 2017, 10:18
Default
  #13
New Member
 
Thodoris
Join Date: Apr 2016
Location: Greece
Posts: 22
Rep Power: 3
teodm is on a distinguished road
Dear John,
This is my new simulation with the corrected initial conditions.After 2000 iterations residuals are oscillating.Do you have an idea why is this happening.
Thank you in advance.
With respect,
Thodoris
Attached Images
File Type: jpg residuals.jpg (47.9 KB, 26 views)
teodm is offline   Reply With Quote

Old   February 6, 2017, 12:46
Default
  #14
Member
 
Joshua
Join Date: Dec 2016
Location: St. Louis, Missouri
Posts: 79
Rep Power: 2
Joshua14 is on a distinguished road
Quote:
Originally Posted by teodm View Post
Dear John,
This is my new simulation with the corrected initial conditions.After 2000 iterations residuals are oscillating.Do you have an idea why is this happening.
Thank you in advance.
With respect,
Thodoris
The oscillations are due to the unsteadiness of the flow generated by the airfoil. This is to be expected.

Joshua
jeytsav likes this.
Joshua14 is offline   Reply With Quote

Old   February 7, 2017, 05:02
Default
  #15
New Member
 
Thodoris
Join Date: Apr 2016
Location: Greece
Posts: 22
Rep Power: 3
teodm is on a distinguished road
Joshua than you very much for your reply but i would like to ask you why the residuals don't get lower values.I am starting to believe that is due to the mesh.Here is my checkMesh.I think i have to use nonorthogonal correctors.What do you think?

Create polyMesh for time = 0

Time = 0

Mesh stats
points: 361772
faces: 4260836
internal faces: 4103600
cells: 2091109
faces per cell: 4
boundary patches: 4
point zones: 0
face zones: 0
cell zones: 0

Overall number of cells of each type:
hexahedra: 0
prisms: 0
wedges: 0
pyramids: 0
tet wedges: 0
tetrahedra: 2091109
polyhedra: 0

Checking topology...
Boundary definition OK.
Cell to face addressing OK.
Point usage OK.
Upper triangular ordering OK.
Face vertices OK.
Number of regions: 1 (OK).

Checking patch topology for multiply connected surfaces...
Patch Faces Points Surface topology
walls 74281 37388 ok (non-closed singly connected)
outlet 2010 1067 ok (non-closed singly connected)
inlet 2100 1112 ok (non-closed singly connected)
wings 78845 39550 ok (non-closed singly connected)

Checking geometry...
Overall domain bounding box (-0.3 -0.15 -0.245) (3 0.15 0.255)
Mesh has 3 geometric (non-empty/wedge) directions (1 1 1)
Mesh has 3 solution (non-empty) directions (1 1 1)
Boundary openness (1.04529e-16 -1.18714e-14 4.97349e-15) OK.
Max cell openness = 7.79721e-16 OK.
Max aspect ratio = 19.5697 OK.
Minimum face area = 3.34129e-08. Maximum face area = 0.000302238. Face area magnitudes OK.
Min volume = 4.89505e-12. Max volume = 1.62475e-06. Total volume = 0.494001. Cell volumes OK.
Mesh non-orthogonality Max: 86.8914 average: 25.0285
*Number of severely non-orthogonal (> 70 degrees) faces: 743.
Non-orthogonality check OK.
<<Writing 743 non-orthogonal faces to set nonOrthoFaces
Face pyramids OK.
Max skewness = 3.96775 OK.
Coupled point location match (average 0) OK.

Mesh OK.

End
teodm is offline   Reply With Quote

Old   February 7, 2017, 10:24
Default
  #16
Member
 
Joshua
Join Date: Dec 2016
Location: St. Louis, Missouri
Posts: 79
Rep Power: 2
Joshua14 is on a distinguished road
teodm,

It could be a few things. It could be your mesh, Reynolds number, or if you are doing a steady simulation instead of an unsteady simulation.

As you are simulating airfoils, check that you are not getting any kind of wall effect and that you have enough refinement around the wing to capture any BL development.

Joshua
Joshua14 is offline   Reply With Quote

Old   February 7, 2017, 11:25
Default
  #17
New Member
 
Thodoris
Join Date: Apr 2016
Location: Greece
Posts: 22
Rep Power: 3
teodm is on a distinguished road
I used Gauss limited 0.33 in my fvschemes and my residuals decreased but still not less than 1e-5.
ddtSchemes
{
default steadyState;
}

gradSchemes
{
default Gauss linear;
grad ( p ) Gauss linear ;
grad (U) Gauss linear ;


}

divSchemes
{
default none;
div(phi,U) bounded Gauss linearUpwind grad(U);
div(phi,nuTilda) bounded Gauss linearUpwind grad(nuTilda);
div((nuEff*dev2(T(grad(U))))) Gauss linear;
}

laplacianSchemes
{
default Gauss linear limited 0.333;
}

interpolationSchemes
{
default linear;
}

snGradSchemes
{
default limited 0.333;;
}

wallDist
{
method meshWave;
}
Thank you very much for your reply.This further reduction with gauss limited 0,33 is making me believe that the problem is the mesh
Attached Images
File Type: jpg residualsnew2.jpg (52.2 KB, 15 views)
teodm is offline   Reply With Quote

Old   February 7, 2017, 13:00
Default
  #18
Member
 
Joshua
Join Date: Dec 2016
Location: St. Louis, Missouri
Posts: 79
Rep Power: 2
Joshua14 is on a distinguished road
teodm,

While this was not in OpenFOAM, when I did 3D wing simulations in Star-CCM+ I had 7-8 million cells.

It looks like you have 2 million cells currently. Adding refinement around the wings or decreasing the base mesh size could be enough.

Joshua
Joshua14 is offline   Reply With Quote

Reply

Tags
airfoil 3d, geometry, mesh 3d, openfoam

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
Airfoil 2D cfd simulation Cocorito90 OpenFOAM Running, Solving & CFD 14 December 19, 2016 04:43
OpenFOAM Training, London, Chicago, Munich, Houston 2016-2017 cfd.direct OpenFOAM Announcements from Other Sources 0 September 14, 2016 03:19
OpenFoam Airfoil simulation - replacing Fluent with OpenFOAM shereez234 OpenFOAM Running, Solving & CFD 1 November 3, 2015 04:54
2D FFD Optimization RLangtry SU2 2 August 5, 2014 09:48
Airfoil simulation using moving wall Alejandro NUMECA 9 November 4, 2008 03:00


All times are GMT -4. The time now is 05:55.