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

[Gmsh] Using Bump with Extrude, layers in GMSH??

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

Like Tree4Likes
  • 4 Post By Hillie

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 26, 2016, 06:08
Default Using Bump with Extrude, layers in GMSH??
  #1
Senior Member
 
ArielJ
Join Date: Aug 2015
Posts: 127
Rep Power: 11
arieljeds is on a distinguished road
Hi there,

I have been building a basic wave tank in GMSH and used the extrude command to create the 3d volume. I now want to "bump" the vertical lines to coarsen the cells towards the top and bottom (towards +z and -z) and refine the mesh towards the centre of the z axis (where the free surface would be if the vertical mesh is divided evenly between fluid and air).

Using, for example, this snippet of code (not an mwe but hopefully gives enough info):

Code:
Physical Volume("water") = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; // volume numbers
Extrude{0,0,10} {
Surface{11, 12, 13, 14, 15, 16, 17, 18, 19, 20};
Layers{10};
Recombine:
}

Transfinite Line{Line connecting +z point of surfaces to -z point} = 10 Using Bump 5.00;
Probably not surprising that this doesn't work... is there a way to include a bump expression in with layers? I was reading in the guide and didn't understand the explanation of layers enough to apply it.

Any advice would be greatly appreciated, thank you in advance!
arieljeds is offline   Reply With Quote

Old   October 30, 2016, 13:06
Default
  #2
Senior Member
 
tareqkh's Avatar
 
CFD
Join Date: Nov 2010
Location: United States
Posts: 243
Rep Power: 16
tareqkh is on a distinguished road
Quote:
Originally Posted by arieljeds View Post
Hi there,

I have been building a basic wave tank in GMSH and used the extrude command to create the 3d volume. I now want to "bump" the vertical lines to coarsen the cells towards the top and bottom (towards +z and -z) and refine the mesh towards the centre of the z axis (where the free surface would be if the vertical mesh is divided evenly between fluid and air).

Using, for example, this snippet of code (not an mwe but hopefully gives enough info):

Code:
Physical Volume("water") = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; // volume numbers
Extrude{0,0,10} {
Surface{11, 12, 13, 14, 15, 16, 17, 18, 19, 20};
Layers{10};
Recombine:
}

Transfinite Line{Line connecting +z point of surfaces to -z point} = 10 Using Bump 5.00;
Probably not surprising that this doesn't work... is there a way to include a bump expression in with layers? I was reading in the guide and didn't understand the explanation of layers enough to apply it.

Any advice would be greatly appreciated, thank you in advance!
The snipped code is not in the right order. This might do the trick

Example

Extrude {0, 0, 1} {
Surface{12, 14, 16};
Layers{1};
Recombine;
}
Transfinite Line {1, 2, 3, 4, 5, 6} = 10 Using Bump 0.4;
Transfinite Surface "*";
Recombine Surface "*";

Best,
tareqkh is offline   Reply With Quote

Old   November 3, 2016, 07:00
Default
  #3
Senior Member
 
ArielJ
Join Date: Aug 2015
Posts: 127
Rep Power: 11
arieljeds is on a distinguished road
Hi tareqkh,

Thanks for your reply, somehow I missed this so sorry for the delay... Ok so I tried your suggestion but oddly it didn't seem to do anything at all?

Here's the full .geo code:
Code:
// Gmsh project created on Wed Oct 26 18:11:53 2016

L = 50;
Lx = 2.5*50;
Ly = L; 
depth = -15;

Nx = 100; Rx = 1.00;
Ny = 40;  Ry = 1.00;

Point(1) = {-Lx, -Ly, depth, 1.0};
Point(2) = { Lx, -Ly, depth, 1.0};
Point(3) = { Lx,  Ly, depth, 1.0};
Point(4) = {-Lx,  Ly, depth, 1.0};
Line(1) = {1, 2};
Line(2) = {4, 3};
Line(3) = {1, 4};
Line(4) = {2, 3};

Transfinite Line {1} = Nx Using Progression Rx;
Transfinite Line {2} = Nx Using Progression Rx;
Transfinite Line {3} = Ny Using Progression Ry;
Transfinite Line {4} = Ny Using Progression Ry;

Line Loop(5) = {3, 2, -4, -1};
Plane Surface(6) = {5};
Transfinite Surface {6}; Recombine Surface{6};

Physical Volume("water") = {1};
Extrude {0, 0, 25} {
  Surface{6};
  Layers{20};
  Recombine;
}

Geometry.LineNumbers =1 ;
Transfinite Line {13,14,22,18} = 10 Using Bump 0.4;
Transfinite Surface "*";
Recombine Surface "*";


Physical Surface("inlet") = {15}; //inlet
Physical Surface("outlet") = {23}; // outlet
Physical Surface("topAndBottom") = {27, 19}; // topAndBottom
Physical Surface("atmosphere") = {28}; // atmosphere
Physical Surface("seaFloor") = {6}; // seaFloor
It makes the mesh properly but then I can't see any "bump"?
arieljeds is offline   Reply With Quote

Old   November 3, 2016, 09:27
Default
  #4
Senior Member
 
tareqkh's Avatar
 
CFD
Join Date: Nov 2010
Location: United States
Posts: 243
Rep Power: 16
tareqkh is on a distinguished road
Try this;

Code:
L = 50;
Lx = 2.5*50;
Ly = L;
depth = -15;

Nx = 100; Rx = 1.00;
Ny = 40;  Ry = 1.00;

Point(1) = {-Lx, -Ly, depth, 1.0};
Point(2) = { Lx, -Ly, depth, 1.0};
Point(3) = { Lx,  Ly, depth, 1.0};
Point(4) = {-Lx,  Ly, depth, 1.0};
Line(1) = {1, 2};
Line(2) = {4, 3};
Line(3) = {1, 4};
Line(4) = {2, 3};

Transfinite Line {1,2} = Nx Using Progression Rx;
Transfinite Line {3,4} = Ny Using Progression Ry;
Transfinite Line {3,4} = 10 Using Bump 0.4;

Line Loop(5) = {3, 2, -4, -1};
Plane Surface(6) = {5};

Extrude {0, 0, 25} {
  Surface{6};
  Layers{20};
  Recombine;
}
Transfinite Surface "*";
Recombine Surface "*";


Physical Surface("inlet") = {15}; //inlet
Physical Surface("outlet") = {23}; // outlet
Physical Surface("topAndBottom") = {27, 19}; // topAndBottom
Physical Surface("atmosphere") = {28}; // atmosphere
Physical Surface("seaFloor") = {6}; // seaFloor
Physical Volume("water") = {1};
You can also send what are tying to do.

Best,
tareqkh is offline   Reply With Quote

Old   November 5, 2016, 14:26
Default
  #5
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
@ArielJ

You can just remove Layers and Recombine from Extrude command; determine new lines IDs using, for example, GUI and then make them Transfinite. There is an example

Code:
Point(1) = {0, 0, 0};
Point(2) = {1, 0, 0};
Point(3) = {1, 1, 0};
Point(4) = {0, 1, 0};

Line(1) = {1, 2};
Line(2) = {4, 3};
Line(3) = {1, 4};
Line(4) = {2, 3};
Line Loop(5) = {3, 2, -4, -1};
Plane Surface(6) = {5};
Extrude {0, 0, 1} {
  Surface{6};
}

Transfinite Line {1, 2, 3, 4} = 11;

// New lines due to extrusion in the new surface
Transfinite Line {8, 9, 10, 11} = 11;

// New vertical lines due to extrusion
Transfinite Line {13, 14, 18, 22} = 51 Using Bump 0.1;

Transfinite Surface "*";
Recombine Surface "*";
Attached Images
File Type: png cavity.png (39.2 KB, 127 views)
alexeym is offline   Reply With Quote

Old   March 1, 2017, 05:22
Default
  #6
Member
 
Jibran
Join Date: Oct 2012
Location: UK
Posts: 61
Blog Entries: 1
Rep Power: 14
Jibran is on a distinguished road
Quote:
Originally Posted by alexeym View Post
@ArielJ

You can just remove Layers and Recombine from Extrude command; determine new lines IDs using, for example, GUI and then make them Transfinite. There is an example

Code:
Point(1) = {0, 0, 0};
Point(2) = {1, 0, 0};
Point(3) = {1, 1, 0};
Point(4) = {0, 1, 0};

Line(1) = {1, 2};
Line(2) = {4, 3};
Line(3) = {1, 4};
Line(4) = {2, 3};
Line Loop(5) = {3, 2, -4, -1};
Plane Surface(6) = {5};
Extrude {0, 0, 1} {
  Surface{6};
}

Transfinite Line {1, 2, 3, 4} = 11;

// New lines due to extrusion in the new surface
Transfinite Line {8, 9, 10, 11} = 11;

// New vertical lines due to extrusion
Transfinite Line {13, 14, 18, 22} = 51 Using Bump 0.1;

Transfinite Surface "*";
Recombine Surface "*";
Hi Alexey.

This script seems to produce the desired result only on the surface (structured quadrilaterals). The domain is meshed using tetrahedrals. Can you please confirm this or am I missing something?
__________________
Jibran Haider
Jibran is offline   Reply With Quote

Old   July 27, 2017, 22:20
Default
  #7
New Member
 
Flyer
Join Date: Apr 2017
Posts: 13
Rep Power: 9
OpenFoam12 is on a distinguished road
Quote:
Originally Posted by alexeym View Post
@ArielJ

You can just remove Layers and Recombine from Extrude command; determine new lines IDs using, for example, GUI and then make them Transfinite. There is an example

Code:
Point(1) = {0, 0, 0};
Point(2) = {1, 0, 0};
Point(3) = {1, 1, 0};
Point(4) = {0, 1, 0};

Line(1) = {1, 2};
Line(2) = {4, 3};
Line(3) = {1, 4};
Line(4) = {2, 3};
Line Loop(5) = {3, 2, -4, -1};
Plane Surface(6) = {5};
Extrude {0, 0, 1} {
  Surface{6};
}

Transfinite Line {1, 2, 3, 4} = 11;

// New lines due to extrusion in the new surface
Transfinite Line {8, 9, 10, 11} = 11;

// New vertical lines due to extrusion
Transfinite Line {13, 14, 18, 22} = 51 Using Bump 0.1;

Transfinite Surface "*";
Recombine Surface "*";
Hi Alexey,

I wonder how did you come with the number 0.1 for 51 nodes? Could you please give a little explanation?

Thank you,
OpenFoam12 is offline   Reply With Quote

Old   June 14, 2018, 23:22
Default
  #8
Member
 
Hilbert
Join Date: Aug 2015
Location: Australia
Posts: 50
Rep Power: 11
Hillie is on a distinguished road
Quote:
Originally Posted by Jibran View Post
Hi Alexey.

This script seems to produce the desired result only on the surface (structured quadrilaterals). The domain is meshed using tetrahedrals. Can you please confirm this or am I missing something?

Just a small message for anybody who finds this thread:
Adding Transfinite Volume "*"; to the script means that the volume is meshed correctly as well.
Hillie is offline   Reply With Quote

Reply

Tags
bump, extrude, gmsh, layers, transfinite surface

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] Gmsh bump functionn.. OpenFoam12 OpenFOAM Meshing & Mesh Conversion 2 March 3, 2021 02:49
GMSH extrude a boundary layer from an unstructured Mesh Hillie Mesh Generation & Pre-Processing 2 July 7, 2017 03:38
[Gmsh] 2D Mesh Generation Tutorial for GMSH aeroslacker OpenFOAM Meshing & Mesh Conversion 12 January 19, 2012 03:52
[Gmsh] Cannot get the right mesh from gmsh JinBiao OpenFOAM Meshing & Mesh Conversion 2 August 31, 2010 04:51
[Gmsh] Import problem ARC OpenFOAM Meshing & Mesh Conversion 0 February 27, 2010 10:56


All times are GMT -4. The time now is 20:12.