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] could anyone post a simple cylinder mesh (https://www.cfd-online.com/Forums/openfoam-meshing/61796-could-anyone-post-simple-cylinder-mesh.html)

otaolafr May 8, 2020 11:42

Quote:

Originally Posted by TanF (Post 769453)
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.

TanF May 8, 2020 13:02

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!

otaolafr May 8, 2020 14:50

Quote:

Originally Posted by TanF (Post 769484)
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

TanF May 8, 2020 15:20

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! 😐

guin May 9, 2020 09:19

Following alternative may be of interest for some visitors of this thread:

https://www.cfd-online.com/Forums/op...blockmesh.html

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!

HPE May 9, 2020 09:51

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/

Bloerb October 23, 2020 17:18

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

);



All times are GMT -4. The time now is 04:33.