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

[blockMesh] Cylindrical mesh with an odd number of circumferential cells

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 14, 2015, 09:37
Default Cylindrical mesh with an odd number of circumferential cells
  #1
New Member
 
Gregor Neuber
Join Date: Dec 2012
Posts: 2
Rep Power: 0
Eldor is on a distinguished road
Hello everyone,

I want to create a cylindrical mesh with an odd number of equidistant distributed circumferential cells, to be more precise there must be 17 of them.

I tried a lot but did not get a solution, for example:

i) with one block, but you'll end up by ether an block inconsistency error or an arc definition error "Invalid arc definition - are the points co-linear? Denom =0"
ii) two blocks, but since the face numbers between these blocks are different at the centerline, I get also an error message.

Is there an intelligent way to do it? It looks like a very easy problem, but I can not get a solution.

Thanks for any help!

Regards,
Gregor
Eldor is offline   Reply With Quote

Old   April 16, 2015, 04:21
Default
  #2
New Member
 
Gregor Neuber
Join Date: Dec 2012
Posts: 2
Rep Power: 0
Eldor is on a distinguished road
Here is one solution, which is definitely not very elegant:

Code:
/*--------------------------------*- C++ -*-------------------------------------*\
 * | =========                 |                                                 |
 * | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
 * |  \\    /   O peration     | Version:  1.7.1                                 |
 * |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 * |    \\/     M anipulation  |                                                 |
 * \*---------------------------------------------------------------------------*/

FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      blockMeshDict;
}

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

convertToMeters      1; 

pi                   3.141592653589793;
rad                  #calc "2.0*$pi/360.0";

D                    0.005;

nCircumveratialCells 17;

// positions * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

inlet                0.0;

outlet               #calc "40*$pi*$D";

domain               #calc "12*$pi*$D";

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

alpha1               #calc "360/$nCircumveratialCells*$rad";
alpha2               #calc "$alpha1+($nCircumveratialCells-1)/2*360/$nCircumveratialCells*$rad";
alpha3               #calc "$alpha2+($nCircumveratialCells-1)/2*360/$nCircumveratialCells*$rad";

domainx1             #calc  "$domain*cos($alpha1)";
domainy1             #calc  "$domain*sin($alpha1)";

domainx2             #calc  "$domain*cos($alpha2)";
domainy2             #calc  "$domain*sin($alpha2)";

domainx3             #calc  "$domain*cos($alpha3)";
domainy3             #calc  "$domain*sin($alpha3)";

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

vertices
(
    ($domainx1  $domainy1  $inlet)   // 0
    ($domainx2  $domainy2  $inlet)   // 1
    ($domainx3  $domainy3  $inlet)   // 2
    
    ($domainx1  $domainy1  $outlet)  // 3
    ($domainx2  $domainy2  $outlet)  // 4
    ($domainx3  $domainy3  $outlet)  // 5
    
    (0.0        0.0        $inlet)   // 6
    (0.0        0.0        $outlet)  // 7
);

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

nCircumveratialPoints1 #calc "($nCircumveratialCells-1)/2";
nCircumveratialPoints2 #calc "$nCircumveratialPoints1";
nCircumveratialPoints3 1;

// radial resolution
nRadialPoints          10;
sRadialInlet           0.1;
sRadialOutlet          1;

// axial resolution
nDomain                32;
sDomain                7.544161191700337;

blocks
(
    // nozzle
    hex ( 0  1  6  6  3  4  7  7) ($nCircumveratialPoints1 $nRadialPoints $nDomain)  edgeGrading (1 1 1 1 $sRadialInlet $sRadialInlet $sRadialOutlet $sRadialOutlet $sDomain $sDomain $sDomain $sDomain)  
    hex ( 1  2  6  6  4  5  7  7) ($nCircumveratialPoints2 $nRadialPoints $nDomain)  edgeGrading (1 1 1 1 $sRadialInlet $sRadialInlet $sRadialOutlet $sRadialOutlet $sDomain $sDomain $sDomain $sDomain)  
    hex ( 2  0  6  6  5  3  7  7) ($nCircumveratialPoints3 $nRadialPoints $nDomain)  edgeGrading (1 1 1 1 $sRadialInlet $sRadialInlet $sRadialOutlet $sRadialOutlet $sDomain $sDomain $sDomain $sDomain)
);

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

beta1  #calc "360/$nCircumveratialCells*$rad+$rad";
beta2  #calc "3/2*$beta1+($nCircumveratialCells-1)/2*360/$nCircumveratialCells*$rad";
beta3  #calc "$beta2+($nCircumveratialCells-1)/2*360/$nCircumveratialCells*$rad";

// domain
circDomainx1           #calc "$domain*cos($beta1)";
circDomainy1           #calc "$domain*sin($beta1)";
circDomainx2           #calc "$domain*cos($beta2)";
circDomainy2           #calc "$domain*sin($beta2)";
circDomainx3           #calc "$domain*cos($beta3)";
circDomainy3           #calc "$domain*sin($beta3)";

edges
(    
    arc  0  1 ($circDomainx1  $circDomainy1  $inlet)
    arc  1  2 ($circDomainx2  $circDomainy2  $inlet)
    arc  2  0 ($circDomainx3  $circDomainy3  $inlet)
        
    arc  3  4 ($circDomainx1  $circDomainy1  $outlet)
    arc  4  5 ($circDomainx2  $circDomainy2  $outlet)
    arc  5  3 ($circDomainx3  $circDomainy3  $outlet)
);

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

boundary
(   
    inletJet
    {
        type patch;
        physicalType noParticleOutflow;
        faces
        (
            ( 0  1  6  6)
            ( 1  2  6  6)
            ( 2  0  6  6)
        );
    }
    
    outlet
    {
        type patch;
        physicalType particleOutflow;
        faces
        (
            ( 3  4  7  7)
            ( 4  5  7  7)
            ( 5  3  7  7)
        );
    }
    
    side
    {
        type patch;
        physicalType noParticleOutflow;
        faces
        (
            (0  3  4  1)
            (1  4  5  2)
            (2  5  3  0)
        );   
    }
);

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Since this is only working for odd circumferential cell numbers, I have to add one block if I want to have for example 14 circumferential cells.

Does anyone have an idea on a more elegant version?

Best regards,
Gregor
Eldor 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
[snappyHexMesh] SnappyHexMesh running killed! Mark JIN OpenFOAM Meshing & Mesh Conversion 7 June 14, 2022 01:37
[snappyHexMesh] Error snappyhexmesh - Multiple outside loops avinashjagdale OpenFOAM Meshing & Mesh Conversion 53 March 8, 2019 09:42
[Other] Equal decomposition of cylindrical fluid domain Sean95 OpenFOAM Meshing & Mesh Conversion 3 February 12, 2019 03:34
SigFpe when running ANY application in parallel Pj. OpenFOAM Running, Solving & CFD 3 April 23, 2015 14:53
[snappyHexMesh] snappyHexMesh won't work - zeros everywhere! sc298 OpenFOAM Meshing & Mesh Conversion 2 March 27, 2011 21:11


All times are GMT -4. The time now is 20:35.