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

[Gmsh] Extrude stl surface for building a prismatic layer

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 11, 2015, 12:21
Default Extrude stl surface for building a prismatic layer
  #1
Senior Member
 
Join Date: Mar 2015
Posts: 250
Rep Power: 12
KateEisenhower is on a distinguished road
Hello everybody,

I am trying to create a proper prismatic layer with gmsh now, since I did not succeed with enGrid. My geometry has been approved both with blender and enGrid, so I guess this is not the problem.

This is what I have done so far:

1) Import the stl file in gmsh (File -> Merge...)
2) I tried to make an elementary ruled surface (Elementary entities -> Add -> Ruled surface -> Click on the geometry -> Press "E" -> Nothing happens)
3) I tried to create a physical surface (Physical groups -> Add -> Surface -> Click on the geometry -> Press "E" -> The system seemed to accept it, at least it appeared in the geo file)
4) I tried to extrude the surface. Therefore I added
Code:
Extrude{Surface{5};Layers{{10},{0.5}};}
in my geo file. But gmsh seems to not accept the previously defined surface:

Code:
Warning : '/Users/kateeisenhower/Documents/gmsh/data/project/mygeometry.geo', line 8 : Unknown surface 5
The complete geo file can be seen here:

Code:
Merge "mygeometry.stl";

Physical Surface(5) = {2};

Extrude{Surface{5};Layers{{10},{0.5}};}
I would be glad for every comment or hint you might supply.

Best regards,

Kate
KateEisenhower is offline   Reply With Quote

Old   May 12, 2015, 11:28
Smile May this will help you
  #2
New Member
 
Goth ydamil
Join Date: Mar 2013
Posts: 13
Rep Power: 13
djamel is on a distinguished road
hello

May this will help you for your problem with prismatic mesh, just copy it in geo file and mesh it.

best wishes
Attached Files
File Type: txt prism.txt (397 Bytes, 223 views)
djamel is offline   Reply With Quote

Old   May 13, 2015, 02:47
Default
  #3
Senior Member
 
Join Date: Mar 2015
Posts: 250
Rep Power: 12
KateEisenhower is on a distinguished road
Quote:
Originally Posted by djamel View Post
hello

May this will help you for your problem with prismatic mesh, just copy it in geo file and mesh it.

best wishes
Hello djamel and thank you for your code:

Code:
// Gmsh project created on Tue May 12 14:54:30 2015
cl=35;
b=100;//140
Point(1) = {b, b, 0,cl};
Point(2) = {-b, -b, 0,cl};
Point(3) = {b, -b, 0,cl};
Point(4) = {-b, b, 0,cl};
Line(1) = {1, 4};
Line(2) = {4, 2};
Line(3) = {2, 3};
Line(4) = {3, 1};
Line Loop(5) = {1, 2, 3, 4};
Plane Surface(6) = {5};


Extrude {0, 0, 40}{Surface{6};Layers{6} ;Recombine;}Physical Volume(29) = {1};
You are creating a surface out of points and lines, then you extrude it. As I wrote above, I want to define my *.stl-geometry as a surface and extrude from here. I have some questions regarding the "physical volume(29) = {1}" expression though:
- Why do you give your physical volume the identification number 29, instead of, for example 1? Is there a reason for this?
- How do you know that the elementary volume (that one you want to regroup as a physical volume) has the identification number 1?

Again, thank you for your answer. Any comment is welcome!

Kate
KateEisenhower is offline   Reply With Quote

Old   May 13, 2015, 03:39
Default is a choice
  #4
New Member
 
Goth ydamil
Join Date: Mar 2013
Posts: 13
Rep Power: 13
djamel is on a distinguished road
Hello

the number of volume isn't necessary be 29 , you can change it.

Go to the mesh file you will find in one of the columns the number of volume that you make.

example

1 6 3 29 1 0 69 68 61 229 224 189
29 : physical volume (you can change it in geo file)
69 68 61 229 224 189 : nodes of volume 1

best wishes.
djamel is offline   Reply With Quote

Old   May 13, 2015, 03:53
Default
  #5
Senior Member
 
Join Date: Mar 2015
Posts: 250
Rep Power: 12
KateEisenhower is on a distinguished road
Quote:
Originally Posted by djamel View Post
Hello

the number of volume isn't necessary be 29 , you can change it.

Go to the mesh file you will find in one of the columns the number of volume that you make.

example

1 6 3 29 1 0 69 68 61 229 224 189
29 : physical volume (you can change it in geo file)
69 68 61 229 224 189 : nodes of volume 1

best wishes.
Hello,

thank you for the explanation. The problem is I cannot even create a surface from my stl which I want to extrude later on.

Best regards,

Kate
KateEisenhower is offline   Reply With Quote

Old   May 13, 2015, 03:56
Default ok
  #6
New Member
 
Goth ydamil
Join Date: Mar 2013
Posts: 13
Rep Power: 13
djamel is on a distinguished road
then where is the problem
if you want send me the geo file to try here.
djamel is offline   Reply With Quote

Old   May 13, 2015, 04:39
Default may be
  #7
New Member
 
Goth ydamil
Join Date: Mar 2013
Posts: 13
Rep Power: 13
djamel is on a distinguished road
may be your problem is the physical surface, for me I needed physical volume, then i did plane surface ---- extrude----- physical volume.

for your problem i don't know if you need physical surface ?

good luck
djamel is offline   Reply With Quote

Old   May 13, 2015, 04:59
Default
  #8
Senior Member
 
Join Date: Mar 2015
Posts: 250
Rep Power: 12
KateEisenhower is on a distinguished road
Quote:
Originally Posted by djamel View Post
then where is the problem
if you want send me the geo file to try here.
Here you can find a stripped down case. The zipped folder contains my geometry.stl as well as my geometry.geo

Thanks for your help
Attached Files
File Type: zip geometry.zip (24.1 KB, 66 views)
KateEisenhower is offline   Reply With Quote

Old   July 14, 2015, 05:43
Default
  #9
Senior Member
 
Join Date: Mar 2015
Posts: 250
Rep Power: 12
KateEisenhower is on a distinguished road
Hello there,

finally I got my prismatic layer with the following command:

Code:
out[]=Extrude{Surface{4}; Layers{30, -0.02};};
It extrudes 30 layers over elementary surface 4 with the overall height of 0.02 m.
But these 30 layers now have each the same height (0.0006666.. m). How can I achieve the following?

Code:
layer one height: x
layer two height: x*1.5
layer two height: x*1.5^2
layer three height: x*1.5^3
.
.
.
Best regards and thank you for your time,

Kate
KateEisenhower is offline   Reply With Quote

Old   April 5, 2016, 14:30
Default
  #10
New Member
 
Join Date: Jul 2013
Posts: 4
Rep Power: 13
jojojojojojo is on a distinguished road
Hello,

I have a similar problem, and cant find a solution..
I have an STL with a single surface (a wing). I want to generate a sublayer with prisms, and on top, the rest of the volume, filled with tetrahedra.

The attached geo-file generates the prisms, but does not generate the tetrahedra correctly.

If I replace line 32

Surface Loop(1002) = {bl[0]}; // wing bl

with

Surface Loop(1002) = {1}; // wing

where surface 1 is the wing surface, the tetrahedra are generated, but not sitting on top of the prisms, but directly attached to the wing (see picture attached). This behavior is correct..

What I dont understand is, why the initial version, where the surface loop 1002 is built from the outside surface of the BL, does not work..

Maybe someone has a hint..

Thanks in advance!
Kind regards,
Johannes
Attached Images
File Type: jpg gmsh.jpg (165.9 KB, 151 views)
Attached Files
File Type: txt wing.txt (915 Bytes, 60 views)
jojojojojojo is offline   Reply With Quote

Old   April 15, 2016, 12:34
Default
  #11
New Member
 
Abdulhaq
Join Date: Oct 2012
Posts: 27
Rep Power: 14
aljazari is on a distinguished road
Quote:
Originally Posted by jojojojojojo View Post
Surface Loop(1002) = {bl[0]}; // wing bl

What I dont understand is, why the initial version, where the surface loop 1002 is built from the outside surface of the BL, does not work..

Johannes
I believe because bl[0] is not really a geometrical surface. It only becomes so after meshing. So indeed it shouldn't work.

However, tetrahedra attached to the wing isn't the best solution. I have a case for which the solution diverges and I came to the conclusion that it's because of this interaction.

What you can do is change line 18 from:

Code:
box[] = Extrude {100,0,0} { Surface{101};};
to:
Code:
box[] = Extrude {100,0,0} { Surface{101}; QuadTriAddVerts RecombLaterals; };
From gmsh documentation:

Quote:
QuadTriNoNewVerts and QuadTriAddVerts allow to connect structured, ex-
truded volumes containing quadrangle-faced elements to structured or unstruc-
tured tetrahedral volumes, by subdividing into triangles any quadrangles on
boundary surfaces shared with tetrahedral volumes. (They have no effect for
Try this and see if the tetrahedra connect to the prism layer. Is it possible if you attach the wing.stl as well?
aljazari is offline   Reply With Quote

Old   April 21, 2016, 03:24
Default
  #12
New Member
 
Join Date: Jul 2013
Posts: 4
Rep Power: 13
jojojojojojo is on a distinguished road
Hello aljazari,

thanks for your help and sorry about getting back so late.
I tried the modification, but the problem remains the same.

I uploaded the stl file, hope it works
http://www.filedropper.com/wing

I also attached here a geo-file as suggested by gmsh-programmer Christoph. The disadvantage of this solution is that the prism-layer has to be scaled and thus thickness of the prisms cant be defined.

Thanks a lot!

Kind regards,

Johannes
Attached Files
File Type: txt 07_wing_gmsh_Christoph_mod.geo.txt (1.1 KB, 73 views)
jojojojojojo is offline   Reply With Quote

Old   April 21, 2016, 17:54
Default
  #13
Member
 
Peter
Join Date: Feb 2015
Location: New York
Posts: 73
Rep Power: 11
opedrofunk is on a distinguished road
Hi,

You might also try to use the boundary layer field(s) in Gmsh (v10 or v11). See attached thumbnail for example, and attached geo file for input example (automatically generated with the SketchUp Meshkit extension).

Regards,
Peter

P.S.: Alternatively, if you're using OpenFOAM, you can generate your mesh with Gmsh and add layers with snappyHexMesh. Good luck!
Attached Images
File Type: jpg gmsh-wing-with-boundary-layer-example.jpg (158.0 KB, 154 views)
Attached Files
File Type: txt wing.geo.txt (6.3 KB, 116 views)
opedrofunk is offline   Reply With Quote

Reply


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
[snappyHexMesh] Help with Snappy: no layers growing GianF OpenFOAM Meshing & Mesh Conversion 2 September 23, 2020 09:26
[snappyHexMesh] snappyHexMesh generates not planar surface krzychu111 OpenFOAM Meshing & Mesh Conversion 2 April 23, 2020 17:38
[snappyHexMesh] SHM addLayers doesnt work on the small surface handicraft OpenFOAM Meshing & Mesh Conversion 4 October 5, 2018 04:50
[snappyHexMesh] Collapsing Layers Tim_Simon OpenFOAM Meshing & Mesh Conversion 5 August 2, 2015 23:51
errors Fahad Main CFD Forum 0 March 23, 2004 14:20


All times are GMT -4. The time now is 00:28.