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

[blockMesh] Cylinder in Openfoam blockMesh

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Lookid

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   January 18, 2021, 13:29
Default Cylinder in Openfoam blockMesh
  #1
New Member
 
Join Date: Nov 2020
Posts: 14
Rep Power: 5
Enternald is on a distinguished road
Hi All,



I am trying to create an cylinder using blockMesh, I got 3/4 the way through and noticed that it does not line up properly (shown in the image below). Does anyone know why this is the case?
Code:
convertToMeters 0.01;

//..................................//

// Dimensions of the cylinder:
cx 5;
cy 5;
cz 1.0;

cylinderThickness 1.0;
r 0.5;

//..................................//

// Calculations for cylinder geometry:
h #calc "$cylinderThickness+$cz";
tph #calc "$cylinderThickness+$cz+$cz";

vx #calc "$cx+$r";
nvx #calc "$cx-$r";

vy #calc "$cy+$r";
nvy #calc "$cy-$r";

// Calculations for arcs:
c1 #calc "$cx + ($r*cos(45.0))"; //cosine in first quadrant
s1 #calc "$cy + ($r*sin(45.0))"; //sine in first quadrant

c2 #calc "$cx + ($r*cos(135.0))"; //cosine in first quadrant
s2 #calc "$cy + ($r*sin(135.0))"; //sine in first quadrant

c3 #calc "$cx + ($r*cos(225.0))"; //cosine in first quadrant
s3 #calc "$cy + ($r*sin(225.0))"; //sine in first quadrant

c4 #calc "$cx + ($r*cos(315.0))"; //cosine in first quadrant
s4 #calc "$cy + ($r*sin(315.0))"; //sine in first quadrant

vertices
(   
//   Vertices for the cylinder :
//   x       y       z
    ($vx     $cy     $cz)           
    ($cx     $vy     $cz)           
    ($nvx    $cy     $cz)           
    ($cx     $nvy    $cz)          
    
    ($vx     $cy     $h)            
    ($cx     $vy     $h)            
    ($nvx    $cy     $h)            
    ($cx     $nvy    $h)              
    ($cx     $cy     $cz)           
    ($cx     $cy     $h)            
);

// These are all the 'blocks' in our geometry.
blocks
(
    hex ( 0 1 8 8 4 5 9 9 )      pores      ( 25  25  25 )    simpleGrading (1 1 1)
    hex ( 1 2 8 8 5 6 9 9 )      pores      ( 25  25  25 )    simpleGrading (1 1 1)
    hex ( 2 3 8 8 6 7 9 9 )      pores      ( 25  25  25 )    simpleGrading (1 1 1)
);

// Edges is a dictionary where we define arcs between vertices.
edges
(
     arc 0 1 ($c1 $s1 $cz)
     arc 1 2 ($c2 $s2 $cz)
     arc 2 3 ($c3 $s3 $cz)
     
     arc 4 5 ($c1 $s1 $h)
     arc 5 6 ($c2 $s2 $h)
     arc 6 7 ($c3 $s3 $h)
);

// Boundaries is where we define our boundary patches.
boundary
(
   wall
    {
        type wall;
        faces
        (
            (0 8 8 1)
            (1 8 8 2)
            (2 8 8 3)
        );
    }
    atmosphere
    {
        type patch;
        faces
        (
            (5 9 9 4)
            (6 9 9 5)
            (7 9 9 6)
        );
    }
    sides
    {
        type patch;
        faces
        (
            (0 1 5 4)
            (2 6 5 1)
            (3 7 6 2)
        );
    }
 
);

mergePatchPairs
(
);
Screenshot from 2021-01-18 14-27-16.pngScreenshot from 2021-01-18 14-26-27.png
Enternald is offline   Reply With Quote

 

Tags
blockmesh, blockmesh cylinder, openfoam


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 blockMesh error tenichols19 OpenFOAM Meshing & Mesh Conversion 2 February 3, 2021 11:36
How to implement time-varying boundary conditions in an enclosed cylinder Alejandro-FA OpenFOAM Pre-Processing 0 May 14, 2020 06:29
OpenFOAM v3.0.1 Training, London, Houston, Berlin, Jan-Mar 2016 cfd.direct OpenFOAM Announcements from Other Sources 0 January 5, 2016 03:18
Tube with cylinder inside in OpenFoam orxan.shibli OpenFOAM Running, Solving & CFD 1 September 6, 2015 11:53
Cross-compiling OpenFOAM 1.7.0 on Linux for Windows 32 and 64bits with Mingw-w64 wyldckat OpenFOAM Announcements from Other Sources 3 September 8, 2010 06:25


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