CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Native Meshers: blockMesh (http://www.cfd-online.com/Forums/openfoam-meshing-blockmesh/)
-   -   Can't find my mistake blockMeshDict (http://www.cfd-online.com/Forums/openfoam-meshing-blockmesh/113402-cant-find-my-mistake-blockmeshdict.html)

jelzinga February 19, 2013 06:29

Can't find my mistake blockMeshDict
 
I'm trying to get started with OpenFOAM and using BlockMesh as a "first" mesher to get started.

My basic simulation would be 2 squares (cubicles) stacked on top of eachother, with the top face of the small cubicle being an air inlet and the bottom face of the big cubicle being an outlet.

I've defined the 16 vertices and the 2 hex blocks. Furthermore, I've tried to define the patches necessary (including a "mergePatchPairs") but the generated OpenFOAM mesh-files do not contain boundary-zones for the inlet and outlet (the top and bottom faces).

Ive copied/pasted my blockMeshDict to this post in the hopes someone can explain me what I'm doing wrong ...

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  1.7.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.com                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 0.001;

vertices       
(
    (3 3 -3) //0
    (-3 3 -3) //1
    (-3 -3 -3) //2
    (3 -3 -3) //3
    (3 3 0) //4
    (-3 3 0) //5
    (-3 -3 0) //6
    (3 -3 0) //7
    (1 1 0) //8
    (-1 1 0) //9
    (-1 -1 0) //10
    (1 -1 0) //11
    (1 1 1) //12
    (-1 1 1) //13
    (-1 -1 1) //14
    (1 -1 1) //15
   
);

blocks         
(
    hex (0 1 2 3 4 5 6 7) (19 19 19) simpleGrading (1 1 1)
    hex (8 9 10 11 12 13 14 15) (23 23 23) simpleGrading (1 1 1)
 
);

edges
(
);

patches
(
 patch vlak1
  (
    ( 4 5 6 7)
  )

 patch vlak2
  (
    (8 9 10 11)
  )

);


boundary
(
 
inlet
  {
  type patch;
  faces
    (
      (12 13 14 15)
    );
  }

 outlet
  {
  type patch;
  faces
    (
      (0 1 2 3)
    );
  }

 defaultFaces
  {
  type patch;
  faces
    (
      (0 4 7 3)
      (3 7 6 2)
      (1 5 6 2)
      (1 0 4 5)
      (8 12 15 11)
      (10 11 15 14)
      (10 9 13 14)
      (9 8 12 13)
      (4 5 6 7)
    );
  }

 
);




mergePatchPairs
(
(vlak2 vlak1) //merge1
);


);

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

thanks in forward ;)

startingWithCFD February 19, 2013 07:10

-You can either have "patches" or "boundary", not both. "boundary" was ignored and therefore no inlet or outlet appeared.
-Be careful that the number of cells must be the same in neighbouring blocks. I corrected that for you.
-There was also an extra ); at the end.

Code:

convertToMeters 0.001;

vertices
(
    (3 3 -3) //0
    (-3 3 -3) //1
    (-3 -3 -3) //2
    (3 -3 -3) //3
    (3 3 0) //4
    (-3 3 0) //5
    (-3 -3 0) //6
    (3 -3 0) //7
    (1 1 0) //8
    (-1 1 0) //9
    (-1 -1 0) //10
    (1 -1 0) //11
    (1 1 1) //12
    (-1 1 1) //13
    (-1 -1 1) //14
    (1 -1 1) //15

);

blocks
(
    hex (0 1 2 3 4 5 6 7) (24 24 12) simpleGrading (1 1 1)
    hex (8 9 10 11 12 13 14 15) (8 8 4) simpleGrading (1 1 1)

);

edges
(
);



boundary
(
    inlet
    {
        type patch;
        faces
        (
            (12 13 14 15)
        );
    }

    vlak1
    {
        type patch;
        faces
        (
            ( 4 5 6 7)
        );
    }

    vlak2
    {
        type patch;
        faces
        (
            (8 9 10 11)
        );
    }

    outlet
    {
        type patch;
        faces
        (
            (0 1 2 3)
        );

);


mergePatchPairs
(
    (vlak2 vlak1) //merge1
);


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


jelzinga February 19, 2013 07:30

Thanks for the quick help. I was not aware you could not have both, so learned already something ;)

When I copied your code over my file (after making a backup) I get the following error when I run blockMesh in the case directory:

Code:

--> FOAM FATAL IO ERROR:
ill defined primitiveEntry starting at keyword 'boundary' on line 52 and ending at line 101

file: /home/openfoam/Jos2013/GS_proposal/constant/polyMesh/blockMeshDict at line 101.

    From function primitiveEntry::readEntry(const dictionary&, Istream&)
    in file db/dictionary/primitiveEntry/primitiveEntryIO.C at line 214.

FOAM exiting

I must admit I run OpenFOAM 1.7.0 because that was bundled with the OpenCAE Linux version I downloaded, does that matter? Did the syntax change compared to the newer version and perhaps I should consider upgrading ?

startingWithCFD February 19, 2013 09:12

Sorry, I missed a } at the end of outlet during the copy-paste stage.
I wanted to attach the file itself but the forum rules did not allow that.
It must be working like this, right?

jelzinga February 19, 2013 09:22

Thanks for the heads-up. In the meantime I took the effort to install OpenFOAM 2.1 to exclude this as a possible problem-point later on.

I've edited the file accordingly and this seems to indeed add the boundaries required, thanks!

I'm pretty sure I run into a new problem later on, but thanks alot for now !


All times are GMT -4. The time now is 09:53.