CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[Gmsh] Gmsh: "Physical Volume" of a NACA airfoil?

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 8, 2014, 12:32
Default Gmsh: "Physical Volume" of a NACA airfoil?
  #1
Member
 
Join Date: Mar 2014
Location: Austrian abroad in Germany
Posts: 48
Rep Power: 11
sisi is on a distinguished road
I am trying to mesh a NACA airfoil that can be later on imported into OpenFOAM. I searched for information about that on the internet. That's what I found so far:

https://community.dur.ac.uk/g.l.ingr...torial2012.pdf

On page 5 the tutorial says that one have to define a "Physical Volume". The attached file shows what I have so far. Gmsh shows up two volumes (yellow points). One inside the Airfoil (Volume 1) and the other one outside the airfoil (Volume 2). Which volume do I have to select!?
Attached Files
File Type: txt NACA2415.txt (9.7 KB, 59 views)
sisi is offline   Reply With Quote

Old   October 8, 2014, 12:54
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

cause you need to mesh volume around airfoil (as you need to know flow around the airfoil), you have to select volume outside the airfoil.
alexeym is offline   Reply With Quote

Old   October 8, 2014, 16:44
Default
  #3
Member
 
Join Date: Mar 2014
Location: Austrian abroad in Germany
Posts: 48
Rep Power: 11
sisi is on a distinguished road
Ok, that sounds logical. Thank you. I combined the two surfaces into one surface (see attached file). When I press "3" nothing happens!? What's wrong here?
Attached Files
File Type: txt NACA2415.txt (9.7 KB, 28 views)
sisi is offline   Reply With Quote

Old   October 9, 2014, 04:25
Default
  #4
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

what's the version of your Gmsh? 2.8.5 was able to produce the mesh. Though with certain nuances:
  • Mesh is prismatic (I think everybody will prefer hexagonal mesh).
  • There is a plane at one side of the airfoil that should not be there (shown with green on attached picture). Though this plane disappears after GEO -> MSH -> gmshToFoam procedure (see second attachment).
Attached Images
File Type: png NACA2415.png (89.8 KB, 73 views)
File Type: png foam-mesh.png (86.0 KB, 79 views)
alexeym is offline   Reply With Quote

Old   October 10, 2014, 05:34
Default
  #5
Member
 
Join Date: Mar 2014
Location: Austrian abroad in Germany
Posts: 48
Rep Power: 11
sisi is on a distinguished road
I am using Gmsh Version 2.8.3 (Ubuntu 14.04). Sometimes meshing works but I can't zoom in or out. Gmsh stops responding or freezes frequently. I will try the latest stable version 2.8.5.

Why is Gmsh meshing inside the airfoil..!?
sisi is offline   Reply With Quote

Old   October 10, 2014, 12:34
Default
  #6
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

Quote:
Originally Posted by sisi View Post
I am using Gmsh Version 2.8.3 (Ubuntu 14.04). Sometimes meshing works but I can't zoom in or out. Gmsh stops responding or freezes frequently. I will try the latest stable version 2.8.5.
I've just checked 2.8.5 on Linux and it builds the mesh more-or-less OK (previously I've checked the file on OS X).

Quote:
Why is Gmsh meshing inside the airfoil..!?
Well... frankly speaking I'm quite surprised that Gmsh builds anything at all In general I use the following sequence during definition of the mesh in Gmsh (let's assume that we're building unstructured mesh):

1. Define points - you've done it.
2. Define lines connecting points - you've done it.
3. Define surfaces (in you case those will be several plane surfaces - outer boundaries and couple of ruled surfaces - surface of the airfoil) - you've started doing it...
4. Define geometric volumes using bounding surfaces defined during step 3 - well, you've decided to go straightly to defining physical surfaces and volumes.
5. Finally I define physical groups of surfaces (future patches) and physical volume (only one but still we need to define it).

I guess, in case of your file, Gmsh is trying to guess volumes those it needs to mesh. Sometimes Gmsh does it successfully, sometimes - not (for example it decides to mesh additional plane).
alexeym is offline   Reply With Quote

Old   October 10, 2014, 16:13
Default
  #7
Member
 
Join Date: Mar 2014
Location: Austrian abroad in Germany
Posts: 48
Rep Power: 11
sisi is on a distinguished road
Thank you for your help. I have attached my newest version. I tried to follow your instructions:

1. Points
2. Lines (Splines, Line Loop, Rotate Line)
3. Surfaces

That seems to work now. And I tried Gmsh 2.8.5., too. This version seems to work better.

I have one more question:

Quote:
Originally Posted by alexeym View Post

Though with certain nuances:
  • Mesh is prismatic (I think everybody will prefer hexagonal mesh).
How can I adjust these settings?
Attached Files
File Type: txt NACA2415.txt (12.3 KB, 38 views)
sisi is offline   Reply With Quote

Old   October 12, 2014, 07:53
Default
  #8
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

to generate structured meshes, you need to utilize transfinite lines (and then surfaces, and volumes) - http://www.geuz.org/gmsh/doc/texinfo...ructured-grids.

Though to use transfinite algorithm you have to modify mesh file. Gmsh can use this algorithm for surfaces with 4 corners and volumes with 6 corners. So you have to divide the area around the airfoil as shown on attached figure, as usual define points, lines, surfaces and volumes and then first define lines as transfinite:

Code:
Transfinite Line {line entity numbers} = <number of points on the line>;
And after all lines are described as transfinite, you can define surfaces and volumes as transfinite using:

Code:
Transfinite Surface "*";
Recombine Surface "*";

Transfinite Volume "*";
With transfinite lines you can control density of the mesh using "Using Progression" clause in line definition. So you can have more dense mesh near the surface of the airfoil and more coarse mesh in the areas of low flow parameters gradients.

Maybe you'll need to move point A to the left to reduce non-orthogonality of the mesh around point F.
Attached Images
File Type: png transfinite-airfoil.png (8.0 KB, 47 views)
alexeym is offline   Reply With Quote

Old   October 13, 2014, 09:35
Default
  #9
Member
 
Join Date: Mar 2014
Location: Austrian abroad in Germany
Posts: 48
Rep Power: 11
sisi is on a distinguished road
Ok, so my plan is as follows: I will start with an unstructured grid (easily meshed, rapid generation, quick progress etc...). So I can go on learning OpenFOAM. When I got my first results I will try to create a structured grid.

I have attached the newest version of my .geo file. Before I go on converting the mesh to OpenFOAM can someone please double check my .geo file?

@ alexeym: Thank you so much for your support!
Attached Files
File Type: txt NACA2415AngleOfAttack12.txt (12.7 KB, 58 views)
sisi is offline   Reply With Quote

Old   October 13, 2014, 10:10
Default
  #10
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Gmsh 2.8.5 has generated quite descent mesh, here's checkMesh output:

Code:
Checking geometry...
    Overall domain bounding box (-5 -5 0) (6 5 1)
    Mesh (non-empty, non-wedge) directions (1 1 1)
    Mesh (non-empty) directions (1 1 1)
    Boundary openness (-4.10252e-18 2.52463e-18 -9.75447e-16) OK.
    Max cell openness = 2.09221e-16 OK.
    Max aspect ratio = 846.979 OK.
    Minimum face area = 3.26324e-06. Maximum face area = 0.278444.  Face area magnitudes OK.
    Min volume = 3.26324e-06. Max volume = 0.0251815.  Total volume = 109.898.  Cell volumes OK.
    Mesh non-orthogonality Max: 34.1439 average: 7.41136
    Non-orthogonality check OK.
    Face pyramids OK.
    Max skewness = 0.491911 OK.
    Coupled point location match (average 0) OK.

Mesh OK.
You can add

Code:
Mesh 3;
Save "NACA2415AngleOfAttack12.msh";
to the end of GEO file, so gmsh will generate and save mesh automatically.
alexeym is offline   Reply With Quote

Old   October 13, 2014, 11:36
Default
  #11
Member
 
Join Date: Mar 2014
Location: Austrian abroad in Germany
Posts: 48
Rep Power: 11
sisi is on a distinguished road
Quote:
Originally Posted by alexeym View Post
You can add

Code:
Mesh 3;
Save "NACA2415AngleOfAttack12.msh";
to the end of GEO file, so gmsh will generate and save mesh automatically.
Meshing works but I get the following error message: Unknown command 'Save'
sisi is offline   Reply With Quote

Old   October 13, 2014, 12:43
Default
  #12
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

I'm also cause my Gmsh doesn't complain about Save (even installed 2.8.3 to check).
alexeym is offline   Reply With Quote

Old   October 13, 2014, 17:33
Default
  #13
Member
 
Join Date: Mar 2014
Location: Austrian abroad in Germany
Posts: 48
Rep Power: 11
sisi is on a distinguished road
Sorry, my fault

Edit: I wrote a GNU Octave script to create the geo file and the reason for the error was that I forgot to add a new line:

Code:
...
fprintf(fileID,'Mesh 3;\r\n');
fprintf(fileID,'Save "%s";\r\n',filenameMsh)
sisi is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Gmsh] Meshing 3D volume from STL/STEP Files (Gmsh) jgross OpenFOAM Meshing & Mesh Conversion 6 July 15, 2022 06:11
multiphase turbulance case floating error harsha_kulkarni OpenFOAM Running, Solving & CFD 3 February 18, 2016 06:06
Problem of simulating of small droplet with radius of 2mm liguifan OpenFOAM Running, Solving & CFD 5 June 3, 2014 03:53
Problem with restart solution in shape_optimization.py robyTKD SU2 Shape Design 21 May 29, 2013 10:26
[blockMesh] non-orthogonal faces and incorrect orientation? nennbs OpenFOAM Meshing & Mesh Conversion 7 April 17, 2013 06:42


All times are GMT -4. The time now is 10:24.