[Gmsh] [gmsh] Boundary layers

Laurent Opsomer laurent.opsomer at student.uclouvain.be
Thu Mar 24 14:19:29 CET 2016


Hello,

I am trying to create a mesh for a special ejector, and I need to create 
2 boundary layers (see attached .geo file at lines 324-346), but I don't 
manage to create the two of them, only one boundary layer is created... 
Where did I go wrong?

Thank you very much for your help,

Best regards,

Laurent Opsomer
-------------- next part --------------
// -*- C++ -*-

cl__1 = 0.5;
Mesh.ScalingFactor=0.001;
meshThickness=50;



x1=-422.01;
x2=-45.5;
x3=-36.36;
x4=-34.16;
x5=-20.26;
x6=0.0;
x7=70.15;
x8=280.6;
x9=283.250746;
x10=1018.98;
x11=x1;
x12=x2;
x13=x3;
x14=x4;
x15=x4;
x21=x1;
x22=x1+182.77;
x23=x22+0.95*(x15-x22);
x31=x1;
x32=x22+3.29217825;
x34=x15+3.29217825;
x33=x32+0.95*(x34-x32);
x35=-9.835124;
x36=x6;
x37=x7;
x38=x8;
x39=x9;
x40=x10;



y1=6.75;
y2=y1;
y3=4.3056656;
y4=3.7173138;
y5=0;
y6=y5;
y7=y5;
y8=y5;
y9=y5;
y10=y5;
y11=10.13;
y12=y11;
y13=y1;
y14=y1; 
y15=8.22;
y21=63.13;
y22=y21;
y23=y22+0.95*(y15-y22);
y31=y21+62.14;
y32=y21+12.2865765;
y34=y15+12.2865765;
y33=y32+0.95*(y34-y32);
y35=14.824819;
y36=13.53;
y37=y36;
y38=y36;
y39=13.622566;
y40=65.07;


z1=-25.0;

Hp_in = 3.38;
Hp_out = 3.0327;
Hs = 12.575;


rps = Hp_in/Hs;


//Point(1) = {x1, y1, z1};
Point(2) = {x2, y2, z1};
Point(3) = {x3, y3, z1};
Point(4) = {x4, y4, z1,0.005};
Point(5) = {x5, y5, z1,0.005};
Point(6) = {x6, y6, z1};
Point(7) = {x7, y7, z1};
Point(8) = {x8, y8, z1};
Point(9) = {x9, y9, z1};
Point(10) = {x10, y10, z1};

//Point(11) = {x11, y11, z1};
Point(12) = {x12, y12, z1};
Point(13) = {x13, y13, z1};
Point(14) = {x14, y14, z1};
Point(15) = {x15, y15, z1};

//Point(21) = {x21, y21, z1};
Point(22) = {x22, y22, z1};
Point(23) = {x23, y23, z1};

//Point(31) = {x31, y31, z1};
Point(32) = {x32, y32, z1};
Point(33) = {x33, y33, z1};
Point(34) = {x34, y34, z1};
Point(35) = {x35, y35, z1};
Point(36) = {x36, y36, z1};
Point(37) = {x37, y37, z1};
Point(38) = {x38, y38, z1};
Point(39) = {x39, y39, z1};

Point(40) = {x10, y40, z1};


R1=38.0;

p36 = newp;
Point(p36 + 1) = {x36, y36+R1, z1};

p38 = newp;
Point(p38 + 1) = {x38, y38+R1, z1};


// LINES 

//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, 9};
Line(9) = {9, 10};
Line(10) = {10, 40};
Line(11) = {40, 39};
Circle(12) = {39, p38 + 1, 38};
Line(13) = {38, 37};
Line(14) = {37, 36};
Circle(15) = {36, p36 + 1, 35};
Line(16) = {35, 34};
Line(17) = {34, 33};
Line(18) = {33, 32};
//Line(19) = {32, 31};
//Line(20) = {31, 21};
//Line(21) = {21, 22};
Line(22) = {22, 23};
Line(23) = {23, 15};
Line(24) = {15, 14};
Line(25) = {14, 13};
Line(26) = {13, 12};
//Line(27) = {12, 11};
//Line(28) = {11, 1};
Line(29) = {2, 12};
Line(30) = {3, 13};
Line(31) = {4, 14};
//Line(32) = {5, 15};
Line(33) = {22, 32};
Line(34) = {23, 33};
Line(35) = {15, 34};
Line(36) = {6, 36};
Line(37) = {7, 37};
Line(38) = {8, 38};
Line(39) = {9, 39};





// PRIMARY


Line Loop(1) = {2, 30, 26, -29};    // CONVERGING PRIMARY
Plane Surface(1) = {1};


Line Loop(2) = {3, 31, 25, -30};    // DIVERGING PRIMARY
Plane Surface(2) = {2};




// SECONDARY

Line Loop(3) = {22, 34, 18, -33};
Plane Surface(3) = {3};


Line Loop(4) = {23, 35, 17, -34};
Plane Surface(4) = {4};


// CONVERGING MIXING 

Line Loop(5) = {4,5, 6, 37, 14, 15, 16, -35, 24,-31};
Plane Surface(5) = {5};


// MIXING
Line Loop(6) = {7, 38, 13, -37};
Plane Surface(6) = {6};


// DIFFUSER 1
Line Loop(7) = {8, 39, 12, -38};
Plane Surface(7) = {7};



// DIFFUSER 2
Line Loop(8) = {9, 10, 11, -39};
Plane Surface(8) = {8};



// PARAMETERS

    dxPrimaryInlet=0.5;

    dxSecondaryInlet=4*dxPrimaryInlet;
    dxSecondaryInletArc=dxSecondaryInlet;
    dxConvMixing=0.2*dxPrimaryInlet;
    dxMixing=2*dxPrimaryInlet;
    dxDiffuserArc=dxMixing;
    dxDiffuser=dxMixing;
   

    expansionRatioPrimary = 0.029; //1.0427;
    expansionRatioSecondary = 0.029;//.005;
    expansionRatioMix = 1.033;

    expansionRatioMixHor1 = 1.0021;
    expansionRatioMixHor2 = 1.0036;
    expansionRatioPrimConvHor = 1.0112;
    expansionRatioPrimDivHor = 1.0166;
    expansionRatioSecondaryHor = 1.1693;

    secondaryInletVert=281;
    secondaryNozzleExit=secondaryInletVert;
    primaryInletVert=Ceil(rps*secondaryInletVert); //=76   //old: 91;
    primaryNozzleExit=primaryInletVert;
    

    mixingSectionVert = 151;


    primaryInletHor1=Ceil(((x2-x1)/dxPrimaryInlet)+1);
    primaryInletHor2=Ceil(((x3-x2)/dxPrimaryInlet)+1);
    primaryInletHor3=126;

    secondaryInletHor1=Ceil(((x33-x32)/dxSecondaryInlet)+1);
    secondaryInletHor2=21;
    
    convergingMixingHor1=Ceil(((x6-x5)/dxConvMixing)+1);
    convergingMixingHor2=Ceil(((x35-x34)/(dxConvMixing))+1);
    convergingMixingHor3=Ceil(((x36-x35)/(dxConvMixing))+1);
    convergingMixingHor4=Ceil(((x5-x4)/dxConvMixing)+1);

    mixingHor1=Ceil(((x7-x6)/dxConvMixing)+1);
    mixingHor1=429;
    mixingHor2=389;
    diffHor1=Ceil(((x9-x8)/dxDiffuserArc)+1);
    diffHor2=Ceil(((x10-x9)/dxDiffuser)+1);


// PRIMARY
    
    // Vertical lines

    Transfinite Line{-29} = primaryInletVert Using Bump expansionRatioPrimary;
    Transfinite Line{-30} = primaryInletVert Using Bump expansionRatioPrimary;
    Transfinite Line{-31} = primaryInletVert Using Bump expansionRatioPrimary;
  

    // Horizontal lines

    Transfinite Line{-2} = primaryInletHor2 Using Progression expansionRatioPrimConvHor;
    Transfinite Line{-3} = primaryInletHor3 Using Progression expansionRatioPrimDivHor;


    Transfinite Line{25} = primaryInletHor3 Using Progression expansionRatioPrimDivHor;
    Transfinite Line{26} = primaryInletHor2 Using Progression expansionRatioPrimConvHor;

    // Meshing of the surface
    
    Transfinite Surface {1}={2, 3, 13, 12};
    Recombine Surface {1};


    Transfinite Surface {2}={3, 4, 14, 13};
    Recombine Surface {2};


// SECONDARY

    // Vertical lines

    Transfinite Line{-33} = secondaryInletVert Using Bump expansionRatioSecondary;
    Transfinite Line{-34} = secondaryInletVert Using Bump expansionRatioSecondary;
    Transfinite Line{-35} = secondaryNozzleExit Using Bump expansionRatioSecondary;

    // Horizontal lines

    Transfinite Line{-22} = secondaryInletHor1;
    Transfinite Line{18} = secondaryInletHor1;

    Transfinite Line{-23} = secondaryInletHor2 Using Progression expansionRatioSecondaryHor;
    Transfinite Line{17} = secondaryInletHor2 Using Progression expansionRatioSecondaryHor;

    // Meshing of the surface
    
    Transfinite Surface {3}={22, 23, 33, 32};
    Recombine Surface {3};
    

    Transfinite Surface {4}={23, 15, 34, 33};
    Recombine Surface {4};


// CONVERGING MIXING 




	Field[1] = BoundaryLayer;
	Field[1].EdgesList = {14, 15, 16};
	Field[1].NodesList = {34, 35, 36, 37};
	Field[1].hfar = dxConvMixing;       // element size far from the wall
	Field[1].hwall_n = 0.00345;         // mesh size normal to the wall
	Field[1].hwall_t = dxConvMixing;    // mesh size tangent to the wall
	Field[1].thickness = 1.9; //0.0004
	Field[1].ratio = expansionRatioMix;
	Field[1].Quads = 1;
	BoundaryLayer Field = 1;
	
	Field[2] = BoundaryLayer;
	Field[2].EdgesList = {4};
	Field[2].NodesList = {4,5};
	Field[2].FacesList = {5};
	Field[2].hfar = dxConvMixing;
	Field[2].hwall_n = 0.00345;
	Field[2].hwall_t = dxConvMixing;
	Field[2].thickness = 0.9; 
	Field[2].ratio = expansionRatioSpike;
	Field[2].Quads = 1;
	
	BoundaryLayer Field = 2;
	
	
 
	

	


    // Vertical lines
    
    Transfinite Line{-37} = mixingSectionVert Using Progression expansionRatioMix;
    
    // Horizontal lines

    Transfinite Line{4} = convergingMixingHor4;
    Transfinite Line{5} = convergingMixingHor1;
    Transfinite Line{-15} = convergingMixingHor3;
    Transfinite Line{-16} = convergingMixingHor2;
    Transfinite Line{6} = mixingHor1 Using Progression expansionRatioMixHor1;
    Transfinite Line{-14} = mixingHor1 Using Progression expansionRatioMixHor1;
  
    // Meshing of the surface

    Recombine Surface {5};



// MIXING

    // Vertical lines

    Transfinite Line{-38} = mixingSectionVert Using Progression expansionRatioMix;

    // Horizontal lines

    Transfinite Line{7} = mixingHor2 Using Progression expansionRatioMixHor2;
    Transfinite Line{-13} = mixingHor2 Using Progression expansionRatioMixHor2;

    // Meshing of the surface

    Transfinite Surface {6}={7, 8, 38, 37};
    Recombine Surface {6};


// DIFFUSER 1

    // Vertical lines

    Transfinite Line{-39} = mixingSectionVert Using Progression expansionRatioMix;

    // Horizontal lines

    Transfinite Line{8} = diffHor1;
    Transfinite Line{-12} = diffHor1;

    // Meshing of the surface

    Transfinite Surface {7}={8, 9, 39, 38};
    Recombine Surface {7};

// DIFFUSER 2

    // Vertical lines

    Transfinite Line{-10} = mixingSectionVert Using Progression expansionRatioMix;

    // Horizontal lines

    Transfinite Line{9} = diffHor2;
    Transfinite Line{-11} = diffHor2;

    // Meshing of the surface

    Transfinite Surface {8}={9, 10, 40, 39};
    Recombine Surface {8};






// Extrusion 3D


    surfaceVector[] = Extrude {0, 0, meshThickness} {
     Surface{1,2,3,4,5,6,7,8};
     Layers{1};
     Recombine;
    };

  

    /*

    surfaceVector contains in the following order:
    [0]	- front surface (opposed to source surface)
    [1] - extruded volume
    [2] - surface belonging to 1st line in "Line Loop (1)")
    [3] - surface belonging to 2nd line in "Line Loop (1)")
    [4] - surface belonging to 3rd line in "Line Loop (1)")
    [5] - surface belonging to 4th line in "Line Loop (1)") 
    [6] - surface belonging to 5th line in "Line Loop (1)")
    ...
    
    */




    /*Physical Volume("internal") = {1,2,3,4,5,6,7,8};
    Physical Surface("front") = {61,83,105,127,157,179,201,223,245};
    Physical Surface("back") = {1,2,3,4,5,6,7,8};
    Physical Surface("axis") = {146,150,188,210,232};
    Physical Surface("primaryInlet") = {60};
    Physical Surface("secondaryInlet") = {104};
    Physical Surface("outlet") = {236};
    Physical Surface("primaryWall") = {56,78,48,70};
    Physical Surface("secondaryWall") = {100,92,122,114};
    Physical Surface("convMixingWall") = {162,166,142,174};
    Physical Surface("mixingWall") = {158,196};
    Physical Surface("diffuserWall") = {240,218};*/
   
    
   
  
    Physical Volume("internal") = {surfaceVector[1], surfaceVector[7], surfaceVector[13], surfaceVector[19], surfaceVector[25], surfaceVector[37], surfaceVector[43],surfaceVector[49]};
     Physical Surface("front") = {surfaceVector[0], surfaceVector[6], surfaceVector[12], surfaceVector[18], surfaceVector[24], surfaceVector[36], surfaceVector[42],surfaceVector[48]};
      Physical Surface("back") = {1,2,3,4,5,6,7,8};
    Physical Surface("axis") = {surfaceVector[27], surfaceVector[28],surfaceVector[38], surfaceVector[44], surfaceVector[50]};
    Physical Surface("primaryInlet") = surfaceVector[5];
    Physical Surface("secondaryInlet") = surfaceVector[17];
    Physical Surface("outlet") = surfaceVector[51];
    Physical Surface("primaryWall") = {surfaceVector[2], surfaceVector[8], surfaceVector[4], surfaceVector[10]};
    Physical Surface("secondaryWall") = {surfaceVector[14],surfaceVector[20],surfaceVector[16], surfaceVector[22]};
    Physical Surface("convMixingWall") = {surfaceVector[31], surfaceVector[32],surfaceVector[34], surfaceVector[26]};
    Physical Surface("mixingWall") = {surfaceVector[30], surfaceVector[40]};
    Physical Surface("diffuserWall") = {surfaceVector[46], surfaceVector[52]};
   
    
 



More information about the gmsh mailing list