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

[blockMesh] 3-D Mesh in a cylinder

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 10, 2012, 17:13
Default 3-D Mesh in a cylinder
  #1
Member
 
Nikunj Raithatha
Join Date: Jul 2012
Location: Washington DC
Posts: 47
Rep Power: 14
Nikunj.R is on a distinguished road
Hello!

I am trying to mesh entire volume covered by a cylinder or for simplicity, a quarter of a cylinder. The cylinder is oriented such that its axis is z-axis (x=y=0) and radius is 5 m. The mesh is generated using blockMesh without any error. However, when i examine the mesh in paraView, I see cells only at top and bottom layers (z=0 and z=10), and on the side of the cylinder. I donot get any cells in the space covered by the cylinder.

In order to check if this is the case with other 3-Dimensional tutorial cases, I examined the meshing of hotRoom heat transfer tutorial "buoyanBoussinesqSimpleFoam". And that indeed was the case in this cuboidal geometry. It had cells only on the six faces. the volume of this geometery didnot have any cell.

Please help me with generating mesh/ cells in the volume of a geometry apart from that in faces.

Thanks,
-Nikunj.
Nikunj.R is offline   Reply With Quote

Old   July 10, 2012, 17:56
Default
  #2
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 22
MartinB will become famous soon enough
Hi Nikunj,

you should post your blockMeshDict so that we can help,

Martin
MartinB is offline   Reply With Quote

Old   July 11, 2012, 05:19
Default
  #3
Member
 
Jan
Join Date: Dec 2009
Location: Berlin
Posts: 50
Rep Power: 20
SirWombat is on a distinguished road
Send a message via Skype™ to SirWombat
Hi Nikunj,

just found something that might help:
https://sites.google.com/site/snappy.../cylinder-case
__________________
~~~_/)~~~
SirWombat is offline   Reply With Quote

Old   July 11, 2012, 10:09
Default
  #4
Member
 
Nikunj Raithatha
Join Date: Jul 2012
Location: Washington DC
Posts: 47
Rep Power: 14
Nikunj.R is on a distinguished road
Thanks for your swift reply Martin. Here is my meshing file:
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 1;
vertices
(
(0 0 0)
(1.09 0 0)
(1.2 -0.11 0)
(1.2 -1.2 0)
(2.4 0 0)
(1.31 0 0)
(1.2 0.11 0)
(1.2 1.2 0)
(0 0 0.8)
(1.09 0 0.8)
(1.2 -0.11 0.8)
(1.2 -1.2 0.8)
(2.4 0 0.8)
(1.31 0 0.8)
(1.2 0.11 0.8)
(1.2 1.2 0.8)
(0 0 4.4)
(1.09 0 4.4)
(1.2 -0.11 4.4)
(1.2 -1.2 4.4)
(2.4 0 4.4)
(1.31 0 4.4)
(1.2 0.11 4.4)
(1.2 1.2 4.4)
);
blocks
(
hex (0 3 2 1 8 11 10 9) (4 4 4) simpleGrading (1 1 1)
hex (3 4 5 2 11 12 13 10) (4 4 4) simpleGrading (1 1 1)
hex (4 7 6 5 12 15 14 13) (4 4 4) simpleGrading (1 1 1)
hex (7 0 1 6 15 8 9 14) (4 4 4) simpleGrading (1 1 1)
hex (8 11 10 9 16 19 18 17) (4 4 4) simpleGrading (1 1 1)
hex (11 12 13 10 19 20 21 18) (4 4 4) simpleGrading (1 1 1)
hex (12 15 14 13 20 23 22 21) (4 4 4) simpleGrading (1 1 1)
hex (15 8 9 14 23 16 17 22) (4 4 4) simpleGrading (1 1 1)
);
edges
(
arc 0 3 (0.35147 -0.84853 0)
arc 3 4 (2 -0.89443 0)
arc 4 7 (2 0.89443 0)
arc 7 0 (0.35147 0.84853 0)
arc 1 2 (1.122 -0.0778 0)
arc 2 5 (1.2778 -0.0778 0)
arc 5 6 (1.2778 0.0778 0)
arc 6 1 (1.122 0.0778 0)
arc 8 11 (0.35147 -0.84853 0.8)
arc 11 12 (2 -0.89443 0.8)
arc 12 15 (2 0.89443 0.8)
arc 15 8 (0.35147 0.84853 0.8)
arc 9 10 (1.122 -0.0778 0.8)
arc 10 13 (1.2778 -0.0778 0.8)
arc 13 14 (1.2778 0.0778 0.8)
arc 14 9 (1.122 0.0778 0.8)
arc 16 19 (0.35147 -0.84853 4.4)
arc 19 20 (2 -0.89443 4.4)
arc 20 23 (2 0.89443 4.4)
arc 23 16 (0.35147 0.84853 4.4)
arc 17 18 (1.122 -0.0778 4.4)
arc 18 21 (1.2778 -0.0778 4.4)
arc 21 22 (1.2778 0.0778 4.4)
arc 22 17 (1.122 0.0778 4.4)
);
boundary
(
top
{
type wall;
faces
(
(17 16 19 18)
(18 19 20 21)
(21 20 23 22)
(16 17 22 23)
);
}

side
{
type wall;
faces
(
(3 11 8 0)
(4 12 11 3)
(7 15 12 4)
(0 8 15 7)
(11 19 16 8)
(12 20 19 11)
(15 23 20 12)
(8 16 23 15)
);
}
bottom
{
type wall;
faces
(
(0 1 2 3)
(3 2 5 4)
(4 5 6 7)
(1 0 7 6)
);
}
bottom_innerc
{
type wall;
faces
(
(9 10 2 1)
(10 13 5 2)
(13 14 6 5)
(14 9 1 6)
);
}
top_innerc
{
type wall;
faces
(
(17 18 10 9)
(18 21 13 10)
(21 22 14 13)
(22 17 9 14)
);
}
);
mergePatchPairs
(
);
// ************************************************** *********************** //
Nikunj.R is offline   Reply With Quote

Old   July 11, 2012, 10:11
Default
  #5
Member
 
Nikunj Raithatha
Join Date: Jul 2012
Location: Washington DC
Posts: 47
Rep Power: 14
Nikunj.R is on a distinguished road
Please note that this file is for concentric cylinders.
Nikunj.R is offline   Reply With Quote

Old   July 11, 2012, 10:13
Default
  #6
Member
 
Nikunj Raithatha
Join Date: Jul 2012
Location: Washington DC
Posts: 47
Rep Power: 14
Nikunj.R is on a distinguished road
Thanks Jan for sharing it. Learning snappymesh for meshing this cylinder was going to be my next step .
Nikunj.R is offline   Reply With Quote

Old   July 11, 2012, 10:44
Default
  #7
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 22
MartinB will become famous soon enough
Hi Nikunj,

your blockMeshDict works fine for me... There are cells in the volume, as you can see in the screenshot.
I think I do not understand your problem correctly. Do you want to have cells in the center of the cylinder, too?

Regards

Martin
Attached Images
File Type: jpg mesh_screenshot.jpg (32.0 KB, 916 views)
MartinB is offline   Reply With Quote

Old   July 11, 2012, 11:56
Default
  #8
Member
 
Nikunj Raithatha
Join Date: Jul 2012
Location: Washington DC
Posts: 47
Rep Power: 14
Nikunj.R is on a distinguished road
ohhk, probably then there is an error in the way I am viewing the mesh. Will try running it in paraFoam again.

Thanks a lot for your replies Martin!

-Nikunj.
Nikunj.R is offline   Reply With Quote

Old   July 11, 2012, 12:45
Default
  #9
Member
 
Nikunj Raithatha
Join Date: Jul 2012
Location: Washington DC
Posts: 47
Rep Power: 14
Nikunj.R is on a distinguished road
Hello Martin!
As you correctly pointed out in previous reply, now, I wanna have cells in the center of the cylinder too.
As of now I am just considering the bottom part. Despite repeated trials, I am getting error, "face 0 in patch 2 does not have neighbour cell face: 4(7 2 3 8)"

would you please help me with this.

Thanks,
Nikunj.

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

convertToMeters 1;

vertices
(
(0 0 0)
(0.11 0 0)
(1.2 0 0)
(0 1.2 0)
(0 0.11 0)
(0 0 0.8)
(0.11 0 0.8)
(1.2 0 0.8)
(0 1.2 0.8)
(0 0.11 0.8)
);

blocks
(
hex (0 1 4 0 5 6 9 5) (4 4 4) simpleGrading (1 1 1)
hex (4 1 2 3 6 7 8 9) (4 4 4) simpleGrading (1 1 1)
);

edges
(
arc 1 4 (0.078 0.078 0)
arc 2 3 (0.848 0.848 0)
arc 6 9 (0.078 0.078 0.88)
arc 7 8 (0.848 0.848 0.88)
);

boundary
(

top
{
type wall;
faces
(
(5 6 9 5)
(6 7 8 9)
);
}

bottom
{
type wall;
faces
(
(2 1 4 3)
(1 0 4 1)
);
}

lateral
{
type wall;
faces
(
(7 2 3 8)
);
}

bottom_innerc
{
type patch;
faces
(
(1 4 9 6)
);
}
sides
{
type wall;
faces
(
(1 2 7 6)
(0 1 6 5)
(9 8 3 4)
(5 9 4 0)
);
}
);

mergePatchPairs
(
);

// ************************************************** *********************** //
Nikunj.R is offline   Reply With Quote

Old   July 11, 2012, 13:03
Default
  #10
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 22
MartinB will become famous soon enough
Hi,

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

convertToMeters 1;

vertices        
(
    (0 0 0) 
    (0.11 0 0) 
    (1.2 0 0) 
    (0 1.2 0) 
    (0 0.11 0)
    (0 0 0.8) 
    (0.11 0 0.8)
    (1.2 0 0.8) 
    (0 1.2 0.8) 
    (0 0.11 0.8)   
);

blocks          
(
    hex (0 1 4 0 5 6 9 5) (4 4 4) simpleGrading (1 1 1)
    hex (4 1 2 3 9 6 7 8) (4 4 4) simpleGrading (1 1 1)
);

edges           
(
    arc 1 4 (0.078 0.078 0)
    arc 2 3 (0.848 0.848 0)
    arc 6 9 (0.078 0.078 0.8)
    arc 7 8 (0.848 0.848 0.8)
);

boundary
(

    top 
    {
        type wall;
        faces
        (
            (5 6 9 5)
            (6 7 8 9)
        );
    }
    
    bottom
    {
         type wall;
         faces
         (
            (2 1 4 3)
            (1 0 4 1)
         );
    }   

    lateral 
    {
        type wall;
        faces
        (
            (7 2 3 8)
        );
    }   

    /*bottom_innerc
    {
         type patch;
         faces
         (   
            (1 4 9 6)
         );
    } */
    sides
    {
         type wall;
         faces
         (   
            (1 2 7 6)   
            (0 1 6 5)   
            (9 8 3 4)   
            (5 9 4 0)
         );
    } 
);

mergePatchPairs 
(
);

// ************************************************************************* //
Some z-coordinates at the edge were problematic, you don't have to define internal walls and one of the numerations was wrong.
If you have pyFoam installed, try the pyFoamDisplayBlockMesh utility for debugging.
Or you can use "paraFoam -block" and play with the "wireframe" and "surface with edges" visualization.

Martin
MartinB is offline   Reply With Quote

Old   July 11, 2012, 15:15
Default
  #11
Member
 
Nikunj Raithatha
Join Date: Jul 2012
Location: Washington DC
Posts: 47
Rep Power: 14
Nikunj.R is on a distinguished road
Ohh, that helps a lot! Thanks a lot Martin!

-Nikunj.
Nikunj.R is offline   Reply With Quote

Old   July 12, 2012, 11:28
Default
  #12
Member
 
Nikunj Raithatha
Join Date: Jul 2012
Location: Washington DC
Posts: 47
Rep Power: 14
Nikunj.R is on a distinguished road
Martin, in order to simulate full cylindrical geometry, I am trying to implement symmetry condition on the "sides" boundary, after separating them to side 1 and side 2 as shown in the file below. BlockMesh isnt showing any error for this file but I am getting the following error when I am running the buoyantboussinesPimpleFoam solver on it.

"#0 Foam::error:rintStack(Foam::Ostream&) in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#1 Foam::sigFpe::sigHandler(int) in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#2 Uninterpreted:
#3 Foam::PBiCG::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#4 Foam::fvMatrix<double>::solve(Foam::dictionary const&) in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libfiniteVolume.so"
#5 Foam::fvMatrix<double>::solve() in "/opt/openfoam211/platforms/linuxGccDPOpt/bin/buoyantBoussinesqPimpleFoam"
#6 Foam::incompressible::RASModels::kEpsilon::correct () in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libincompressibleRASModels.so"
#7
in "/opt/openfoam211/platforms/linuxGccDPOpt/bin/buoyantBoussinesqPimpleFoam"
#8 __libc_start_main in "/lib/i386-linux-gnu/libc.so.6"
#9
in "/opt/openfoam211/platforms/linuxGccDPOpt/bin/buoyantBoussinesqPimpleFoam"
Floating point exception (core dumped)
"

Would you please tell me, whether this error is due to improper use of symmetryPlane or something else.

Thanks a lot!
-Nikunj.
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 1;

vertices
(
(0 0 0)
(0.11 0 0)
(1.2 0 0)
(0 1.2 0)
(0 0.11 0)
(0 0 0.8)
(0.11 0 0.8)
(1.2 0 0.8)
(0 1.2 0.8)
(0 0.11 0.8)
(0.11 0 4.4)
(1.2 0 4.4)
(0 1.2 4.4)
(0 0.11 4.4)
);

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

edges
(
arc 1 4 (0.078 0.078 0)
arc 2 3 (0.848 0.848 0)
arc 6 9 (0.078 0.078 0.8)
arc 7 8 (0.848 0.848 0.8)
arc 10 13 (0.078 0.078 4.4)
arc 11 12 (0.848 0.848 4.4)
);

boundary
(

top_innerc
{
type wall;
faces
(
(6 10 13 9)
);
Nikunj.R is offline   Reply With Quote

Old   July 12, 2012, 11:40
Default
  #13
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 22
MartinB will become famous soon enough
Hi Nikunj,

the blockMeshDict is incomplete. You may want to upload the complete case as tar.gz file.
Or you can disable turbulence and try if it is running laminar, first.

Martin
MartinB is offline   Reply With Quote

Old   July 12, 2012, 11:46
Default
  #14
Member
 
Nikunj Raithatha
Join Date: Jul 2012
Location: Washington DC
Posts: 47
Rep Power: 14
Nikunj.R is on a distinguished road
Ohh, my bad.

Here is the attached copy of the entire directory.
Attached Files
File Type: gz Cylinder2.tar.gz (3.6 KB, 253 views)
Nikunj.R is offline   Reply With Quote

Old   July 12, 2012, 12:15
Default
  #15
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 22
MartinB will become famous soon enough
Hi Nikunj,

your blockMeshDict is fine. The problems come from the other settings. Attached you can find a version that runs for a bit longer, although it still crashes at some point of time.

You should play around with mesh resolution, eventually fvSchemes, max time step and maxCo, nOuterCorrectors etc.

Good luck

Martin
Attached Files
File Type: gz Cylinder2_b.tar.gz (3.1 KB, 307 views)
MartinB is offline   Reply With Quote

Old   July 12, 2012, 17:01
Default
  #16
Member
 
Nikunj Raithatha
Join Date: Jul 2012
Location: Washington DC
Posts: 47
Rep Power: 14
Nikunj.R is on a distinguished road
Thanks a lot Martin! It works for quite long, and I am able to see the desired results too.

Thanks again1
Nikunj.R is offline   Reply With Quote

Old   July 16, 2012, 18:06
Default
  #17
Member
 
Nikunj Raithatha
Join Date: Jul 2012
Location: Washington DC
Posts: 47
Rep Power: 14
Nikunj.R is on a distinguished road
Hello Martin!

I have posted this querry in another section, I was wondering if you could help me with the same.

I am trying to implement the trubulent heat flux temperature BC in my model.
I think, I have successfully recompiled the BuoyanBoussinesqPimpleFoam solver to be able to use the above BC (as described in this discussion: HeatFlux in buoyantBoussinesq). When running a test case with the recompiled solver, I am getting following error.

FOAM FATAL IO ERROR:
wrong token type - expected Scalar, found on line 36 the word 'Cp0'

file: /home/eri/OpenFOAM/eri-2.1.1/run/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/FullCylinderWater/constant/transportProperties::Cp0 at line 36.

From function operator>>(Istream&, Scalar&)
in file lnInclude/Scalar.C at line 91.

FOAM exiting


Attached below are the files i used.

Any help will be greatly appreciated.

Thanks,
Nikunj.
Attached Files
File Type: gz FullCylinderWater.tar.gz (4.2 KB, 141 views)
Nikunj.R is offline   Reply With Quote

Old   September 17, 2012, 12:23
Default
  #18
New Member
 
Prashant Gupta
Join Date: Mar 2011
Location: Edinburgh
Posts: 29
Rep Power: 15
Prash is on a distinguished road
Hi Martin,

I tried the file you attached here, in a search of how to produce cylidrical mesh.
I got this message when i issued blockMesh from main case directory.

Creating block mesh from
"/home/university/OpenFOAM/university-1.7.1/run/Cylinder/constant/polyMesh/blockMeshDict"


Creating blockCorners

Creating curved edges

Creating blocks

Creating patches


--> FOAM FATAL IO ERROR:
keyword patches is undefined in dictionary "/home/university/OpenFOAM/university-1.7.1/run/Cylinder/constant/polyMesh/blockMeshDict"

file: /home/university/OpenFOAM/university-1.7.1/run/Cylinder/constant/polyMesh/blockMeshDict from line 17 to line 102.

From function dictionary::lookupEntry(const word&, bool, bool) const
in file db/dictionary/dictionary.C at line 395.

FOAM exiting





Thanks
Prashant







Quote:
Originally Posted by MartinB View Post
Hi Nikunj,

your blockMeshDict is fine. The problems come from the other settings. Attached you can find a version that runs for a bit longer, although it still crashes at some point of time.

You should play around with mesh resolution, eventually fvSchemes, max time step and maxCo, nOuterCorrectors etc.

Good luck

Martin
Prash is offline   Reply With Quote

Old   September 17, 2012, 12:30
Default
  #19
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 22
MartinB will become famous soon enough
Hi Prashant,

the posted blockMeshDict is for OpenFOAM version 2.0.0 or greater. You must adjust the syntax around the patch definitions to meet the requirements for OpenFOAM-1.7.1.

Martin
MartinB is offline   Reply With Quote

Old   September 17, 2012, 12:49
Default
  #20
New Member
 
Prashant Gupta
Join Date: Mar 2011
Location: Edinburgh
Posts: 29
Rep Power: 15
Prash is on a distinguished road
Hi Martin,

Thanks for your reply, but I am not sure, when you say "adjust the syntax around the patch definitions to meet the requirements for OpenFOAM-1.7.1."

Please help. do i need to define patches in 1.7.1 ?

Best wishes
Prashant



Quote:
Originally Posted by MartinB View Post
Hi Prashant,

the posted blockMeshDict is for OpenFOAM version 2.0.0 or greater. You must adjust the syntax around the patch definitions to meet the requirements for OpenFOAM-1.7.1.

Martin
Prash 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] Cylinder mesh using blockMesh with m4 macro Lewis Liang OpenFOAM Meshing & Mesh Conversion 2 November 21, 2017 03:28
[mesh manipulation] Importing Multiple Meshes thomasnwalshiii OpenFOAM Meshing & Mesh Conversion 18 December 19, 2015 19:57
[snappyHexMesh] No layers in a small gap bobburnquist OpenFOAM Meshing & Mesh Conversion 6 August 26, 2015 10:38
[snappyHexMesh] Layers:problem with curvature giulio.topazio OpenFOAM Meshing & Mesh Conversion 10 August 22, 2012 10:03
rotating cylinder using sliding mesh Tim Daly FLUENT 1 November 10, 2008 00:02


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