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

[Gmsh] Geometry with Obstacles

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 18, 2023, 02:22
Default Geometry with Obstacles
  #1
Member
 
Khan
Join Date: Jul 2018
Posts: 45
Rep Power: 7
HumanistEngineer is on a distinguished road
I am new to OpenFoam and also to GMSH.

I try to model an axisymmetric geometry for a sensible stratified heat storage tank. I need to define empty geometry at the inlet and outlet of the tank as obstacles (namely diffusers).

Please see attached geo file; when I apply 3D meshing, it works but the diffusers also get meshed with the inner medium.

Would you please help me with this issue?

Kind regards.
Hakan
Attached Files
File Type: gz geometryObstacle.tar.gz (1.1 KB, 0 views)
HumanistEngineer is offline   Reply With Quote

Old   February 18, 2023, 22:07
Default Solution
  #2
Member
 
Khan
Join Date: Jul 2018
Posts: 45
Rep Power: 7
HumanistEngineer is on a distinguished road
I could overcome this issue via subtracting the obstacle (empty) volume from the main medium volume by use of "BooleanDifference", see the code below for geo file:

Code:
SetFactory("OpenCASCADE");

// Inputs 
r_tank=2.56/2; 	// m - radius of tank
r_pipe=0.075;  	// m - radius of pipe 
r_diff=0.8; 	// m - radius of diffuser

h_tank=3.83; 	// m - tank height
h_pipe=0.25; 	// m - inlet/outlet height

h_such=0.13; 	// m - suction head

t_diff=0.005; 	// m - material thickness (diffuser and pipe)
h_diff=0.075; 	// m - diffuser gap height

grid_s=1; 	// grid size

// Geometry - Tank
Point(1) = {0,0,0,grid_s};
Point(2) = {r_pipe,0,0,grid_s};
Point(3) = {r_pipe,0,h_pipe,grid_s};
Point(4) = {r_tank,0,h_pipe,grid_s};
Point(5) = {r_tank,0,h_pipe+h_tank,grid_s};
Point(6) = {r_pipe,0,h_pipe+h_tank,grid_s};
Point(7) = {r_pipe,0,h_pipe+h_tank+h_pipe,grid_s};
Point(8) = {0,0,h_pipe+h_tank+h_pipe,grid_s};

Line(1) = {1,2};
Line(2) = {2,3};
Line(3) = {3,4};
Line(4) = {4,5};
Line(5) = {5,6};
Line(6) = {6,7};
Line(7) = {7,8};
Line(8) = {8,1};

Line Loop(1) = {1,2,3,4,5,6,7,8};

Plane Surface(0) = {1};

// Geometry - Diffuser - Bottom
Point(9) = {0,0,h_pipe+h_diff,grid_s};
Point(10)= {r_diff,0,h_pipe+h_diff,grid_s};
Point(11)= {r_diff,0,h_pipe+h_diff+t_diff,grid_s};
Point(12)= {0,0,h_pipe+h_diff+t_diff,grid_s};

Line(9) = {9,10};
Line(10)= {10,11};
Line(11)= {11,12};
Line(12)= {12,9};

Line Loop(2) = {9,10,11,12};

Plane Surface(1) = {2};

// Geometry - Diffuser - Top Plate
Point(13)= {0,0,h_tank+h_pipe-h_such-h_diff-t_diff,grid_s};
Point(14)= {r_diff,0,h_tank+h_pipe-h_such-h_diff-t_diff,grid_s};
Point(15)= {r_diff,0,h_tank+h_pipe-h_such-h_diff,grid_s};
Point(16)= {0,0,h_tank+h_pipe-h_such-h_diff,grid_s};

Line(13)= {13,14};
Line(14)= {14,15};
Line(15)= {15,16};
Line(16)= {16,13};

Line Loop(3) = {13,14,15,16};

Plane Surface(2) = {3};

// Geometry - Diffuser - Top Inlet
Point(17)= {r_pipe,0,h_tank+h_pipe-h_such-t_diff,grid_s};
Point(18)= {r_diff,0,h_tank+h_pipe-h_such-t_diff,grid_s};
Point(19)= {r_diff,0,h_tank+h_pipe-h_such,grid_s};
Point(20)= {r_pipe+t_diff,0,h_tank+h_pipe-h_such,grid_s};
Point(21)= {r_pipe+t_diff,0,h_tank+h_pipe,grid_s};

Line(17)= {17,18};
Line(18)= {18,19};
Line(19)= {19,20};
Line(20)= {20,21};
Line(21)= {21,6};
Line(22)= {6,17};

Line Loop(4) = {17,18,19,20,21,22};

Plane Surface(3) = {4};

// Union of Diffuser Surfaces

// Plane Surface (4) = BooleanUnion{ Surface{1}; Delete; }{ Surface{2,3}; Delete; };

// Subtracting Diffuser from the Main Flow Body

// Plane Surface (5) = BooleanDifference{ Surface{1}; }{ Surface{4}; Delete; };

// Rotating the Surface and Forming Volume (AxiSymmetric)
Rotate {{0,0,1},{0,0,0},-2.5*Pi/180.0}
{
	Surface {0};
}

Extrude {{0,0,1},{0,0,0},5*Pi/180.0}
{
	Surface {0};
	Layers{1};
	Recombine;
}

// Rotating the Surface and Forming Volume - diffuser (AxiSymmetric)
// BooleanUnion{ Surface{1}; Delete; }{ Surface{2,3}; Delete; }


Rotate {{0,0,1},{0,0,0},-2.5*Pi/180.0}
{
	Surface {1};
}

Extrude {{0,0,1},{0,0,0},5*Pi/180.0}
{
	Surface {1};
	Layers{1};
	Recombine;
}

BooleanDifference{ Volume{1}; Delete;}{ Volume{2}; Delete;}

Rotate {{0,0,1},{0,0,0},-2.5*Pi/180.0}
{
	Surface {2};
}

Extrude {{0,0,1},{0,0,0},5*Pi/180.0}
{
	Surface {2};
	Layers{1};
	Recombine;
}

BooleanDifference{ Volume{1}; Delete;}{ Volume{2}; Delete;}

Rotate {{0,0,1},{0,0,0},-2.5*Pi/180.0}
{
	Surface {3};
}

Extrude {{0,0,1},{0,0,0},5*Pi/180.0}
{
	Surface {3};
	Layers{1};
	Recombine;
}

BooleanDifference{ Volume{1}; Delete;}{ Volume{2}; Delete;}

Physical Surface("inlet") = {54};
Physical Surface("outlet") = {43};
Physical Surface("walls") = {44,47,58,57,55};
Physical Surface("wedge_1") = {45};
Physical Surface("wedge_2") = {46};
Physical Surface("diffuser") = {39,40,41,42,48,49,50,51,52,53,56};

Physical Volume("innerFlow") = {1}
HumanistEngineer is offline   Reply With Quote

Reply


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
[ICEM] Volume Meshing Problem; YOUR GEOMETRY HAS A HOLE mariachi ANSYS Meshing & Geometry 5 May 30, 2018 02:52
Question about Geometry vs. Meshes EphemeralMemory ANSYS Meshing & Geometry 2 December 8, 2016 13:02
How to scale and translate the grid of particle data and STL geometry Saidul Tecplot 1 January 11, 2015 21:15
Running CFD parallel. There is no geometry file! CrashLaker SU2 6 April 10, 2014 03:08
[CAD formats] translating geometry from Abaqus to OpenFOAM skuznet OpenFOAM Meshing & Mesh Conversion 3 January 10, 2014 13:49


All times are GMT -4. The time now is 10:26.