CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Help to create geometry using blockMesh (http://www.cfd-online.com/Forums/openfoam-solving/58114-help-create-geometry-using-blockmesh.html)

nandiganavishal January 5, 2009 14:18

\attach Hi All.. I want to
 
\attach
Hi All..

I want to incorporate the following geometry using blockMesh.. Kindly help me out how exactly I have to go about implementing this... I am relatively new to Open foam..

Regards

Vishal

nandiganavishal January 5, 2009 14:21

http://www.cfd-online.com/Ope
 
http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif geometry.pdf.tar.gz

sachin January 6, 2009 07:20

Hi Vishal, You will have thre
 
Hi Vishal,
You will have three blocks - 2vertical and 1 horizontal.
give all co-ordinates and create it. The best way to understand is to check tutorials/icoFoam/cavity/constant/polyMesh/blockMeshdict and tutorials/icoFoam/cavityclipped/constant/polyMesh/blockMeshdict - see how the cavity is created and also how clipped geometry is created.
All geometries in openfoam will be 3 dimensional although third dimension could be made of 1 grid. help for cavity geometry is available in userguide. Please go thru that
best luck ...
Sachin

nandiganavishal January 6, 2009 22:34

Thanks a lot Sachin for the va
 
Thanks a lot Sachin for the valuable comments. I did create simple geometries as given in ICOFOAM cavity problem...but here the vertical and horizontal blocks are connected right and it is not closed.. hence wanted to know how do we connect the two sections...

Thanks

Vishal

wolle1982 January 7, 2009 11:04

Sachin is right. you will have
 
Sachin is right. you will have to creat 3 blocks. give the coordinateds and create the blocks.

is this a solid problem or should this become a fluid problem?

be sure the nodes of all blocks are the same number and have the same coordinates at the connecting face.

if this is a fluid problem you will have to define the patches. just define each patch as e.g. wall, an inlet, an outlet and don't define the connecting patches. they'll automatically merge together (no need to add something under "mergePatchPairs").

hope that helps, write if it does.

nandiganavishal January 7, 2009 15:21

Hi Wolfgang, Thanks for the
 
Hi Wolfgang,

Thanks for the reply. Yes this is a fluid problem.. I will try to incorporate your suggestions and would send my code once I am done..

Thanks for the help..

Vishal

nandiganavishal January 9, 2009 13:45

Hi, As I had posted before,
 
Hi,

As I had posted before, I finished coding
it, I would like to know how to define the patches for proper boundary
conditions... My boundary conditions are I have inlet at the left
vertical block and outlet at the right vertical block and at wall at
the rest as I had given in my geometry file in the forum... Kindly let
me know whether my code is correct.... Here is my blockMesh Dict file.

I have 2 vertical blocks of geometry 1 * 1 and a horizontal block in
the middle of geometry 5 (length) * 0.03 (height)

Vertical Block1 - Numbered as (0 1...7)
Vertical Block2 - Numbered as (16 17...23)
Horrizontal block - Numbered as (8 9..15)

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

convertToMeters 1;

vertices
(
(0 0 0)
(1 0 0)
(1 1 0)
(0 1 0)
(0 0 0.1)
(1 0 0.1)
(1 1 0.1)
(0 1 0.1)
(1 0.485 0)
(6 0.485 0)
(6 0.515 0)
(1 0.515 0)
(1 0.485 0.1)
(6 0.485 0.1)
(6 0.515 0.1)
(1 0.515 0.1)
(6 0 0)
(7 0 0)
(7 1 0)
(6 1 0)
(6 0 0.1)
(7 0 0.1)
(7 1 0.1)
(6 1 0.1)

);

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

edges
(
);

patches
(
patch inlet
(
(0 3 7 4)

)
patch outlet
(
(17 18 22 21)

)

patch upperwall
(
(2 3 7 6)
(18 19 23 22)
)

patch lowerwall
(
(4 5 1 0)
(20 21 17 16)
)

patch connectingupperwall
(
(14 10 11 15)
(11 2 6 15)
(10 19 23 14)
)

patch connectinglowerwall
(
(12 13 9 8)
(1 8 12 5)
(16 9 13 20)
)

empty frontAndBack
(
(0 1 2 3)
(4 5 6 7)
(8 9 10 11)
(12 13 14 15)
(16 17 18 19)
(20 21 22 23)
)
);

mergePatchPairs
(
);

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

When I run the mesh I get the following error..

Reading block mesh description dictionary

Creating block mesh

Creating blockCorners

Creating curved edges

Creating blocks

Creating patches

Creating block mesh topology

Default patch type set to empty


face 1 in patch 4 does not have neighbour cell face: 4(11 2 6 15)#0
Foam::error::printStack(Foam:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream&) in
"/home/vishal/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#1 Foam::error::abort() in
"/home/vishal/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#2 Foam:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream& Foam::operator<<>(Foam:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream&,
Foam::errorManip<foam::error>) in
"/home/vishal/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/blockMesh"
#3 Foam::polyMesh::facePatchFaceCells(Foam::List<foam ::face> const&,
Foam::List<foam::list<int> > const&, Foam::List<foam::list<foam::face>
> const&, int) const in
"/home/vishal/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#4 Foam::polyMesh::polyMesh(Foam::IOobject const&,
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 "/home/vishal/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#5 Foam::blockMesh::createTopology(Foam::IOdictionary &) in
"/home/vishal/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/blockMesh"
#6 Foam::blockMesh::blockMesh(Foam::IOdictionary&) in
"/home/vishal/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/blockMesh"
#7 main in "/home/vishal/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/blockMesh"
#8 __libc_start_main in "/lib/tls/i686/cmov/libc.so.6"
#9 __gxx_personality_v0 in
"/home/vishal/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/blockMesh"


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

FOAM aborting

Aborted


Kindly do the needful

Thanks


--
Regards

Vishal

nandiganavishal January 9, 2009 15:30

Hi, As I had posted before,
 
Hi,

As I had posted before, I finished coding
it, I would like to know how to define the patches for proper boundary
conditions... My boundary conditions are I have inlet at the left
vertical block and outlet at the right vertical block and at wall at
the rest as I had given in my geometry file in the forum... Kindly let
me know whether my code is correct.... Here is my blockMesh Dict file.

I have 2 vertical blocks of geometry 1 * 1 and a horizontal block in
the middle of geometry 5 (length) * 0.03 (height)

Vertical Block1 - Numbered as (0 1...7)
Vertical Block2 - Numbered as (16 17...23)
Horrizontal block - Numbered as (8 9..15)

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

convertToMeters 1;

vertices
(
(0 0 0)
(1 0 0)
(1 1 0)
(0 1 0)
(0 0 0.1)
(1 0 0.1)
(1 1 0.1)
(0 1 0.1)
(1 0.485 0)
(6 0.485 0)
(6 0.515 0)
(1 0.515 0)
(1 0.485 0.1)
(6 0.485 0.1)
(6 0.515 0.1)
(1 0.515 0.1)
(6 0 0)
(7 0 0)
(7 1 0)
(6 1 0)
(6 0 0.1)
(7 0 0.1)
(7 1 0.1)
(6 1 0.1)

);

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

edges
(
);

patches
(
patch inlet
(
(0 3 7 4)

)
patch outlet
(
(17 18 22 21)

)

patch upperwall
(
(2 3 7 6)
(18 19 23 22)
)

patch lowerwall
(
(4 5 1 0)
(20 21 17 16)
)

patch connectingupperwall
(
(14 10 11 15)
(11 2 6 15)
(10 19 23 14)
)

patch connectinglowerwall
(
(12 13 9 8)
(1 8 12 5)
(16 9 13 20)
)

empty frontAndBack
(
(0 1 2 3)
(4 5 6 7)
(8 9 10 11)
(12 13 14 15)
(16 17 18 19)
(20 21 22 23)
)
);

mergePatchPairs
(
);

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

When I run the mesh I get the following error..

Reading block mesh description dictionary

Creating block mesh

Creating blockCorners

Creating curved edges

Creating blocks

Creating patches

Creating block mesh topology

Default patch type set to empty


face 1 in patch 4 does not have neighbour cell face: 4(11 2 6 15)#0
Foam::error::printStack(Foam:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream&) in
"/home/vishal/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#1 Foam::error::abort() in
"/home/vishal/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#2 Foam:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream& Foam::operator<<>(Foam:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream&,
Foam::errorManip<foam::error>) in
"/home/vishal/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/blockMesh"
#3 Foam::polyMesh::facePatchFaceCells(Foam::List<foam ::face> const&,
Foam::List<foam::list<int> > const&, Foam::List<foam::list<foam::face>
> const&, int) const in
"/home/vishal/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#4 Foam::polyMesh::polyMesh(Foam::IOobject const&,
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 "/home/vishal/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#5 Foam::blockMesh::createTopology(Foam::IOdictionary &) in
"/home/vishal/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/blockMesh"
#6 Foam::blockMesh::blockMesh(Foam::IOdictionary&) in
"/home/vishal/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/blockMesh"
#7 main in "/home/vishal/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/blockMesh"
#8 __libc_start_main in "/lib/tls/i686/cmov/libc.so.6"
#9 __gxx_personality_v0 in
"/home/vishal/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/blockMesh"


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

FOAM aborting

Aborted


Kindly do the needful

Thanks


--
Regards

Vishal

nandiganavishal January 9, 2009 15:31

Hi, As I had posted before,
 
Hi,

As I had posted before, I finished coding
it, I would like to know how to define the patches for proper boundary
conditions... My boundary conditions are I have inlet at the left
vertical block and outlet at the right vertical block and at wall at
the rest as I had given in my geometry file in the forum... Kindly let
me know whether my code is correct.... Here is my blockMesh Dict file.

I have 2 vertical blocks of geometry 1 * 1 and a horizontal block in
the middle of geometry 5 (length) * 0.03 (height)

Vertical Block1 - Numbered as (0 1...7)
Vertical Block2 - Numbered as (16 17...23)
Horizontal block - Numbered as (8 9..15)

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

convertToMeters 1;

vertices
(
(0 0 0)
(1 0 0)
(1 1 0)
(0 1 0)
(0 0 0.1)
(1 0 0.1)
(1 1 0.1)
(0 1 0.1)
(1 0.485 0)
(6 0.485 0)
(6 0.515 0)
(1 0.515 0)
(1 0.485 0.1)
(6 0.485 0.1)
(6 0.515 0.1)
(1 0.515 0.1)
(6 0 0)
(7 0 0)
(7 1 0)
(6 1 0)
(6 0 0.1)
(7 0 0.1)
(7 1 0.1)
(6 1 0.1)

);

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

edges
(
);

patches
(
patch inlet
(
(0 3 7 4)

)
patch outlet
(
(17 18 22 21)

)

patch upperwall
(
(2 3 7 6)
(18 19 23 22)
)

patch lowerwall
(
(4 5 1 0)
(20 21 17 16)
)

patch connectingupperwall
(
(14 10 11 15)
(11 2 6 15)
(10 19 23 14)
)

patch connectinglowerwall
(
(12 13 9 8)
(1 8 12 5)
(16 9 13 20)
)

empty frontAndBack
(
(0 1 2 3)
(4 5 6 7)
(8 9 10 11)
(12 13 14 15)
(16 17 18 19)
(20 21 22 23)
)
);

mergePatchPairs
(
);

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

When I run the mesh I get the following error..

Reading block mesh description dictionary

Creating block mesh

Creating blockCorners

Creating curved edges

Creating blocks

Creating patches

Creating block mesh topology

Default patch type set to empty


face 1 in patch 4 does not have neighbour cell face: 4(11 2 6 15)#0
Foam::error::printStack(Foam:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream&) in
"/home/vishal/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#1 Foam::error::abort() in
"/home/vishal/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#2 Foam:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream& Foam::operator<<>(Foam:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream&,
Foam::errorManip<foam::error>) in
"/home/vishal/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/blockMesh"
#3 Foam::polyMesh::facePatchFaceCells(Foam::List<foam ::face> const&,
Foam::List<foam::list<int> > const&, Foam::List<foam::list<foam::face>
> const&, int) const in
"/home/vishal/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#4 Foam::polyMesh::polyMesh(Foam::IOobject const&,
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 "/home/vishal/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#5 Foam::blockMesh::createTopology(Foam::IOdictionary &) in
"/home/vishal/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/blockMesh"
#6 Foam::blockMesh::blockMesh(Foam::IOdictionary&) in
"/home/vishal/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/blockMesh"
#7 main in "/home/vishal/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/blockMesh"
#8 __libc_start_main in "/lib/tls/i686/cmov/libc.so.6"
#9 __gxx_personality_v0 in
"/home/vishal/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/blockMesh"


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

FOAM aborting

Aborted


Kindly do the needful

Thanks


--
Regards

Vishal

wolle1982 January 13, 2009 05:05

Hi, in my opinion you can n
 
Hi,

in my opinion you can not only use 3 blocks for this problem. you might not use a block and attach another block to it without any further connection rules. in your solution you have the faces with double boundary conditions.

use at least 7 blocks. for this you have to insert more vertices. maybe you can work with one symmetryPlane horizontally through the middle. so you only had to change the coordinates and use 5 blocks.

another solution could be, you crearte 6 blocks. so they are also devided in the middle. and your connectionblock in the middle consists of 2 horizontal devided blocks.

i yould prefer the symmetryPlane solution.

good luck.

sachin January 13, 2009 10:09

Yes, my mistake should have be
 
Yes, my mistake should have been atleast 5, 3 was wrong ans

nandiganavishal January 13, 2009 15:20

Hi Wolfgang and Sachin Than
 
Hi Wolfgang and Sachin

Thanks for the information, I finished creating the geometry with 7 blocks and implemented it in the code, it is working fine at the moment. I would get back to you guys if I encounter any problem.

Thanks

Regards

Vishal


All times are GMT -4. The time now is 17:45.