CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [blockMesh] 3-D Mesh in a cylinder (https://www.cfd-online.com/Forums/openfoam-meshing/104486-3-d-mesh-cylinder.html)

Nikunj.R July 10, 2012 16:13

3-D Mesh in a cylinder
 
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.

MartinB July 10, 2012 16:56

Hi Nikunj,

you should post your blockMeshDict so that we can help,

Martin

SirWombat July 11, 2012 04:19

Hi Nikunj,

just found something that might help:
https://sites.google.com/site/snappy.../cylinder-case

Nikunj.R July 11, 2012 09:09

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 July 11, 2012 09:11

Please note that this file is for concentric cylinders.

Nikunj.R July 11, 2012 09:13

Thanks Jan for sharing it. Learning snappymesh for meshing this cylinder was going to be my next step .

MartinB July 11, 2012 09:44

1 Attachment(s)
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

Nikunj.R July 11, 2012 10:56

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 July 11, 2012 11:45

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
(
);

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

MartinB July 11, 2012 12:03

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

Nikunj.R July 11, 2012 14:15

Ohh, that helps a lot! Thanks a lot Martin!

-Nikunj.

Nikunj.R July 12, 2012 10:28

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::printStack(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)
);

MartinB July 12, 2012 10:40

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

Nikunj.R July 12, 2012 10:46

1 Attachment(s)
Ohh, my bad.

Here is the attached copy of the entire directory.

MartinB July 12, 2012 11:15

1 Attachment(s)
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

Nikunj.R July 12, 2012 16:01

Thanks a lot Martin! It works for quite long, and I am able to see the desired results too.

Thanks again1

Nikunj.R July 16, 2012 17:06

1 Attachment(s)
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.

Prash September 17, 2012 11:23

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 (Post 371149)
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


MartinB September 17, 2012 11:30

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 September 17, 2012 11:49

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 (Post 382178)
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



All times are GMT -4. The time now is 13:21.