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] Gmsh to Openfoam cylinder (https://www.cfd-online.com/Forums/openfoam-meshing/159530-gmsh-openfoam-cylinder.html)

satkinson September 17, 2015 12:31

Gmsh to Openfoam cylinder
 
Hi All,

I am looking to create a multiphase or baffled model and the first step for an initial model is to import a mesh. I prefer to use Gmsh due to the easy layering feature so I creased a simple two cylinders inside of each other.

Point(1) = {0,0,0};

Point(2) = {0.635,0,0};
Point(3) = {0,0.635,0};
Point(4) = {-0.635,0,0};
Point(5) = {0,-0.635,0};

Point(6) = {2,0,0};
Point(7) = {0,2,0};
Point(8) = {-2,0,0};
Point(9) = {0, -2 ,0};

Circle(1) = {2,1,3};
Circle(325) = {3,1,4};
Circle(649) = {4,1,5};
Circle(973) = {5,1,2};

Circle(10) = {6,1,7};
Circle(3250) = {7,1,8};
Circle(6490) = {8,1,9};
Circle(9730) = {9,1,6};

Line Loop(100) = {1,325,649,973};
Line Loop(101) = {10,3250,6490,9730};

Plane Surface(1000) = {100};
Plane Surface(1001) = {101, 100};


surfaceVector[] = Extrude {0, 0, 16} {
Surface{1000};
Layers{1};
Recombine;
};

surfaceVector4[] = Extrude {0, 0, 16} {
Surface{1001};
Layers{1};
Recombine;
};

Physical Volume("fuel") = surfaceVector[1];


Physical Volume("block") = surfaceVector4[1];

Physical Surface("blockboundary") = {surfaceVector4[2], surfaceVector4[4], surfaceVector4[3], surfaceVector4[5]};
Physical Surface("cylinder") = {surfaceVector4[9], surfaceVector4[8], surfaceVector4[7], surfaceVector4
[6]};


Mesh.RemeshParametrization=4;
Mesh.RemeshAlgorithm=1;
Mesh.Algorithm = 6;
Mesh.Algorithm3D = 6;
Mesh.SubdivisionAlgorithm = 0;

When I visualise this structure in gmsh I see all of the surfaces individually, which I want to turn into boundaries later. Unfortunately no matter what I try when I use gmshToFoam on this, the surfaces are never transferred and they are always grouped together in defaultFaces.

I have also tried to extrude each volume separately however using this method the surfaces don't fully surround the cylinder when opened in paraview and the faces are placed in defaultFaces again.

One way to get around this is to use splitmesh which gives me two sets of default faces which I can rename and this is an option for creating multiphase designs, however I think that Openfoam is trying to phase out multiphase designs for thermal calculations and move everything to baffles instead? I have not seen an example for baffled programs using splitmesh yet in the tutorials. Eventually I will have conduction and turbulent convection (k-epsilon model) in the model so I am looking for the easiest method to accommodate all of these properties if there are any suggestions.

Cheers,

Satkinson


All times are GMT -4. The time now is 08:56.