2D airfoil simulation

A subforum specific to the development of the OpenFoam-based workbenches ( Cfd https://github.com/qingfengxia/Cfd and CfdOF https://github.com/jaheyns/CfdOF )

Moderator: oliveroxtoby

User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

2D airfoil simulation

Post by adrianinsaval »

I'm struggling to get a working 2D airfoil simulation, this is how I set it up but it does not converge and even worse the graph for the lift coefficient shows negative values, can anybody give me pointers on what I'm doing wrong?
airfoil-cfd.FCStd
(281.35 KiB) Downloaded 76 times
Also if I use gmsh for the meshing it's always very pointy:
Sin título.png
Sin título.png (121.05 KiB) Viewed 2902 times
thschrader
Veteran
Posts: 3129
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: 2D airfoil simulation

Post by thschrader »

Here is a 2D-example, NACA2412 airfoil (still used in Cessnas, I believe).
The airfoil was tested long ago, see NACA Report 586, Page 233:
http://www.ae.metu.edu.tr/tuncer/ae443/ ... All-Re.pdf

With the report-function you can plot the drag-lift forces, you must divide the values
by the mesh-thickness (not the windtunnel extrusion!), to get the forces/m wing-length.
naca2412_2DplanarMesh.FCStd
(400.84 KiB) Downloaded 97 times
naca2412_coeff.JPG
naca2412_coeff.JPG (129.42 KiB) Viewed 2827 times
Done with bluecfd and

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.1.29410 (Git)
Build type: Release
Branch: releases/FreeCAD-0-20
Hash: f5d13554ecc7a456fb6e970568ae5c74ba727563
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.3
Locale: German/Germany (de_DE)
Installed mods: 
  * BIM
  * CfdOF 1.17.6
  * Curves 0.3.0
  * Defeaturing_WB
  * dodo
  * Fasteners
  * FEM_FrontISTR 0.1.0
  * Manipulator 1.4.3
  * Plot
  * Reinforcement
  * WorkFeature
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: 2D airfoil simulation

Post by adrianinsaval »

Thanks! I'll look into it, can you explain the rationale behind the boundary conditions? I addded a force coefficient reporting function to your file and after running it the lift coefficient is still shown as a small negative number :? is this functionality broken?
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: 2D airfoil simulation

Post by adrianinsaval »

@thschrader for your force reporting function you use 1.9 kPa as reference pressure, can you explain where this comes from? AFAICS your boundary conditions set 0 Pa as reference pressure.
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: 2D airfoil simulation

Post by adrianinsaval »

how do I determinate what values I should use for the inlet turbulence parameters?
thschrader
Veteran
Posts: 3129
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: 2D airfoil simulation

Post by thschrader »

@adrianinsaval:
please see my case definition
NACA2412_settings.pdf
(329.67 KiB) Downloaded 95 times

After case writing have a look at the p/controldict files.
In this case openfoam calculates a "normalized" pressure, p/rho.
To get the real pressure (and forces) you must multiply the calculated pressure field with the fluid density (paraview!)
OR multiply it with the reference pressure in cfdof report function (the reference pressure contains the density).
Otherwise your forces are too low.
See also unit definition in openfoam:
https://doc.cfd.direct/openfoam/user-gu ... ile-format


At 55 m/s inlet speed the reference pressure q is approx 1900 N/m^2=Pa
When changing the inlet speed, you must recalculate the pressure for the report function.

Simplefoam-solver calculates differential pressures, no need to define pressure at the inlet.
When you look at the results in paraview, the pressure on top of the wing is negativ, which is not possible
in reality. The total lift comes from the pressure difference. When adding pressure at the inlet,
the difference (and the lift) is the same.
Often people talk about air "suction", which is not correct.
See Otto von Guericke, Magdeburger spheres, proof of the existence of the air pressure.
The sphere is empty, nothing can suc...
https://de.wikipedia.org/wiki/Magdeburger_Halbkugeln

openfoam_units.JPG
openfoam_units.JPG (56.57 KiB) Viewed 2714 times
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: 2D airfoil simulation

Post by adrianinsaval »

Thanks, some things are making more sense now (others are still confusing), It seems there is a bug in the graph for the coefficients reporting function though, even with those reference pressures it is always showing very small values for the CL reporting function, but looking at the results in the case folder it is calculating the CL correctly from the force. @oliveroxtoby can you take a look?
Attachments
functionObjectProperties.txt
(3.57 KiB) Downloaded 68 times
force.png
force.png (35.86 KiB) Viewed 2688 times
coefficients.png
coefficients.png (30.94 KiB) Viewed 2688 times
thschrader
Veteran
Posts: 3129
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: 2D airfoil simulation

Post by thschrader »

adrianinsaval wrote: Thu Sep 01, 2022 6:49 pm Thanks, some things are making more sense now (others are still confusing),
Which ones?
User avatar
oliveroxtoby
Posts: 810
Joined: Fri Dec 23, 2016 9:43 am
Location: South Africa

Re: 2D airfoil simulation

Post by oliveroxtoby »

adrianinsaval wrote: Thu Sep 01, 2022 6:49 pm Thanks, some things are making more sense now (others are still confusing), It seems there is a bug in the graph for the coefficients reporting function though, even with those reference pressures it is always showing very small values for the CL reporting function, but looking at the results in the case folder it is calculating the CL correctly from the force. @oliveroxtoby can you take a look?
Try now?
The output formatting unfortunately varies a lot between the different OpenFOAM versions and forks...
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: 2D airfoil simulation

Post by adrianinsaval »

oliveroxtoby wrote: Thu Sep 01, 2022 9:28 pm Try now?
The output formatting unfortunately varies a lot between the different OpenFOAM versions and forks...
now it works :) thanks for the quick fix! I can imagine it's a pain to support so many variations. After looking at the output file I got curious, where can I read on what all the variations of Cd and Cl in the output mean?
thschrader wrote: Thu Sep 01, 2022 8:51 pm Which ones?
I'll get back on it on saturday and ask you more if that's ok, my brain has reached it's limit for today and tomorrow I'll be busy.
Post Reply