CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [Other] Can't import airfoil meshes successfully (https://www.cfd-online.com/Forums/openfoam-meshing/150699-cant-import-airfoil-meshes-successfully.html)

klausb March 27, 2015 18:56

Can't import airfoil meshes successfully
 
3 Attachment(s)
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

alexeym March 28, 2015 02:13

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.

klausb March 28, 2015 07:26

the problem remains
 
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

alexeym March 28, 2015 07:44

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.

klausb March 28, 2015 08:41

the issue...
 
3 Attachment(s)
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

alexeym March 28, 2015 12:00

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.

nw_ds May 26, 2015 12:30

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"

alexeym May 26, 2015 15:51

Hi,

Converter generates Gmsh (http://gmsh.info) mesh, not Fluent.


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