CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[blockMesh] Can't find my mistake blockMeshDict

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread 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: 13
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: 14
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: 13
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: 14
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: 13
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

Old   March 18, 2015, 06:48
Default ill defined primitiveEntry starting at keyword 'blocks'
  #6
New Member
 
Diana
Join Date: Dec 2014
Posts: 8
Rep Power: 11
diananilminikumari is on a distinguished road
I was trying to define cylinder mesh,and When run the blockMesh I have get the error ,

--> FOAM FATAL IO ERROR:
"ill defined primitiveEntry starting at keyword 'blocks' on line 53 and ending at line 149"

file: /home/diana/OpenFOAM/diana-2.3.0/run/tutorials/heatTransfer/buoyantSimpleFoam/hotcylinder/constant/polyMesh/blockMeshDict at line 149.

From function primitiveEntry::readEntry(const dictionary&, Istream&)
in file lnInclude/IOerror.C at line 132.

Here is my blockMesh file .Please kind to help me to find the error
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.3.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 1;

vertices
(
(0 0 0)//0
(0.02 0 0)//1
(0 0.02 0)//2
(0 0 0.5)//3
(0.02 0 0.5)//4
(0 0.02 0.5)//5
(0 0 1)//6
(0.02 0 1)//7
(0 0.02 1)//8

(-0.02 0 0)
(-0.02 0 0.5)
(-0.02 0 1)
(0 -0.02 0)
(0 -0.02 0.5)
(0 -0.02 1)

(0.05 0 0)
(0 0.05 0)
(0.05 0 0.5)
(0 0.05 0.5)
(0.05 0 1)
(0 0.05 1)
(-0.05 0 0)
(-0.05 0 0.5)
(-0.05 0 1)
(0 -0.05 0)
(0 -0.05 0.5)
(0 -0.05 1)
);

blocks
(
hex(0 0 1 2 3 3 4 5) (2 2 10) simpleGrading (1 1 1)
hex(3 3 5 4 6 6 7 8) (2 2 10) simpleGrading (1 1 1)
hex(0 0 2 9 3 3 5 10) (2 2 10) simpleGrading (1 1 1)
hex(3 3 5 10 6 6 8 11) (2 2 10) simpleGrading (1 1 1)
hex(0 0 9 12 3 3 10 13) (2 2 10) simpleGrading (1 1 1)
hex(3 3 10 13 6 6 11 14) (2 2 10) simpleGrading (1 1 1)
hex(0 0 12 1 3 3 13 4) (2 2 10) simpleGrading (1 1 1)
hex(3 3 13 4 6 6 14 7) (2 2 10) simpleGrading (1 1 1)
hex(1 15 16 2 4 17 18 5) (3 3 10) simpleGrading (1 1 1)
hex(4 17 18 5 7 19 20 8) (3 3 10) simpleGrading (1 1 1)
hex(2 16 21 9 5 18 22 10) (3 3 10) simpleGrading (1 1 1)
hex(5 18 22 10 8 20 23 11) (3 3 10) simpleGrading (1 1 1)
hex(9 21 24 12 10 22 25 13) (3 3 10) simpleGrading (1 1 1)
hex(10 22 25 13 11 23 26 14) (3 3 10) simpleGrading (1 1 1)
hex(12 24 15 1 13 25 17 4) (3 3 10) simpleGrading (1 1 1)
hex(13 25 17 4 14 26 19 7) (3 3 10) simpleGrading (1 1 1)

);
edges
(
arc 1 2 (0.01 0.0173205080756888 0)
arc 4 5 (0.01 0.0173205080756888 0.5)
arc 7 8 (0.01 0.0173205080756888 1)
arc 2 9 (-0.01 0.0173205080756888 0)
arc 5 10 (-0.01 0.0173205080756888 0.5)
arc 8 11 (-0.01 0.0173205080756888 1)
arc 9 12 (-0.0173205080756888 -0.01 0)
arc 10 13 (-0.0173205080756888 -0.01 0.5)
arc 11 14 (-0.0173205080756888 -0.01 1)
arc 10 1 (0.03 0.04 0)
arc 13 4 (0.03 0.04 0.5)
arc 14 7 (0.03 0.04 1)
);
boundary
(
uppipewall
{
type wall;
faces
(
(15 16 18 17)
(17 18 20 19)
(16 21 22 18)
(18 22 23 20)
)
}
downpipewall
{
type wall;
faces
(
(24 15 25 17)
(17 25 26 19)
(24 21 22 25)
(25 22 23 26)
)
}
inflow
{
type patch;
faces
(
(0 2 1 0)
(1 2 16 15)
(0 9 2 0)
(9 21 16 2)
(0 12 9 0)
(12 24 21 9)
(0 1 12 0)
(1 15 24 12)
)
}
outflow
{
type patch;
faces
(
(6 8 7 6)
(8 20 19 7)
(6 11 8 6)
(11 23 20 8)
(6 14 11 6)
(14 26 23 11)
(6 7 14 6)
(7 19 26 14)
)
}
);

mergePatchPairs
(
);

// ************************************************** *********************** //
diananilminikumari is offline   Reply With Quote

Old   March 18, 2015, 07:07
Default
  #7
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

1. There should be space between hex and vertices vector
2. There should be semicolon in the end of faces vector of vector in patch definition

Though after these two minor corrections you will encounter problems with hex vertices numbering:

Code:
Creating block mesh topology
--> FOAM Warning : 
    From function cellModel::mag(const labelList&, const pointField&)
    in file meshes/meshShapes/cellModel/cellModel.C at line 128
    zero or negative pyramid volume: -1.66667e-05 for face 4
and

Code:
--> FOAM FATAL ERROR: 
face 0 in patch 1 does not have neighbour cell face: 4(24 15 25 17)
Next time when posting blockMeshDict (or any other dictionary) on the forum, please, use CODE tag or just attach compressed file.
alexeym is offline   Reply With Quote

Old   March 18, 2015, 07:13
Default
  #8
Senior Member
 
Bernhard Linseisen
Join Date: May 2010
Location: Heilbronn
Posts: 183
Blog Entries: 1
Rep Power: 16
Linse is on a distinguished road
Just a short note: Try to put a space between the "hex" and the brackets... Should help for part of the problem already...
Linse is offline   Reply With Quote

Old   March 19, 2015, 02:08
Default
  #9
New Member
 
Diana
Join Date: Dec 2014
Posts: 8
Rep Power: 11
diananilminikumari is on a distinguished road
Thank you very much for your information.
I have got the mesh
diananilminikumari is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Coupling with MATLAB via Java, getting the message: "error: cannot find symbol" Dry Patrick STAR-CCM+ 6 October 23, 2018 10:03
/usr/bin/ld: cannot find -llagrangianTurbulence /usr/bin/ld: cannot find -lfluidTherm Luiggito OpenFOAM Programming & Development 9 May 2, 2016 01:54
[swak4Foam] swak4Foam compilation can't find -lOpenFOAM BobR OpenFOAM Community Contributions 4 August 10, 2015 15:49
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


All times are GMT -4. The time now is 23:55.