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

GMSH 3D mesh generation

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 9, 2024, 04:47
Default GMSH 3D mesh generation
  #1
New Member
 
sr
Join Date: Mar 2024
Posts: 1
Rep Power: 0
silviorestivo is on a distinguished road
Dear all,



I'm trying to generate a 3D mesh for an external CFD problem in gmsh. I have generated the domain shape and imported the .stp file of the body but I can't understand how to subtract this body from the volume domain (I want the mesh only outside of the body). Here you can find a simple example in which I want to create an external mesh around a sphere:


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

SetFactory('OpenCASCADE');

Point(1) = {1, -1, -1, 1.0};
Point(2) = {1, 1, -1, 1.0};
Point(3) = {-1, 1, -1, 1.0};
Point(4) = {-1, -1, 1, 1.0};
Point(5) = {1, -1, 1, 1.0};
Point(6) = {1, 1, 1, 1.0};
Point(7) = {-1, 1, 1, 1.0};
Point(8) = {-1, -1, -1, 1.0};
Line(1) = {7, 6};
Line(2) = {6, 5};
Line(3) = {5, 1};
Line(4) = {1, 8};
Line(5) = {8, 3};
Line(6) = {3, 7};
Line(7) = {7, 4};
Line(8) = {4, 8};
Line(9) = {4, 5};
Line(10) = {2, 1};
Line(11) = {2, 6};
Line(12) = {2, 3};
//+
Line Loop(1) = {6, 1, -11, 12};
Plane Surface(1) = {1};
Line Loop(2) = {11, 2, 3, -10};
Plane Surface(2) = {2};
Line Loop(3) = {2, -9, -7, 1};
Plane Surface(3) = {-3};
Line Loop(4) = {6, 7, 8, 5};
Plane Surface(4) = {-4};
Line Loop(5) = {8, -4, -3, -9};
Plane Surface(5) = {5};
Line Loop(6) = {10, 4, 5, -12};
Plane Surface(6) = {6};
//+
Merge "sphere.stp";
//+
Physical Surface(1) = {4, 3, 2, 6};
Physical Surface(2) = {1};
Physical Surface(3) = {5};
Physical Surface(4) = {7, 8};
//+
Surface Loop(2) = {6, 2, 1, 4, 3, 5};
Volume(2) = {2, 1};
----------------------------------------------

Does anyone know how to do it?


With kind regards,
Silvio
silviorestivo is offline   Reply With Quote

Old   May 22, 2024, 02:43
Default
  #2
New Member
 
Gaurav Gupta
Join Date: May 2024
Posts: 3
Rep Power: 2
airwarriorg91 is on a distinguished road
Hii,
I guess you want to generate a 3D mesh for flow around a sphere. I am also trying to do the same but a structured one in gmsh. Having a tough time with that.

For subtracting the sphere from the domain, you can use the BooleanDifference command in gmsh. I am not sure how to use it with a imported model but if its a volume the boolean operation can be done.

Hope it helps !

Gaurav.
airwarriorg91 is offline   Reply With Quote

Reply

Tags
3d mesh, domain, gmsh


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] non uniform mesh near the stl object vava10 OpenFOAM Meshing & Mesh Conversion 0 January 31, 2021 14:41
how to set periodic boundary conditions Ganesh FLUENT 15 November 18, 2020 06:09
decomposePar problem: Cell 0contains face labels out of range vaina74 OpenFOAM Pre-Processing 37 July 20, 2020 05:38
[Gmsh] GMSH : structured mesh issue bibiboom OpenFOAM Meshing & Mesh Conversion 0 May 17, 2017 18:49
[Gmsh] gmshToFoam problem: not the same mesh in Gmsh vs. paraview zhernadi OpenFOAM Meshing & Mesh Conversion 8 July 7, 2011 02:28


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