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

[blockMesh] could anyone post a simple cylinder mesh

Register Blogs Community New Posts Updated Threads Search

Like Tree16Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 8, 2020, 12:42
Default
  #41
Senior Member
 
Franco
Join Date: Nov 2019
Location: Compiègne, France
Posts: 129
Rep Power: 6
otaolafr is on a distinguished road
Quote:
Originally Posted by TanF View Post
Hello everyone!
I am currently working with OpenFoam to create a cylinder. The cylinder I need should only be discretized in the h direction (Photo). Does anyone know how I can avoid the round basement being divided into so many small cells? (I have attached a photo).
I´m quite new to OpenFoam and would be very happy if someone could help me!
Regards!
hello,

mm from what i have read about the subject, in OpenFOAM the cylinder is created from adding an arc section to a square section. but from your post:
i do not get why you need this ? (are you trying to simulate a 2D simulation?)
at least from what i know in of doing a cylinder with only separation in the axis, would not be possible...but i insist that i can not imagine why you would like to do that (i am new to CFD so maybe i am not following you..) maybe if you explain me a little bit more i could help you more
best regards.
otaolafr is offline   Reply With Quote

Old   May 8, 2020, 14:02
Default
  #42
New Member
 
Join Date: May 2020
Posts: 3
Rep Power: 6
TanF is on a distinguished road
Hi Otaolafr,
Thank you for your answer!
I try to do this because I need a cylinder mesh for simulations with an other program. In this other program the simulation time is very long if I have so many cells - maybe there is a way to connect the cells on the round basement?
And beside of that I need to be able to fix the initial parameters of the cells on one side of the cylinder and I can't fix so many...
Also I have researched whether there is a possibility to connect all cells of the grid to one cell but so far I do not think that works ...Maybe you have an idea? I would be very grateful!
TanF is offline   Reply With Quote

Old   May 8, 2020, 15:50
Default
  #43
Senior Member
 
Franco
Join Date: Nov 2019
Location: Compiègne, France
Posts: 129
Rep Power: 6
otaolafr is on a distinguished road
Quote:
Originally Posted by TanF View Post
Hi Otaolafr,
Thank you for your answer!
I try to do this because I need a cylinder mesh for simulations with an other program. In this other program the simulation time is very long if I have so many cells - maybe there is a way to connect the cells on the round basement?
And beside of that I need to be able to fix the initial parameters of the cells on one side of the cylinder and I can't fix so many...
Also I have researched whether there is a possibility to connect all cells of the grid to one cell but so far I do not think that works ...Maybe you have an idea? I would be very grateful!
mmmm... you need a surface mesh? an .stl? i dont know what program, i find it strage that you need a cylinder with a one only cell in the r direction. sadly no, i can not imagine how to do it, at least you are going to have five cells.have a look here (credits to wolfdynamics) page 59/60 http://www.wolfdynamics.com/images/O..._blockmesh.pdf
otaolafr is offline   Reply With Quote

Old   May 8, 2020, 16:20
Default
  #44
New Member
 
Join Date: May 2020
Posts: 3
Rep Power: 6
TanF is on a distinguished road
Oh I'm sorry, I don't need a cylinder with just one cell. I just thought that maybe there is a command that can unify all of them, that would solve the problem of having so many. Having a mesh with 5 cells would be alright... What I need is a cylinder that has just one cell in the round basement and not thousands like in the picture of the mesh I posted. And additionally it would be perfect if the mesh would only be discretized in one direction - that is all I want ☺️ but I think that is to much wanted! 😐
TanF is offline   Reply With Quote

Old   May 9, 2020, 10:19
Default
  #45
Member
 
Rodrigo
Join Date: Mar 2010
Posts: 98
Rep Power: 16
guin is on a distinguished road
Following alternative may be of interest for some visitors of this thread:

Simple cylindrical geometry: example using blockMesh

PS: IMHO the proposed whole-cylinder with inner wedged elements may lead to numerical troubles along the axis... Therefore I'd rather recommend to use hex-elements whenever possible. Most algorithms will behave more gracefully!
guin is offline   Reply With Quote

Old   May 9, 2020, 10:51
Default
  #46
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13
HPE is on a distinguished road
I once found the following relevant script from Ehsan Madadi, might be useful for some of you to generate cylinder meshes with OpenFOAM:

https://www.ehsanmadadi.com/cylinder-mesh/
HPE is offline   Reply With Quote

Old   October 23, 2020, 18:18
Default
  #47
Senior Member
 
Join Date: Sep 2013
Posts: 353
Rep Power: 21
Bloerb will become famous soon enough
A simple example


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

convertToMeters 1;
pri   0.20; // positiv inner radius
pxm   0.12; // postiv x value for smooth transition on inner rectangle
pra   0.325; // positve outer radius
nxm   #neg $pxm; // #neg only works in foundation version
nri   #neg $pri; // #neg only works in foundation version
nra   #neg $pra; // #neg only works in foundation version

leA   0.785; // upper z value 
leB   0.0;   // lower z value 

pa 25; // number of cells in angle phi direction(per block) or 4*pa around circumference. inner rectangle pa*pa 
ra 10; // number of cells in radial direction
za 50; // number of cells along the height


vertices
(   
  name i0 (0    $nri $leA)
  name i1 ($pri 0    $leA)
  name i2 (0    $pri $leA)
  name i3 ($nri 0    $leA)
  
  name a0 (0    $nra $leA)
  name a1 ($pra 0    $leA)
  name a2 (0    $pra $leA)
  name a3 ($nra 0    $leA)  
  
  name I0 (0    $nri $leB)
  name I1 ($pri 0    $leB)
  name I2 (0    $pri $leB)
  name I3 ($nri 0    $leB)
  
  name A0 (0    $nra $leB)
  name A1 ($pra 0    $leB)
  name A2 (0    $pra $leB)
  name A3 ($nra 0    $leB)   
);

blocks
(
  hex (i3 i2 i1 i0 I3 I2 I1 I0) myCellZone ($pa $pa $za) simpleGrading (1 1 1)     
  hex (i0 i1 a1 a0 I0 I1 A1 A0) myCellZone ($pa $ra $za) simpleGrading (1 1 1)    
  hex (i1 i2 a2 a1 I1 I2 A2 A1) myCellZone ($pa $ra $za) simpleGrading (1 1 1)    
  hex (i2 i3 a3 a2 I2 I3 A3 A2) myCellZone ($pa $ra $za) simpleGrading (1 1 1) 
  hex (i3 i0 a0 a3 I3 I0 A0 A3) myCellZone ($pa $ra $za) simpleGrading (1 1 1)  
);

edges
(

 spline i0 i1  (($pxm $nxm $leA))  # spline on inner square to round it for improved mesh quality  
 spline i1 i2  (($pxm $pxm $leA))
 spline i2 i3  (($nxm $pxm $leA))
 spline i3 i0  (($nxm $nxm $leA))

 spline I0 I1  (($pxm $nxm $leB)) 
 spline I1 I2  (($pxm $pxm $leB))
 spline I2 I3  (($nxm $pxm $leB))
 spline I3 I0  (($nxm $nxm $leB))

 arc a0 a1  90 (0 0 1)   # works in the foundation version  
 arc a1 a2  90 (0 0 1)
 arc a2 a3  90 (0 0 1)
 arc a3 a0  90 (0 0 1)   

 arc A0 A1  90 (0 0 1)    
 arc A1 A2  90 (0 0 1)
 arc A2 A3  90 (0 0 1)
 arc A3 A0  90 (0 0 1)  
);
   
defaultPatch
{
    name allBoundary;
    type wall;
}   

boundary
(  
);
Bloerb 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
how to set periodic boundary conditions Ganesh FLUENT 15 November 18, 2020 07:09
Prescribed Translating Cylinder Mesh for Added Mass Problem (Transient FSI) Lloyd Sullivan CFX 5 August 7, 2018 09:11
[snappyHexMesh] SnappyHexMesh for internal Flow vishwa OpenFOAM Meshing & Mesh Conversion 24 June 27, 2016 09:54
[ICEM] How to mesh for regular pentagonal cylinder using ICEM in 2D? ranjanrk ANSYS Meshing & Geometry 0 June 18, 2016 03:10
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 07:20


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