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

[blockMesh] tutorial 2.2 Stress(...) trouble with blockMesh

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 3 Post By calebamiles

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 30, 2010, 04:01
Default tutorial 2.2 Stress(...) trouble with blockMesh
  #1
Senior Member
 
Join Date: Aug 2010
Location: Groningen, The Netherlands
Posts: 216
Rep Power: 18
colinB is on a distinguished road
Hi
I'm currently making my way through the tutorials to get a little bit more acquainted with OF, but in the 2nd tutorial (the one with the stress analyzes) I get stuck in the meshgeneration.

I'm using OF 1.7.1
So I'm going into the case directory and I'm using the provided blockMeshDict file and just type blockMesh. Then the following error message shows up:

Code:
 
root@colin:~/OpenFOAM/root-1.7.1/run/tutorials/stressAnalysis/solidDisplacementFoam/plateHole/constant/polyMesh# blockMesh
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  1.7.1                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : 1.7.1-fffd2c682d50
Exec   : blockMesh
Date   : Aug 30 2010
Time   : 09:51:18
Host   : colin
PID    : 3766
Case   : /root/OpenFOAM/root-1.7.1/run/tutorials/stressAnalysis/solidDisplacementFoam/plateHole/constant/polyMesh
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time



--> FOAM FATAL IO ERROR: 
cannot open file

file: /root/OpenFOAM/root-1.7.1/run/tutorials/stressAnalysis/solidDisplacementFoam/plateHole/constant/polyMesh/system/controlDict at line 0.

    From function regIOobject::readStream()
    in file db/regIOobject/regIOobjectRead.C at line 61.

FOAM exiting
I especialy got stuck with the file regIOobjectRead.c for I could not find it, well and if I would find it I propably wouldn't know whats wrong in line 61.
Thanks for your trouble

kind regards
Colin

Edit: I made a new discovery: using the blockMesh command in the polyMesh folder for some reason does not work, but copying the blockMeshDict to the case folder and executing blockMesh does work.
So my question is: Is that normal that it works like this and I have to accept it or is this some irregularity in OF?

Last edited by colinB; August 30, 2010 at 06:31.
colinB is offline   Reply With Quote

Old   August 30, 2010, 07:07
Default
  #2
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 21
MartinB will become famous soon enough
Hi Colin,

it is the usual way to call the blockMesh command from the case folder, although the blockMeshDict file resides in the constant/polyMesh folder. That is the default location where blockMesh looks for the dictionary.

You can select a blockMeshDict at another location with the option
Code:
blockMesh -dict full/path/to/blockMeshDict
If you copy the blockMeshDict to the case folder, as you have done, the blockMeshDict from constant/polyMesh is used, not the copy you made. So changes in the copy would not take effect.

Martin
MartinB is offline   Reply With Quote

Old   August 30, 2010, 07:25
Default
  #3
Senior Member
 
Join Date: Aug 2010
Location: Groningen, The Netherlands
Posts: 216
Rep Power: 18
colinB is on a distinguished road
Hi Martin
thanks for the hint. That makes me OF understand little more!
Kind regards
Colin
colinB is offline   Reply With Quote

Old   August 31, 2010, 10:57
Default
  #4
Senior Member
 
Join Date: Aug 2010
Location: Groningen, The Netherlands
Posts: 216
Rep Power: 18
colinB is on a distinguished road
Hi its me again
new day new problem. I know that the problem is not matching with the title anymore, but I didn't want to open a new thread for every problem I have.
However what is wrong:

I'm trying to model a simple problem with block mesh a box with 4 walls one inlet, one outlet, top and down and in this box is an obstacle slightly irregular shaped.
Aim is it to let some water flow around with icoFoam
So the following blockMeshDict file was set up:
Code:
convertToMeters 1;

vertices        
(
    (0 0 0)
    (29 0 0)
    (49 0 0)
    (67 0 0)
    (87 0 0)
    (100 0 0)
    (0 12.27 0)
    (29 12.27 0)
    (49 12.27 0)
    (67 12.27 0)
    (87 12.27 0)
    (100 12.27 0)
    (0 15.33 0)
    (29 15.33 0)
    (49 13.8 0)
    (67 13.8 0)
    (0 20.7 0)
    (29 20.7 0)
    (87 20.7 0)
    (100 20.7 0)
    (0 26.07 0)
    (29 26.07 0)
    (49 27.6 0)
    (67 27.6 0)
    (0 29.13 0)
    (29 29.13 0)
    (49 29.13 0)
    (67 23.13 0)
    (87 29.13 0)
    (100 29.13 0)
    (0 41.4 0)
    (29 41.4 0)
    (49 41.4 0)
    (67 41.4 0)
    (87 41.4 0)
    (100 41.4 0)
    (0 0 0.1)
    (29 0 0.1)
    (49 0 0.1)
    (67 0 0.1)
    (87 0 0.1)
    (100 0 0.1)
    (0 12.27 0.1)
    (29 12.27 0.1)
    (49 12.27 0.1)
    (67 12.27 0.1)
    (87 12.27 0.1)
    (100 12.27 0.1)
    (0 15.33 0.1)
    (29 15.33 0.1)
    (49 13.8 0.1)
    (67 13.8 0.1)
    (0 20.7 0.1)
    (29 20.7 0.1)
    (87 20.7 0.1)
    (100 20.7 0.1)
    (0 26.07 0.1)
    (29 26.07 0.1)
    (49 27.6 0.1)
    (67 27.6 0.1)
    (0 29.13 0.1)
    (29 29.13 0.1)
    (49 29.13 0.1)
    (67 23.13 0.1)
    (87 29.13 0.1)
    (100 29.13 0.1)
    (0 41.4 0.1)
    (29 41.4 0.1)
    (49 41.4 0.1)
    (67 41.4 0.1)
    (87 41.4 0.1)
    (100 41.4 0.1)

);

blocks          
(
    hex (0 1 7 6 36 37 43 42) (10 20 1) simpleGrading (1 1 1)
    hex (1 2 8 7 37 38 44 43) (10 20 1) simpleGrading (1 1 1)
    hex (2 3 9 8 38 39 45 44) (15 20 1) simpleGrading (1 1 1)
    hex (3 4 10 9 39 40 46 45) (15 20 1) simpleGrading (1 1 1)
    hex (4 5 11 10 40 41 47 46) (10 20 1) simpleGrading (1 1 1)
    hex (6 7 13 12 42 43 49 48) (10 20 1) simpleGrading (1 1 1)
    hex (7 8 14 13 43 44 50 49) (10 20 1) simpleGrading (1 1 1)
    hex (8 9 15 14 44 45 51 50) (15 20 1) simpleGrading (1 1 1)
    hex (9 10 18 15 45 46 54 51) (15 20 1) simpleGrading (1 1 1)
    hex (10 11 19 18 46 47 55 54) (10 20 1) simpleGrading (1 1 1)
    hex (12 13 17 16 48 49 53 52) (10 20 1) simpleGrading (1 1 1)
    hex (16 17 21 20 56 52 53 57) (10 20 1) simpleGrading (1 1 1)
    hex (20 21 25 24 56 57 61 60) (10 20 1) simpleGrading (1 1 1)
    hex (21 22 26 25 57 58 62 61) (10 20 1) simpleGrading (1 1 1)
    hex (22 26 27 23 59 58 62 63) (15 20 1) simpleGrading (1 1 1)
    hex (23 18 28 27 59 54 64 63) (15 20 1) simpleGrading (1 1 1)
    hex (18 19 29 28 54 55 65 64) (10 20 1) simpleGrading (1 1 1)
    hex (24 25 31 30 60 61 67 66) (10 20 1) simpleGrading (1 1 1)
    hex (25 26 32 31 61 62 68 67) (10 20 1) simpleGrading (1 1 1)
    hex (26 27 33 32 62 63 69 68) (15 20 1) simpleGrading (1 1 1)
    hex (27 28 34 33 63 64 70 69) (15 20 1) simpleGrading (1 1 1)
    hex (28 29 35 34 64 65 71 70) (10 20 1) simpleGrading (1 1 1)
);

edges           
(

 simpleSpline 13 14 
 (
  (33 14.33 0)
  (39 14.13 0)
  )
 
 simpleSpline 49 50
 (

  (33 14.33 0.1)
  (39 14.13 0.1)

  )

 simpleSpline 15 18
 (
  (72 14.3 0)
  (77 15.3 0)
  (82 16.4 0)
  )
 simpleSpline 51 54
 (
  (72 14.3 0.1)
  (77 15.3 0.1)
  (82 16.4 0.1)
  )
 simpleSpline 21 22
 (

  (33 27.07 0)
  (39 27.24 0)

  )
 simpleSpline 57 58
 (

  (33 27.07 0.1)
  (39 27.24 0.1)

  )
 simpleSpline 23 18
 (
  (72 27.1 0)
  (77 26.1 0)
  (82 24.3 0)
  )
 simpleSpline 59 54
 (
  (72 27.1 0.1)
  (77 26.1 0.1)
  (82 24.3 0.1)
  )

);

patches         
(

    wall down 
    (

        (0 36 37 1)
        (1 37 38 2)
        (2 38 39 3)
    (3 39 40 4)
    (4 40 41 5)
     )

    wall solid
    (
      
    (13 14 50 49)
    (14 15 51 50)
    (15 18 54 51)
    (13 49 53 17)
    (17 53 57 21)
    (21 57 58 22)
    (22 58 59 23)
    (23 59 54 18)
     )


     wall up
    (
    (30 31 67 66)
    (31 32 68 67)
    (32 33 69 68)
    (33 34 70 69)
    (34 35 71 70)         
    )
    empty frontAndBack 
    (
        (0 1 7 6)
        (1 2 8 7)
    (2 3 9 8)
    (3 4 10 9)
    (4 5 11 10)
    (6 7 13 12)
    (7 8 14 13)
    (8 9 15 14)
    (9 10 18 15)
    (10 11 19 18)
    (12 13 17 16)
    (16 17 21 20)
    (20 21 25 24)
    (21 22 26 25)
    (22 23 27 26)
    (23 18 28 27)
    (18 19 29 28)
    (24 25 31 30)
    (25 26 32 31)
    (26 27 33 32)
    (27 28 34 33)
    (28 29 35 34)
    (36 37 43 42)
    (37 38 44 43)
    (38 39 45 44)
    (39 40 46 45)
    (40 41 47 46)
    (42 43 49 48)
    (43 44 50 49)
    (44 45 51 50)
    (45 46 54 51)
    (46 47 55 54)
    (48 49 53 52)
    (52 53 57 56)
    (56 57 61 60)
    (57 58 62 61)
    (58 59 63 62)
    (59 54 64 63)
    (54 55 65 64)
    (60 61 67 66)
    (61 62 68 67)
    (62 63 69 68)
    (63 64 70 69)
    (64 65 71 70)
    )

    patch inlet
    (
     (5 41 47 11)
     (11 47 55 19)
     (19 55 65 29)
     (29 65 71 35)
     )

    patch outlet
    ( 
     (0 36 42 6)
     (6 42 48 12)
     (12 48 52 16)
     (16 52 56 20)
     (20 56 60 24)
     (24 60 66 30)
      ) 
 
);

mergePatchPairs 
(
);

// ************************************************************************* //
Problem now is that I get the following error message by using blockMesh:

Code:
Build  : 1.7.1-fffd2c682d50
Exec   : blockMesh
Date   : Aug 31 2010
Time   : 16:27:30
Host   : colin
PID    : 4087
Case   : /root/OpenFOAM/root-1.7.1/run/tutorials/incompressible/icoFoam/simpleShip
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time


Creating block mesh from
    "/root/OpenFOAM/root-1.7.1/run/tutorials/incompressible/icoFoam/simpleShip/constant/polyMesh/blockMeshDict"


Creating blockCorners

Creating curved edges

Creating blocks

Creating patches

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.49 for face 0

Default patch type set to empty


--> FOAM FATAL ERROR: 
face 4 in patch 1 does not have neighbour cell face: 4(17 53 57 21)

    From function polyMesh::facePatchFaceCells(const faceList& patchFaces,const labelListList& pointCells,const faceListList& cellsFaceShapes,const label patchID)
    in file meshes/polyMesh/polyMeshFromShapeMesh.C at line 124.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam171/lib/linuxGccDPOpt/libOpenFOAM.so"
#1  Foam::error::abort() in "/opt/openfoam171/lib/linuxGccDPOpt/libOpenFOAM.so"
#2  Foam::polyMesh::facePatchFaceCells(Foam::List<Foam::face> const&, Foam::List<Foam::List<int> > const&, Foam::List<Foam::List<Foam::face> > const&, int) const in "/opt/openfoam171/lib/linuxGccDPOpt/libOpenFOAM.so"
#3  Foam::polyMesh::polyMesh(Foam::IOobject const&, Foam::Xfer<Foam::Field<Foam::Vector<double> > > const&, Foam::List<Foam::cellShape> const&, Foam::List<Foam::List<Foam::face> > const&, Foam::List<Foam::word> const&, Foam::List<Foam::word> const&, Foam::word const&, Foam::word const&, Foam::List<Foam::word> const&, bool) in "/opt/openfoam171/lib/linuxGccDPOpt/libOpenFOAM.so"
#4  
 in "/opt/openfoam171/applications/bin/linuxGccDPOpt/blockMesh"
#5  
 in "/opt/openfoam171/applications/bin/linuxGccDPOpt/blockMesh"
#6  
 in "/opt/openfoam171/applications/bin/linuxGccDPOpt/blockMesh"
#7  __libc_start_main in "/lib/tls/i686/cmov/libc.so.6"
#8  
 in "/opt/openfoam171/applications/bin/linuxGccDPOpt/blockMesh"
Aborted
so my interpretation of this message is he is doing fine up to some point and then aborting the mesh generation.
He refers to a patch 1 having trouble with face 4 and the neighbors. 4(17 53 57 21).
However I figured out that this might have something to do with the orientation of the patch so I permuted the point numbers both of the patch and the linked box. and it helped nothing.
Also the search in the Forum and with google didn't give me sufficient results to solve the problem.
Thanks for your efforts again
regards Colin
colinB is offline   Reply With Quote

Old   August 31, 2010, 11:20
Default
  #5
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 21
MartinB will become famous soon enough
Hi Colin,
you mixed up with some of the node numbers.

See the attached image, which is a screen shot from pyFoamDisplayBlockMesh.py, a tool you can download from here:
http://openfoamwiki.net/index.php/Co...Foam#Downloads

Install it and start
Code:
pyFoamDisplayBlockMesh.py constant/polyMesh/blockMeshDict
or
Code:
pyFoamDisplayBlockMesh.py path/to/your/blockMeshDict
Another way to hunt down bugs is to comment out all blocks except one and try one after another, than several at the same time etc.

Martin
Attached Images
File Type: jpg shot01.jpg (41.7 KB, 125 views)
MartinB is offline   Reply With Quote

Old   September 1, 2010, 03:40
Default
  #6
Senior Member
 
Join Date: Aug 2010
Location: Groningen, The Netherlands
Posts: 216
Rep Power: 18
colinB is on a distinguished road
Thanks again Martin
you saved my day.
sometimes you can't see the blocks for the patches.
regards
colinB is offline   Reply With Quote

Old   September 3, 2010, 07:38
Default
  #7
Senior Member
 
Join Date: Aug 2010
Location: Groningen, The Netherlands
Posts: 216
Rep Power: 18
colinB is on a distinguished road
Hi
I have some trouble with the hint from Martin (pyFoam)
After installing everything that is necessary to run pyFoam or at least the command pyFoamDisplayBlockMesh.py I still get an error message telling me :

Trying VTK implementation from Paraview

PyFoam FATAL ERROR on line 28 of file /usr/local/lib/python2.6/dist-packages/PyFoam/Applications/DisplayBlockMeshQt.py : Error while importing modules: No module named paraview

So this is what I did the hole morning:

- installing pyFoam
- installing some numpy files since they were missing

then I got the above mentioned error message

so I downloaded some VTK.tar folder and untared it
I figured out that cmake was missing so I downloaded this as well untared it
and made the binaries and installed it, then did the same with VTK,
configuring the installation like this that python is immediately wrapped in it (I did this intuitive, because I thought it might help)
Well I thought now it actually should work, but it didn't and so I come to you again hoping for some help.
If you have some ideas let me know, if you are missing some information, let me know as well. Can surely be that I forgot something to mention since I messed around the hole morning.

regards Colin
colinB is offline   Reply With Quote

Old   September 21, 2010, 07:29
Default
  #8
Senior Member
 
Join Date: Aug 2010
Location: Groningen, The Netherlands
Posts: 216
Rep Power: 18
colinB is on a distinguished road
Hi all
I'm still struggling with this issue I mentioned above.
After setting up the whole system new (for some other reason) I installed pyFoam new
more or less straight forward:

- download the latest tar file
- follow the instruction of the pyFoam Wiki
- encounter a error message that numpy and numerical extensions for python are missing
and that plotting is not possible
- installing numpy-Python extension
- installing pyFoam again
- everything works out fine
- test works out fine
- trying to display the Mesh of the cavity tutorials with the command (executing it in the case directory):

pyFoamDisplayBlockMesh.py constant/polyMesh/blockMeshDict

results in a error message:

Code:
  PyFoam FATAL ERROR on line 28 of file /usr/local/lib/python2.6/dist-packages/PyFoam/Applications/DisplayBlockMeshQt.py : Error while importing modules: No module named paraview
So my question still is what do I have to do to get this running and or what do I have to install?
again I thank you for your trouble
kind regards
Colin
colinB is offline   Reply With Quote

Old   January 22, 2012, 10:32
Default
  #9
New Member
 
Caleb Miles
Join Date: Jun 2011
Posts: 13
Rep Power: 14
calebamiles is on a distinguished road
Hi Colin,

I recently struggled with this problem myself. I seem to have resolved the issue so I will post the solution here for future reference. Digging into the error a little bit you will find the following lines in DisplayBlockMeshQt.py
which on my system (Ubuntu 32-bit) is located at:

Code:
/usr/local/lib/python2.7/dist-packages/PyFoam/Applications/DisplayBlockMeshQt.py
which relate to importing VTK:

Code:
def doImports():
    try:
        global QtGui,QtCore
        from PyQt4 import QtGui,QtCore
        global vtk
        try:
            import vtk
            print "Using system-VTK"
        except ImportError:
            print "Trying VTK implementation from Paraview"
            from paraview import vtk
        global QVTKRenderWindowInteractor
        from vtk.qt4 import QVTKRenderWindowInteractor
    except ImportError,e:
        error("Error while importing modules:",e)
The VTK from paraview is a fallback for a system VTK installation. Installing the Python VTK bindings ("python-vtk" on Ubuntu) resolves the problem. I hope this saves someone a little heartache and time.

Cheers,

Caleb
Ivooo, DamBreakGuy and johannes.jo like this.
calebamiles 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
[blockMesh] trouble shooting for 3d complex geometry using blockMesh kush verma OpenFOAM Meshing & Mesh Conversion 1 July 4, 2016 12:29
[blockMesh] Trouble using blockMesh for axisymmetric geometry twinturbotom OpenFOAM Meshing & Mesh Conversion 1 February 8, 2016 20:59
Error found in stress tutorial mike_jaworski OpenFOAM Running, Solving & CFD 0 September 23, 2007 02:34
Problem starting a tutorial case alank OpenFOAM Installation 1 December 12, 2006 16:50
Some problem about tutorial stress analysis of plate with hole ztdep OpenFOAM Running, Solving & CFD 0 August 12, 2005 07:05


All times are GMT -4. The time now is 16:42.