Skip to content
Snippets Groups Projects
blockMeshDict 4.37 KiB
Newer Older
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  8
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

felix's avatar
felix committed
convertToMeters 0.01;  // centimetres.  According to https://cfd.direct/openfoam/user-guide/v8-blockmesh/

#include "../scale";  // gives global N
rx 3.5355339059327373;
felix's avatar
felix committed
// = // rx #calc "5.0 / Foam::sqrt(2.0)";  // length of short side of rectangular triangle with long side =5
felix's avatar
felix committed

arcNx #calc "50 * $N";
arcNy #calc " 30 * $N";
felix's avatar
felix committed

felix's avatar
felix committed
thickness 100;    // in other files 0.5 = 50 cm = 50 is assumed to be a valid z coordinate (probes)
felix's avatar
felix committed
    // F = front (z = 0), B = back   (z = $thickness)
felix's avatar
felix committed
    // bottom = b, t = top, n = middle (left/right of center of cylinder)
    // l = left, r = right, m = middle (under center of cylinder), s = other square around cylinder corner
    // c = cylinder
    // (0, 0, 0) = center of cylinder in front
    name Fbl (-20 -20 0)
felix's avatar
felix committed
    name Bbl (-20 -20 $thickness)
felix's avatar
felix committed
    name Fbs (20 -20 0)
felix's avatar
felix committed
    name Bbs (20 -20 $thickness)
felix's avatar
felix committed
    name Fbr (200 -20 0)
felix's avatar
felix committed
    name Bbr (200 -20 $thickness)
felix's avatar
felix committed
    name Ftl (-20 21 0)
felix's avatar
felix committed
    name Btl (-20 21 $thickness)
felix's avatar
felix committed
    name Fts (20 21 0)
felix's avatar
felix committed
    name Bts (20 21 $thickness)
felix's avatar
felix committed
    name Ftr (200 21 0)
felix's avatar
felix committed
    name Btr (200 21 $thickness)
felix's avatar
felix committed
    name Fcl (-5 0 0)
felix's avatar
felix committed
    name Bcl (-5 0 $thickness)
felix's avatar
felix committed
    name Fcb (0 -5 0)
felix's avatar
felix committed
    name Bcb (0 -5 $thickness)
felix's avatar
felix committed
    name Fcr (5 0 0)
felix's avatar
felix committed
    name Bcr (5 0 $thickness)
felix's avatar
felix committed
    name Fct (0 5 0)
felix's avatar
felix committed
    name Bct (0 5 $thickness)
felix's avatar
felix committed
    name Fcbl (#calc "-$rx" #calc "-$rx" 0) 
felix's avatar
felix committed
    name Bcbl (#calc "-$rx" #calc "-$rx" $thickness) 
felix's avatar
felix committed
    name Fcbr ($rx #calc "-$rx" 0)
felix's avatar
felix committed
    name Bcbr ($rx #calc "-$rx" $thickness)
felix's avatar
felix committed
    name Fctl (#calc "-$rx" $rx 0) 
felix's avatar
felix committed
    name Bctl (#calc "-$rx" $rx $thickness) 
felix's avatar
felix committed
    name Fctr ($rx $rx 0)
felix's avatar
felix committed
    name Bctr ($rx $rx $thickness)
felix's avatar
felix committed
    name Fnl (-20 0 0)
felix's avatar
felix committed
    name Bnl (-20 0 $thickness)
felix's avatar
felix committed
    name Fnr (200 0 0)
felix's avatar
felix committed
    name Bnr (200 0 $thickness)
felix's avatar
felix committed
    name Fbm (0 -20 0)
felix's avatar
felix committed
    name Bbm (0 -20 $thickness)
felix's avatar
felix committed
    name Ftm (0 21 0)
felix's avatar
felix committed
    name Btm (0 21 $thickness)
felix's avatar
felix committed
    name Fns (20 0 0)
felix's avatar
felix committed
    name Bns (20 0 $thickness)
felix's avatar
felix committed
    name Fnm (0 0 0)  
    name Bnm (0 0 1)
      name arcl hex (Ftl Fbl Fcbl Fctl Btl Bbl Bcbl Bctl) ($arcNx $arcNy 1) simpleGrading (1 1 1)
      name arct hex (Fts Ftl Fctl Fctr Bts Btl Bctl Bctr) ($arcNx $arcNy 1) simpleGrading (1 1 1)
      name arct hex (Fbs Fts Fctr Fcbr Bbs Bts Bctr Bcbr) ($arcNx $arcNy 1) simpleGrading (1 1 1)
      name arct hex (Fbl Fbs Fcbr Fcbl Bbl Bbs Bcbr Bcbl) ($arcNx $arcNy 1) simpleGrading (1 1 1)
      name pipe hex (Fbs Fbr Ftr Fts Bbs Bbr Btr Bts) (#calc "12 * $arcNy" $arcNx 1) simpleGrading (1 1 1)
    arc Fcbl Fctl (-5 0 0)   // = Fcl
    arc Fctl Fctr (0 5 0)    // = Fct
    arc Fctr Fcbr (5 0 0)    // = Fcr
    arc Fcbr Fcbl (0 -5 0)   // = Fcb
    arc Bcbl Bctl (-5 0 0)   // = Bcl
    arc Bctl Bctr (0 5 0)    // = Bct
    arc Bctr Bcbr (5 0 0)    // = Bcr
    arc Bcbr Bcbl (0 -5 0)   // = Bcb
felix's avatar
felix committed
/*
felix's avatar
felix committed
    inlet
felix's avatar
felix committed
        type patch;
felix's avatar
felix committed
            (Fbl Ftl Bbl Btl)
felix's avatar
felix committed
    outlet
felix's avatar
felix committed
        type patch;
felix's avatar
felix committed
            (Fbr Ftr Bbr Btr)
felix's avatar
felix committed
    walls
    {
        type wall;
        faces
        (
            (Fbl Fbr Bbl Bbr)
            (Ftl Ftr Btl Btr)
        )
    }
    cylinder
    {
        type wall;
        faces
        (
            (Fcbl Fcbr Bcbl Bcbr)
            (Fcbr Fctr Bcbr Bctr)
            (Fctr Fctl Bctr Bctl)
            (Fctl Fcbl Bctl Bcbl)
        )
    }
    frontAndBack
    {
        type empty;
        faces
        (
felix's avatar
felix committed
            // copied from blocks
            (Ftl Fbl Fcbl Fctl)
            (Btl Bbl Bcbl Bctl)
            (Fts Ftl Fctl Fctr)
            (Bts Btl Bctl Bctr)
            (Fbs Fts Fctr Fcbr)
            (Bbs Bts Bctr Bcbr)
            (Fbl Fbs Fcbr Fcbl)
            (Bbl Bbs Bcbr Bcbl)
            (Fbs Fbr Ftr Fts)
            (Bbs Bbr Btr Bts)
felix's avatar
felix committed
*/
);

mergePatchPairs
(
);

// ************************************************************************* //