|
| 1 | +// ----------------------------------------------------------------------------------- // |
| 2 | +// Tobias Kattmann, 09.09.2021, 2D Venturi Primitive for faster debugging |
| 3 | +// ----------------------------------------------------------------------------------- // |
| 4 | + |
| 5 | +// Evoque Meshing Algorithm? |
| 6 | +Do_Meshing= 1; // 0=false, 1=true |
| 7 | +// Write Mesh files in .su2 format |
| 8 | +Write_mesh= 1; // 0=false, 1=true |
| 9 | + |
| 10 | +// Geometric inputs |
| 11 | +gas_inlet_diameter= 0.015; |
| 12 | +air_inlet_diameter= 0.015; |
| 13 | +gas_tube_length=0.045; |
| 14 | +air_tube_length=0.045; |
| 15 | +downstream_length= 0.09; |
| 16 | + |
| 17 | +// Mesh sizing inputs |
| 18 | +Nwall= 30; // Nodes for all spacings |
| 19 | +gridsize= 0.1; // Later on not important as structured mesh is achieved |
| 20 | + |
| 21 | +// ----------------------------------------------------------------------------------- // |
| 22 | +// POINTS |
| 23 | + |
| 24 | +// Starting in the origin, which is the most low-left point, and going clockwise. |
| 25 | +// Gas inlet |
| 26 | +Point(1) = {0, 0, 0, gridsize}; |
| 27 | +Point(2) = {0, gas_inlet_diameter, 0, gridsize}; |
| 28 | +// |
| 29 | +Point(3) = {gas_tube_length, gas_inlet_diameter, 0, gridsize}; |
| 30 | +// Air inlet |
| 31 | +Point(4) = {gas_tube_length, gas_inlet_diameter+air_tube_length, 0, gridsize}; |
| 32 | +Point(5) = {gas_tube_length+air_inlet_diameter, gas_inlet_diameter+air_tube_length, 0, gridsize}; |
| 33 | +// |
| 34 | +Point(6) = {gas_tube_length+air_inlet_diameter, gas_inlet_diameter, 0, gridsize}; |
| 35 | +// outlet |
| 36 | +Point(7) = {gas_tube_length+air_inlet_diameter+downstream_length, gas_inlet_diameter, 0, gridsize}; |
| 37 | +Point(8) = {gas_tube_length+air_inlet_diameter+downstream_length, 0, 0, gridsize}; |
| 38 | +// |
| 39 | +Point(9) = {gas_tube_length+air_inlet_diameter, 0, 0, gridsize}; |
| 40 | +Point(10) = {gas_tube_length, 0, 0, gridsize}; |
| 41 | + |
| 42 | +// ----------------------------------------------------------------------------------- // |
| 43 | +// LINES |
| 44 | + |
| 45 | +// Gas inlet box, clockwise |
| 46 | +Line(1) = {1,2}; |
| 47 | +Line(2) = {2,3}; |
| 48 | +Line(3) = {3,10}; |
| 49 | +Line(4) = {10,1}; |
| 50 | + |
| 51 | +// air inlet box, clockwise |
| 52 | +Line(5) = {3,4}; |
| 53 | +Line(6) = {4,5}; |
| 54 | +Line(7) = {5,6}; |
| 55 | +Line(8) = {6,3}; |
| 56 | + |
| 57 | +// downstream box, clockwise |
| 58 | +Line(9) = {6,7}; |
| 59 | +Line(10) = {7,8}; |
| 60 | +Line(11) = {8,9}; |
| 61 | +Line(12) = {9,6}; |
| 62 | + |
| 63 | +// remaining lower middle box line |
| 64 | +Line(13) = {9,10}; |
| 65 | + |
| 66 | +// ----------------------------------------------------------------------------------- // |
| 67 | +// SURFACES (and Lineloops) |
| 68 | +Curve Loop(1) = {1, 2, 3, 4}; Plane Surface(1) = {1}; // Gas inlet box |
| 69 | +Curve Loop(2) = {5, 6, 7, 8}; Plane Surface(2) = {2}; // air inlet box |
| 70 | +Curve Loop(3) = {9, 10, 11, 12}; Plane Surface(3) = {3}; // downstream box |
| 71 | +Curve Loop(4) = {8, 3, -13, 12}; Plane Surface(4) = {4}; // middle box |
| 72 | + |
| 73 | +// make structured mesh with transfinite Lines |
| 74 | +// NOTE: The usage of Nwall and the progression has to be tuned again for any changes. |
| 75 | +Transfinite Line{1,-3,12,-10} = Nwall Using Progression 0.9; // Spacing to the wall of the long tube, progression towards top wall |
| 76 | +Transfinite Line{2,-4} = Nwall Using Progression 0.9; // Downstream spacing of gas inlet, progression towards air inlet |
| 77 | + |
| 78 | +Transfinite Line{6,-8,-13} = Nwall Using Bump 0.1; // Spacing to the wall of the air inlet tube, progression towards side walls |
| 79 | +Transfinite Line{-5,7} = Nwall Using Progression 0.9; // Downstream spacing of air inlet, progression towards gas inlet |
| 80 | + |
| 81 | +Transfinite Line{-9,11} = Nwall Using Progression 0.9; // Downstream spacing of air inlet, progressio |
| 82 | + |
| 83 | +// ----------------------------------------------------------------------------------- // |
| 84 | +// PHYSICAL GROUPS |
| 85 | + |
| 86 | +Physical Line("gas_inlet") = {1}; |
| 87 | +Physical Line("air_axial_inlet") = {6}; |
| 88 | +Physical Line("outlet") = {10}; |
| 89 | +Physical Line("axis") = {4,13,11}; |
| 90 | +Physical Line("wall") = {2,5,7,9}; |
| 91 | + |
| 92 | +Physical Surface("fluid") = {1,2,3,4}; |
| 93 | + |
| 94 | +// ----------------------------------------------------------------------------------- // |
| 95 | +// Meshing |
| 96 | +Transfinite Surface "*"; |
| 97 | +Recombine Surface "*"; |
| 98 | + |
| 99 | +If (Do_Meshing == 1) |
| 100 | + Mesh 1; Mesh 2; |
| 101 | +EndIf |
| 102 | + |
| 103 | +// ----------------------------------------------------------------------------------- // |
| 104 | +// Write .su2 meshfile |
| 105 | +If (Write_mesh == 1) |
| 106 | + |
| 107 | + Mesh.Format = 42; // .su2 mesh format, |
| 108 | + Save "primitiveVenturi.su2"; |
| 109 | + |
| 110 | +EndIf |
| 111 | + |
0 commit comments