/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.1.0 | | \\ / A nd | Web: http://www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object blockMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // //TO VISUALIZE THE DEFINED POINTS, TYPE 'paraFoam -block' convertToMeters 1.0; //dimensions (you will neeed to adjust these) D 1; //cylinder diameter L_before #calc "4*$D"; //length before the cylinder (x-dir) L_after #calc "10*$D"; //length after the cylinder (x-dir) Height #calc "10*$D"; //height of the mesh (y-dir) ////////////////////////////// //calculated DO NOT MODIFY ///////////////////////////// sin45 0.70711; cos45 0.70711; R #calc "0.5*$D"; negativeR #calc "-0.5*$D"; bigR #calc "4*$R"; //this controls the size of the 4 blocks nearest to the cylinder ////////////////////////////// //coordinate definitions DO NOT MODIFY ///////////////////////////// //all possible x-coordinates x0 #calc "-$L_before"; x1 #calc "-$sin45*$bigR"; x2 #calc "-$sin45*$R"; x3 #calc " $sin45*$R"; x4 #calc " $sin45*$bigR"; x5 #calc " $L_after"; //all possible y-coordinates y0 #calc "-$Height"; y1 #calc "-$cos45*$bigR"; y2 #calc "-$cos45*$R"; y3 #calc " $cos45*$R"; y4 #calc " $cos45*$bigR"; y5 #calc " $Height"; //all possible z-coordinates z0 #calc "-1*$R"; z1 #calc " 1*$R"; //////////////////////////// vertices ( //All required points are defined so DO NOT MODIFY //y0-points ($x0 $y0 $z0) //0 ($x0 $y0 $z1) //1 ($x1 $y0 $z0) //2 ($x1 $y0 $z1) //3 ($x4 $y0 $z0) //4 ($x4 $y0 $z1) //5 ($x5 $y0 $z0) //6 ($x5 $y0 $z1) //7 //y1-points ($x0 $y1 $z0) //8 ($x0 $y1 $z1) //9 ($x1 $y1 $z0) //10 ($x1 $y1 $z1) //11 ($x4 $y1 $z0) //12 ($x4 $y1 $z1) //13 ($x5 $y1 $z0) //14 ($x5 $y1 $z1) //15 //y2-points (cylinder lower half) ($x2 $y2 $z0) //16 ($x2 $y2 $z1) //17 ($x3 $y2 $z0) //18 ($x3 $y2 $z1) //19 //y3-points (cylinder upper half) ($x2 $y3 $z0) //20 ($x2 $y3 $z1) //21 ($x3 $y3 $z0) //22 ($x3 $y3 $z1) //23 //y4-points ($x0 $y4 $z0) //24 ($x0 $y4 $z1) //25 ($x1 $y4 $z0) //26 ($x1 $y4 $z1) //27 ($x4 $y4 $z0) //28 ($x4 $y4 $z1) //29 ($x5 $y4 $z0) //30 ($x5 $y4 $z1) //31 //y5-points ($x0 $y5 $z0) //32 ($x0 $y5 $z1) //33 ($x1 $y5 $z0) //34 ($x1 $y5 $z1) //35 ($x4 $y5 $z0) //36 ($x4 $y5 $z1) //37 ($x5 $y5 $z0) //38 ($x5 $y5 $z1) //39 ); blocks ( //Define these ); edges ( //Define these //To define a circular edge the syntax is: //arc p1 p2 (x y z) //where p1 and p2 are start and end points of the curved edge and (x y z) is a coordinate //between points p1 and p2 from which the curve goes thrgouh ); boundary ( //define the patches ); mergePatchPairs ( );