CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Native Meshers: blockMesh

Can't find my mistake blockMeshDict

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   February 19, 2013, 07:29
Default Can't find my mistake blockMeshDict
  #1
New Member
 
Jos E.
Join Date: Feb 2013
Posts: 4
Rep Power: 4
jelzinga is on a distinguished road
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
jelzinga is offline   Reply With Quote

Old   February 19, 2013, 08:10
Default
  #2
Member
 
Join Date: Nov 2012
Posts: 58
Rep Power: 4
startingWithCFD is on a distinguished road
-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
);


// ************************************************************************* /
startingWithCFD is offline   Reply With Quote

Old   February 19, 2013, 08:30
Default
  #3
New Member
 
Jos E.
Join Date: Feb 2013
Posts: 4
Rep Power: 4
jelzinga is on a distinguished road
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 ?
jelzinga is offline   Reply With Quote

Old   February 19, 2013, 10:12
Default
  #4
Member
 
Join Date: Nov 2012
Posts: 58
Rep Power: 4
startingWithCFD is on a distinguished road
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?
startingWithCFD is offline   Reply With Quote

Old   February 19, 2013, 10:22
Default
  #5
New Member
 
Jos E.
Join Date: Feb 2013
Posts: 4
Rep Power: 4
jelzinga is on a distinguished road
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 !
jelzinga is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Looking for SUBOFF model but i can't find it. Heewon Lee Main CFD Forum 6 September 9, 2014 08:55
OpenFoam171: error /usr/bin/ld: cannot find -llduSolvers Schipper OpenFOAM Programming & Development 5 November 15, 2012 15:13
OpenFOAM 1.6-ext git installation on Ubuntu 11.10 x64 Attesz OpenFOAM Installation 45 January 13, 2012 13:38
Problem Building OF on Centos cluster (no admin rights) CKH OpenFOAM Installation 5 November 13, 2011 07:32
YPlus nowhere to be find Daniel CFX 3 May 1, 2006 16:22


All times are GMT -4. The time now is 20:29.