CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [Gmsh] Creating a mesh for a flow across an obstacle with Gmsh (https://www.cfd-online.com/Forums/openfoam-meshing/213783-creating-mesh-flow-across-obstacle-gmsh.html)

heitorvitorc January 8, 2019 13:33

Creating a mesh for a flow across an obstacle with Gmsh
 
Dear community;

I started to work with OpenFOAM 2 months ago, and I feel like I can handle many things by myself right now. However I can't figure out how to create a mesh file using Gmsh. Here is my case:

I must simulate a laminar flow of a compressible fluid (gas - Reservoir) in a porous media. But before that, I need to create a development curve, hence, I must create simpler cases and evolve as times goes by. The first case was just as the cavity example in OpenFOAM tutorials directory. Now I must simulate the flow considering 2 obstacles (2 cylinders ). The idea is to simplify the porous media as a flow across several cylinders, in 2D (which means: first 2 cylinders, then 4, then 8 ,then ....). But here is the problem.

Ok, I define the geometry easily,

Point(1) = {0,0,0};
Point(2) = {1,0,0};
Point(3) = {1,1,0};
Point(4) = {0,1,0};

Point(5) = {0.25, 0.15,0};
Point(6) = {0.25, 0.25,0};
Point(7) = {0.25, 0.35,0};

Point(8) = {0.25, 0.65,0};
Point(9) = {0.25, 0.75,0};
Point(10) = {0.25, 0.85,0};

Line(11) = {1,2};
Line(12) = {2,3};
Line(13) = {3,4};
Line(14) = {4,1};

Circle(15) = {5,6,7};
Circle(16) = {7,6,5};

Circle(17) = {8,9,10};
Circle(18) = {10,9,8};

Line Loop(19) = {11,12,13,14};

Curve Loop(20) = {15,16};
Curve Loop(21) = {17,18};

Plane Surface(22) = {19,20,21};

Transfinite Line{11,12,13,14,15,16,17,18} = 21;
Transfinite Surface{21};

Recombine Surface{22};

Until here, everything seems fine, i suppose. But when I try to Extrude the geometry in order to adapt the file for OpenFOAM by using

new[] =
Extrude{0,0,1/20}
{
Surface{22};
Layers{1};
Recombine;
}

The cylinders (the obstacles) don't extrude, and I get the message:
"Error: Unknown curve in extruded faces"

I wonder if someone could help me with this. I basicly need to know how to generate a 3d file with the "hole" left by the cylinders. Since I must evolve the problem for a more complex geometry, and also the flow will become turbulent, I need to find out how to solve this first task soon. How can I generate the .geo file with the correct geometry and dimensions?


I am very sorry if this question turns out to be a stupid one, but since I am new in CFD, I need to learn everything I can in order to improve my skills and become a better professional.


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