|
[Sponsors] |
May 9, 2024, 05: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, 03:43 |
|
#2 |
New Member
Gaurav Gupta
Join Date: May 2024
Posts: 23
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. |
|
July 16, 2024, 09:22 |
|
#3 |
Senior Member
Klaus
Join Date: Mar 2009
Posts: 281
Rep Power: 22 |
Have a look at the 3D naca boundary layer example at: https://gitlab.onelab.info/gmsh/gmsh...r/examples/api
|
|
Tags |
3d mesh, domain, gmsh |
|
|
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 15:41 |
how to set periodic boundary conditions | Ganesh | FLUENT | 15 | November 18, 2020 07:09 |
decomposePar problem: Cell 0contains face labels out of range | vaina74 | OpenFOAM Pre-Processing | 37 | July 20, 2020 06:38 |
[Gmsh] GMSH : structured mesh issue | bibiboom | OpenFOAM Meshing & Mesh Conversion | 0 | May 17, 2017 19:49 |
[Gmsh] gmshToFoam problem: not the same mesh in Gmsh vs. paraview | zhernadi | OpenFOAM Meshing & Mesh Conversion | 8 | July 7, 2011 03:28 |