CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Special Topics > Mesh Generation & Pre-Processing

Locally refining mesh over cylinder in Gmsh

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 3, 2020, 23:34
Default Locally refining mesh over cylinder in Gmsh
  #1
New Member
 
Deepak
Join Date: Nov 2020
Posts: 2
Rep Power: 0
dgmadival is on a distinguished road
I want to mesh a cylinder in Gmsh with a finer mesh at a particular circular location along its height. I have succeeded partially with the code below:

--------------------------------------------------------------------------------
SetFactory("OpenCASCADE");

//Create a circle
Circle(1) = {0, 0, 6, 1, 0, 2*Pi};
Curve Loop(1) = {1};
Plane Surface(1) = {1};

//Extrude into a cylinder 4 units along Z-direction and 6 units along -Z direction
Extrude {0, 0, 4} {
Surface{1};
}

Extrude {0, 0, -6} {
Surface{1};
}

//Convert Circle 1 into transfinite line so that a fine mesh can be obtained in its vicinity
Transfinite Line{1}=100;

--------------------------------------------------------------------------------------

The mesh is coming out fine (when I do a 2D or 3D mesh) except at the location where the generator of the extruded cylinder intersects the circle (here the mesh is coarse). Any ideas on how to overcome the problem and obtain a uniformly fine mesh at Circle(1)?
dgmadival is offline   Reply With Quote

Old   November 5, 2020, 13:55
Default
  #2
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 12
Flowkersma is on a distinguished road
At the moment, you are only defining the cell size along the line. You should also define the cell size elsewhere. For instance, define the cell sizes at the points:
Characteristic Length {1} = 0.1;
Characteristic Length {2, 3} = 1;
Flowkersma is offline   Reply With Quote

Old   November 6, 2020, 01:02
Default
  #3
New Member
 
Deepak
Join Date: Nov 2020
Posts: 2
Rep Power: 0
dgmadival is on a distinguished road
Your solution worked Thanks a lot.

But what do points 1,2,3 correspond to? Are they the three points at which cylinder's generator-line intersects the three circles?
dgmadival is offline   Reply With Quote

Old   November 6, 2020, 01:40
Default
  #4
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 12
Flowkersma is on a distinguished road
You are welcome. If you visually look at the geometry, it contains only 3 points. The points are the start/end points of each circle.
Flowkersma is offline   Reply With Quote

Reply

Tags
gmsh 4.5.4, mesh 2d, refine mesh


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
Prescribed Translating Cylinder Mesh for Added Mass Problem (Transient FSI) Lloyd Sullivan CFX 5 August 7, 2018 08:11
Gambit problems Althea FLUENT 22 January 4, 2017 03:19
[snappyHexMesh] Layers:problem with curvature giulio.topazio OpenFOAM Meshing & Mesh Conversion 10 August 22, 2012 09:03
[snappyHexMesh] snappyHexMesh won't work - zeros everywhere! sc298 OpenFOAM Meshing & Mesh Conversion 2 March 27, 2011 21:11
Convergence moving mesh lr103476 OpenFOAM Running, Solving & CFD 30 November 19, 2007 14:09


All times are GMT -4. The time now is 04:22.