# GMSH 3D mesh generation

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

 May 9, 2024, 04:47 GMSH 3D mesh generation #1 New Member   sr Join Date: Mar 2024 Posts: 1 Rep Power: 0 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

 May 22, 2024, 02:43 #2 New Member   Gaurav Gupta Join Date: May 2024 Posts: 12 Rep Power: 2 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.

 Tags 3d mesh, domain, gmsh