CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Mesh Utilities

Can't import airfoil meshes successfully

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

Reply
 
LinkBack Thread Tools Display Modes
Old   March 27, 2015, 19:56
Default Can't import airfoil meshes successfully
  #1
Member
 
Klaus
Join Date: Mar 2009
Posts: 89
Rep Power: 9
klausb is on a distinguished road
Hello,

I created some meshes using construct2D which uses the plot 3d file format. So far, I've only been able to import a single one successfully - a thick one with a very blunt trailing edge). In all other cases:

The meshes are 2d meshes e.g. for the NACA0012 and NACA4412 airfoils so nothing special.

Issue:

1. The utility plot3dToFoam has streaming problems and doesn't work.

The work around was: Convert mesh into GMSH format by opening the mesh in GMSH and click save mesh.

Import mesh via gmshToFoam mesh.msh

2. autoPatch -overwrite 60 where 60 is just one angle example creates always more than the expected number of patches at least two additional patches which are strips of faces connecting the trailing edge of the airfoil with the farfield boundary of the domain (it's an O-mesh) - there was never an angle that wouldn't result in at least two additional patches. In the worst case there were about 20.

> at this point paraFoam crashes so the mesh cannot be visualized

paraFoam
created temporary 'kklomeganaca0012.OpenFOAM'


--> FOAM FATAL IO ERROR:
Cannot find patchField entry for defaultFaces

file: /home/klaus/OpenFOAM/klaus-2.3.1/run/kklomeganaca0012/0/p.boundaryField from line 25 to line 40.

From function GeometricField<Type, PatchField, GeoMesh>::GeometricBoundaryField::readField(const DimensionedField<Type, GeoMesh>&, const dictionary&)
in file /home/openfoam/OpenFOAM/OpenFOAM-2.3.1/src/OpenFOAM/lnInclude/GeometricBoundaryField.C at line 209.

FOAM exiting


3. In the one case that worked, I was able to remove the additional patches using: stitchMesh -overwrite auto0 auto5 were autoX are the names of the patches created by autoPatch that need to be removed or rather reintegrated into the mesh.

Using stitchMesh on other meshes fails.


Mesh parameters are well within quality parameters according to the postpycess utility and checkMesh

How can I make these meshes work?

Klaus
Attached Images
File Type: jpg naca0012_1.jpg (47.3 KB, 22 views)
File Type: jpg naca0012_2.jpg (58.7 KB, 20 views)
Attached Files
File Type: gz boundary.tar.gz (490 Bytes, 7 views)
klausb is offline   Reply With Quote

Old   March 28, 2015, 03:13
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,438
Rep Power: 25
alexeym will become famous soon enoughalexeym will become famous soon enough
Hi,

Plot3D format (just p3d file) is not so useful as it just stores coordinates of the points of the mesh. Though both NASA (for example http://turbmodels.larc.nasa.gov/naca0012_grids.html) and Construct2D generate Neutral Map File. As the name suggests this file contains mapping between boundary information and points in p3d file.

I do not know why both plot3dToFoam and Gmsh ignore existence of Neutral Map Files. You can try to use my attempt on conversion between Plot3D and Gmsh (https://github.com/mrklein/p3d2gmsh). This script reads p3d + nmf files and generates MSH file with the mesh and boundary description (see test folder with example of airfoil mesh).

About your points: 2 - as not all faces were distributed to the patches, converter created defaultFaces patch and your p file lacks description of this patch.
alexeym is offline   Reply With Quote

Old   March 28, 2015, 08:26
Default the problem remains
  #3
Member
 
Klaus
Join Date: Mar 2009
Posts: 89
Rep Power: 9
klausb is on a distinguished road
Than you for the feedback as the resulting gmsh mesh cannot be imported into OpenFoam.

I tried to import one of the nasa meshes of the naca0012: Again convert it via GMSH, gmshToFoam, stitchMesh. stitchMesh fails again.

boundary file:

6
(
front
{
type empty;
nFaces 229376;
startFace 457600;
}
back
{
type empty;
nFaces 229376;
startFace 686976;
}
auto2
{
type patch;
nFaces 256;
startFace 916352;
}
airfoil
{
type wall;
nFaces 896;
startFace 916608;
}
farfield
{
type patch;
nFaces 896;
startFace 917504;
}
auto5
{
type patch;
nFaces 256;
startFace 918400;
}
)

As you can see, there are two patches auto2 and auto5 I'd like to get rid of using stitchMesh

Klaus
klausb is offline   Reply With Quote

Old   March 28, 2015, 08:44
Default
  #4
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,438
Rep Power: 25
alexeym will become famous soon enoughalexeym will become famous soon enough
Maybe I am missing something, I do not share your fascination about the process:

1. Take MSH file without boundary information (as Gmsh ignores NMF file with boundary information and just reads P3D file with nodes of the mesh).
2. Convert it to OpenFOAM.
3. Use autoPatch to create patches.
4. Use stitchMesh to remove unnecessary patches.
5. Run simulation

I propose you to take MSH file WITH boundary information (i.e. with physical groups), convert it to OpenFOAM and run simulation.
alexeym is offline   Reply With Quote

Old   March 28, 2015, 09:41
Default the issue...
  #5
Member
 
Klaus
Join Date: Mar 2009
Posts: 89
Rep Power: 9
klausb is on a distinguished road
I am by no means fascinated by the process - it's just the only way I could work out to get a mesh into OpenFoam and boundaries defined. Unfortunately it works only once in a while.

It's not possible to define boundaries in construct2d; on the other hand, construct2d is the only free tool that was able to create the mesh quality (y+<1) I require for kklomega.

On o-meshes created I ended up with (best case) two useless strips of faces connecting the trailing edge with the farfiel boundary. In one case this could be fixed using stitchMesh.

On the NASA mesh of the NACA0012, I end up with one useless strip of faces connecting the trailing edge with the outlet (see attached pictures).

"...MSH file WITH boundary information (i.e. with physical groups)" would be great, if I had them.

Klaus
Attached Images
File Type: jpg boundary_issue_1.jpg (14.5 KB, 4 views)
File Type: jpg boundary_issue_2.jpg (8.8 KB, 4 views)
File Type: png boundary_issue_3.png (18.6 KB, 10 views)
klausb is offline   Reply With Quote

Old   March 28, 2015, 13:00
Default
  #6
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,438
Rep Power: 25
alexeym will become famous soon enoughalexeym will become famous soon enough
Well, maybe again I am missing something, but Construct2D generate both P3D file with mesh points and NMF file with boundary description. NASA also provides files for their NACA 0012 airfoil case (P3D, NMF).

So using P3D file and NMF file you can generate the following MSH file:

Code:
$MeshFormat
2.2 0 8
$EndMeshFormat
$PhysicalNames
5
3 1 "mesh"
2 2 "b2-VISCOUS"
2 3 "b3-FARFIELD"
2 4 "b4-SYMMETRY-Y"
2 5 "b5-SYMMETRY-Y"
$EndPhysicalNames
$Nodes
50000
...
As you can see the file has physical groups. NASA and Construct2D use symmetry BC for front and back planes, in OpenFOAM you can use empty BC type.

Surely if you convert just P3D file (without NMF) there will no boundary information in your mesh. For unknown reason both plot3dToFoam and Gmsh do not process NMF files, so they lose boundary information.

Last edited by alexeym; March 31, 2015 at 13:48. Reason: link change
alexeym is offline   Reply With Quote

Old   May 26, 2015, 12:30
Default
  #7
New Member
 
Mido
Join Date: Mar 2011
Posts: 21
Rep Power: 7
nw_ds is on a distinguished road
I tried using your code and your sample but it seems that fluent considers the generated msh file as corrupt ???
It specifically says " NULL Domain Pointer"
nw_ds is offline   Reply With Quote

Old   May 26, 2015, 15:51
Default
  #8
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,438
Rep Power: 25
alexeym will become famous soon enoughalexeym will become famous soon enough
Hi,

Converter generates Gmsh (http://gmsh.info) mesh, not Fluent.
alexeym is offline   Reply With Quote

Reply

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
2D FFD Optimization RLangtry SU2 2 August 5, 2014 09:48
SU2 AOA optimization 454514566@qq.com SU2 8 July 7, 2014 07:01
Calculating polars from 2D airfoil coordinates... wlvrn Main CFD Forum 0 August 18, 2010 18:43
Airfoil boundary condition Frank Main CFD Forum 1 April 21, 2008 18:36
Errors running allwmake in OpenFOAM141dev with WM_COMPILE_OPTION%3ddebug unoder OpenFOAM Installation 11 January 30, 2008 21:30


All times are GMT -4. The time now is 07:08.