Sig Turbulence / channelBlockMeshDict

From OpenFOAMWiki
// Parametrized the channel flow test case.
// Version 1.0 Original files: C.Duprat, O.Brugiere and G.Balarac, LEGI laboratory.
//         1.0   2009-06-04 C.Duprat, O.Brugiere and G.Balarac, LEGI laboratory.
 
 
//Run using:
//m4 -P channelBlocMeshDict.m4 > blockMeshDict
 
//m4 definitions:
m4_changecom(//)m4_changequote([,])
m4_define(calc, [m4_esyscmd(perl -e 'use Math::Trig; printf ($1)')])
m4_define(VCOUNT, 0)
m4_define(vlabel, [[// ]Vertex $1 = VCOUNT m4_define($1, VCOUNT)m4_define([VCOUNT], m4_incr(VCOUNT))])
 
//Geometry
 
//Property of the channel y+ and Retau for Ub = 1 and half-width : delta = h/2 = 1
m4_define(Yplus,50)
m4_define(Retau,1020)
m4_define(Y1,calc(Yplus/Retau))
 
//Size
m4_define(X, 12.8)
m4_define(h, 2.0)
m4_define(delta, calc(h/2.0))
m4_define(Z, 6.4 )
 
// mesh
m4_define(nX, 50)
m4_define(nYtot,40) //only even number
m4_define(nY, calc((nYtot-2)/2))
m4_define(nZ, 38)
 
// refine mesh if a = 1 : regular mesh
m4_define(a, 1)
m4_define(b, calc(1/a))
 
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  1.4                                   |
|   \\  /    A nd           | Web:      http://www.openfoam.org               |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
 
FoamFile
{
    version         2.0;
    format          ascii;
 
    root            "";
    case            "";
    instance        "";
    local           "";
 
    class           dictionary;
    object          blockMeshDict;
}
 
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
convertToMeters 1;
 
vertices
(
    (0 0 0)             vlabel(A0)      //  0
    (X 0 0)             vlabel(A1)
    (0 Y1 0)            vlabel(A2)
    (X Y1 0)            vlabel(A3)
    (0 delta 0)         vlabel(A4)
    (X delta 0)         vlabel(A5)      //  5
    (0 calc(h-Y1) 0)    vlabel(A6)
    (X calc(h-Y1) 0)    vlabel(A7)
    (0 h 0)             vlabel(A8)
    (X h 0)             vlabel(A9)
    (0 0 Z)             vlabel(A10)     // 10
    (X 0 Z)             vlabel(A11)
    (0 Y1 Z)            vlabel(A12)
    (X Y1 Z)            vlabel(A13)
    (0 delta Z)         vlabel(A14)
    (X delta Z)         vlabel(A15)     // 15
    (0 calc(h-Y1) Z)    vlabel(A16)
    (X calc(h-Y1) Z)    vlabel(A17)
    (0 h Z)             vlabel(A18)
    (X h Z)             vlabel(A19)
 
);
 
blocks
(
    hex (A0 A1 A3 A2 A10 A11 A13 A12)
         (nX 1 nZ)
         simpleGrading (1 1 1)
 
    hex (A2 A3 A5 A4 A12 A13 A15 A14)
         (nX nY nZ)
         simpleGrading (1 a 1)
 
    hex (A4 A5 A7 A6 A14 A15 A17 A16)
         (nX nY nZ)
         simpleGrading (1 b 1)
 
    hex (A6 A7 A9 A8 A16 A17 A19 A18)
         (nX 1 nZ)
         simpleGrading (1 1 1)
);
 
edges
(
);
 
patches
(
    cyclic inout1
    (
        (A1 A3 A13 A11)
        (A0 A10 A12 A2)
        (A3 A5 A15 A13)
        (A2 A12 A14 A4)
    )
    cyclic inout2
    (
        (A5 A7 A17 A15)
        (A4 A14 A16 A6)
        (A7 A17 A19 A9)
        (A6 A16 A18 A8)
    )
    cyclic side1
    (
        (A0 A2 A3 A1)
        (A10 A11 A13 A12)
        (A2 A3 A5 A4)
        (A12 A13 A15 A14)
    )
    cyclic side2
    (
        (A4 A6 A7 A5)
        (A14 A15 A17 A16)
        (A6 A8 A9 A7)
        (A16 A17 A19 A18)
    )
    wall topWall
    (
        (A8 A18 A19 A9)
    )    wall bottomWall
 
    (
        (A0 A1 A11 A10)
    )
);
 
mergePatchPairs
(
);
 
// ************************************************************************* //

Return Channel Flow