
[Sponsors] 
February 16, 2012, 20:00 

#21 
New Member
mo houssami
Join Date: May 2011
Posts: 14
Rep Power: 8 
Sponsored Links
I took your examples and try to adapt it to my case, where i only have to make a simple cylinder that i need to mesh inside as regularly as possible. the first solution proposed doesn't work on my version of openFOAM, but the others do but its a bit tricky, since i'm still learning. If someone has an example of what i need, please post it. Anyway thank you very much, i learned a lot from this discussion. 

Sponsored Links 
February 20, 2012, 17:34 

#22 
New Member
mo houssami
Join Date: May 2011
Posts: 14
Rep Power: 8 
it's ok, i did it !


April 23, 2012, 03:21 

#23  
Member
anonymous
Join Date: Mar 2012
Posts: 45
Rep Power: 7 
Quote:
I have the same problem! Did you earned the mesh?? I'm new with the OPenFOAM and for me it's difficult to understand how it works the mesh generation. Thanks! 

April 23, 2012, 06:43 

#24 
Senior Member
cfdkid
Join Date: Mar 2009
Posts: 133
Rep Power: 10 
@libia87
OpenFOAM mesh how does it work? This is a broad question, and really depends on the problem you are solving. So, Plz discribe your problem. Note: OpenFOAM mesh making module has two major blocks. 1. blockMesh // this generate basic structured mesh for domain to be considered. 2. snappyHexMesh // This generates fine mesh for boundary ex a CAR or Cylinder. Also consider a cylinder placed in regular domain. If you want to mesh inside the cylnder domain Use following Patch in snappyHexMeshDict::castellatedMeshControls refinementSurfaces { myCylinder // user defined cylinder { level (2 2); faceZone cylinder; cellZone cylinder; zoneInside true; // inside or ZoneOutside for outer mesh } } . Also it is best you state your model. It will be much easier for us. regards CFDkid 

April 24, 2012, 09:05 

#25 
Senior Member

Hi,
blockmesh and snappyhexmesh are the two meshing programs that are included into OpemFoam. If you install Engrid you have another opensource mesher. With pyFoamDisplayBlockMesh.py an external program (you could visualize your blockmesh) => http://openfoamwiki.net/index.php/Co...m#Installation There are commercial mesher that can export directly as OF (ANSA, Hypermesh, Pointwise, CastNet) 

July 24, 2012, 09:55 

#26 
New Member
P.M.Bronow
Join Date: Nov 2009
Location: Poland/Germany
Posts: 14
Rep Power: 9 
Hi,
has anyone tried to run script provided by Rasmus with the OF 2.0.1? I get an error when I try to run the blockMesh on blockMeshDict created after execution of the m4 script. blockMeshDict can be seen below. This is what I get after executing Rasmus's script: /** C++ **\  =========    \\ / F ield  OpenFOAM: The Open Source CFD Toolbox   \\ / O peration  Version: 2.0.1   \\ / A nd  Web: http://www.OpenFOAM.org   \\/ M anipulation   \**/ FoamFile { version 2.0; format ascii; class dictionary; object blockMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // convertToMeters 0.001; //5 mm column diameter //10 cm length //Width of middle square section //how many cells in the square section //how many cells from square section to perimeter // how many cells from top to bottom vertices ( ( 1.25 0.0 1.25) // Vertex fiveoclocksqb = 0 (1.25 0.0 1.25) // Vertex sevenoclocksqb = 1 (1.25 0.0 1.25) // Vertex elevenoclocksqb = 2 ( 1.25 0.0 1.25) // Vertex oneoclocksqb = 3 ( 1.76776695455285 0.0 1.76776695137989) // Vertex fiveoclockcb = 4 (1.76776695455285 0.0 1.76776695137989) // Vertex sevenoclockcb = 5 (1.76776695455285 0.0 1.76776695137989) // Vertex elevenoclockcb = 6 ( 1.76776695455285 0.0 1.76776695137989) // Vertex oneoclockcb = 7 ( 1.25 100 1.25) // Vertex fiveoclocksqt = 8 (1.25 100 1.25) // Vertex sevenoclocksqt = 9 (1.25 100 1.25) // Vertex elevenoclocksqt = 10 ( 1.25 100 1.25) // Vertex oneoclocksqt = 11 ( 1.76776695455285 100 1.76776695137989) // Vertex fiveoclockct = 12 (1.76776695455285 100 1.76776695137989) // Vertex sevenoclockct = 13 (1.76776695455285 100 1.76776695137989) // Vertex elevenoclockct = 14 ( 1.76776695455285 100 1.76776695137989) // Vertex oneoclockct = 15 ); blocks ( //square block hex ( 1 0 3 2 9 8 11 10 ) (3 3 10) simpleGrading (1 1 1) //slice1 hex ( 5 4 0 1 13 12 8 9 ) (3 3 10) simpleGrading (1 1 1) //slice2 hex ( 1 2 6 5 9 10 14 13 ) (3 3 10) simpleGrading (1 1 1) //slice3 hex ( 2 3 7 6 10 11 15 14 ) (3 3 10) simpleGrading (1 1 1) //slice4 hex ( 3 0 4 7 11 8 12 15 ) (3 3 10) simpleGrading (1 1 1) ); //create the quarter circles edges ( arc 4 5 (0.0 0.0 2.5) arc 5 6 (2.5 0.0 0.0) arc 6 7 (0.0 0.0 2.5) arc 7 4 (2.5 0.0 0.0) arc 12 13 (0.0 100 2.5) arc 13 14 (2.5 100 0.0) arc 14 15 (0.0 100 2.5) arc 15 12 (2.5 100 0.0) ); patches ( patch outlet ( (2 4(0 3 2 1)) (2 4(0 4 7 3)) (2 4(4 0 1 5)) (2 4(1 2 6 5)) (2 4(3 7 6 2)) ) patch inlet ( (2 4(8 11 10 9)) (2 4(8 12 15 11)) (2 4(12 8 9 13)) (2 4(9 10 14 13)) (2 4(11 15 14 10)) ) wall walls ( (2 4(5 4 12 13)) (2 4(5 13 14 6)) (2 4(6 14 15 7)) (2 4(7 15 12 4)) ) ); mergePatchPairs ( ); 

July 28, 2012, 09:55 

#27  
Member
Adam
Join Date: Jun 2011
Posts: 32
Rep Power: 8 
PrzemekPL,
I believe it has to do with a change in the way that patches are now defined. Rename the attached version to .m4 and use the same method that hemph described: Quote:
Smed 

July 30, 2012, 03:36 

#28 
New Member
P.M.Bronow
Join Date: Nov 2009
Location: Poland/Germany
Posts: 14
Rep Power: 9 
Smed,
you were right. There was an issue with the patches definition, i.e. : (2 4(fiveoclocksqb oneoclocksqb elevenoclocksqb sevenoclocksqb)) Now, everything works, thanks! 

December 12, 2012, 11:59 

#29 
New Member
Burak
Join Date: Nov 2012
Posts: 5
Rep Power: 6 
Hello
Here is my small contrubution to the forum.I modified the cylindermesher.m4 file to have the Z direction passing through the middle. I wanted to have arced inlet conditions for the turbinsiting tutorial so I modified the skript somebodyposted in this thread(Thanks!). So maybe somebody needs this version also.Just rename the file to cylindermesher.m4 and use it(You have to have the m4 preprocessor installed).I hope this helps. My Regards Burak 

May 7, 2013, 11:17 

#30  
New Member
Álex de Sousa Vieira
Join Date: Apr 2013
Posts: 2
Rep Power: 0 
Quote:
I'm trying to do basically the same mesh from this problem but using openfoam 2.1.1 and all the examples posted aren't working. Using the mesh generated from the file posted from Burak_1984 i get the blockMesh but when i try to see it on paraFoam the following error appears: > FOAM FATAL IO ERROR: keyword outlet is undefined in dictionary "/home/lest/Downloads/C1/0/p::boundaryField" file: /home/lest/Downloads/C1/0/p::boundaryField from line 25 to line 35. From function dictionary::subDict(const word& keyword) const in file db/dictionary/dictionary.C at line 461. FOAM exiting Can anyone help me? Last edited by ÁlexVieira; May 7, 2013 at 12:02. 

September 13, 2013, 04:34 

#31  
New Member
Benjamin van den Akker
Join Date: Jun 2013
Posts: 3
Rep Power: 6 
Quote:
Quote:


February 26, 2016, 05:20 
create cylineder mesh by collapsing one edge

#32 
Member
Dr Sachin Borse
Join Date: Oct 2011
Location: Pune, Republic of India
Posts: 46
Rep Power: 7 
Dear all,
First make block. Collapse one side. Use arc for one side in block. Preapre mesh for half cylivder. see fig halfcyl. create blockmesh. use feature mirrorMesh by keeping and editing file mirrorMeshDict in system. See cylinder made in fig. fullcyl. Regards Dr Sachin Borse 

March 25, 2016, 08:45 

#33  
New Member
Steve
Join Date: Sep 2012
Location: Perth, Australia
Posts: 17
Rep Power: 6 
Quote:
Seems that some syntax has changed... Thanks 

October 10, 2016, 22:24 
Error in blockMeshDict

#34  
New Member
UHGAR
Join Date: Sep 2016
Posts: 9
Rep Power: 2 
Hi Foamers,
I am very new to OpenFoam and I have modified the codes posted by the members in this thread as follows. Code:
/**\  =========    \ / F ield  OpenFOAM: The Open Source CFD Toolbox   \ / O peration  Version: 1.3   \ / A nd  Web: http://www.openfoam.org   \/ M anipulation   \**/ FoamFile { version 2.0; format ascii; root ""; case ""; instance ""; local ""; class dictionary; object blockMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * *// //meshGenApp blockMesh; convertToMeters 0.001; r 2.2; // Radius of Inlet R #calc "20*$r"; // Domain radius Inlet_z 11; // Inlet from origin (ve) Outlet_z 110; // Outlet distance from origin halfAngle 45.0; // Fixed angle for midpoint radHalfAngle #calc "degToRad($halfAngle)"; mid_c1 #calc "$r*sin($radHalfAngle)"; // Midpoint for Inner cylinder arc mid_c2 #calc "$R*sin($radHalfAngle)"; // Midpoint for Outer cylinder arc vertices ( ( $r #calc"1*$r" #calc "1*$Inlet_z") //0 ( $r $r #calc "1*$Inlet_z") (#calc"1*$r" $r #calc "1*$Inlet_z") (#calc"1*$r" #calc"1*$r" #calc "1*$Inlet_z") ( $r #calc"1*$r" 0) //4 ( $r $r 0) (#calc"1*$r" $r 0) (#calc"1*$r" #calc"1*$r" 0) ( $R #calc"1*$R" 0) //8 ( $R $R 0) (#calc"1*$R" $R 0) (#calc"1*$R" #calc"1*$R" 0) ( $R #calc"1*$R" $Outlet_z) //12 ( $R $R $Outlet_z) (#calc"1*$R" $R $Outlet_z) (#calc"1*$R" #calc"1*$R" $Outlet_z) ( $r #calc"1*$r" $Outlet_z) //16 ( $r $r $Outlet_z) (#calc"1*$r" $r $Outlet_z) (#calc"1*$r" #calc"1*$r" $Outlet_z) ); blocks ( hex (0 1 2 3 4 5 6 7) (10 10 10) simpleGrading (1 1 1) hex (4 5 6 7 16 17 18 19) (10 10 10) simpleGrading (1 1 1) hex (10 6 5 9 14 18 17 13) (10 10 10) simpleGrading (1 1 1) hex (11 7 6 10 15 19 18 14) (10 10 10) simpleGrading (1 1 1) hex (8 4 7 11 12 16 19 15) (10 10 10) simpleGrading (1 1 1) hex (9 5 4 8 13 17 16 12) (10 10 10) simpleGrading (1 1 1) ); edges ( arc 2 1 (0.0 $mid_c1 #calc "1*$Inlet_z") arc 1 0 ($mid_c1 0.0 #calc "1*$Inlet_z") arc 0 3 (0.0 #calc"1*$mid_c1" #calc "1*$Inlet_z") arc 3 2 (#calc"1*$mid_c1" 0.0 #calc "1*$Inlet_z") arc 6 5 (0.0 $mid_c1 0) arc 5 4 ($mid_c1 0.0 0) arc 4 7 (0.0 #calc"1*$mid_c1" 0) arc 7 6 (#calc"1*$mid_c1" 0.0 0) arc 10 9 (0.0 $mid_c2 0.0) arc 9 8 ($mid_c2 0.0 0.0) arc 8 11 (0.0 #calc"1*$mid_c2" 0.0) arc 11 10 (#calc"1*$mid_c2" 0.0 0.0) arc 18 17 (0.0 $mid_c2 $Outlet_z) arc 17 16 ($mid_c2 0.0 $Outlet_z) arc 16 19 (0.0 #calc"1*$mid_c2" $Outlet_z) arc 19 18 (#calc"1*$mid_c2" 0.0 $Outlet_z) arc 14 13 (0.0 $mid_c2 $Outlet_z) arc 13 12 ($mid_c2 0.0 $Outlet_z) arc 12 15 (0.0 #calc"1*$mid_c2" $Outlet_z) arc 15 14 (#calc"1*$mid_c2" 0.0 $Outlet_z) ); boundary ( Inlet { type patch; faces ( (0 3 2 1) ); } Outlet { type patch; faces ( (16 17 18 19) (17 13 14 18) (18 14 15 19) (12 16 19 15) (12 13 17 16) ); } Wall { type patch; faces ( (0 1 5 4) (5 1 2 6) (3 7 6 2) (7 11 10 6) (10 9 5 6) (9 8 4 5) (9 13 12 8) (12 15 11 8) (15 14 10 11) (14 13 9 10) ); } ); Quote:


October 11, 2016, 02:57 

#35 
Senior Member
Join Date: Aug 2013
Posts: 292
Rep Power: 6 
Hi,
Have you visualized your mesh? There seems to be something wrong with your mesh if your maximum aspect ratio is 0. Check that the mesh is the type you want before proceeding further. Cheers, Antimony 

October 11, 2016, 22:41 

#36 
New Member
UHGAR
Join Date: Sep 2016
Posts: 9
Rep Power: 2 
Hi Antimony,
Thanks for your reply, I got it. I have corrected the script as follows. Code:
/**\  =========    \ / F ield  OpenFOAM: The Open Source CFD Toolbox   \ / O peration  Version: 1.3   \ / A nd  Web: http://www.openfoam.org   \/ M anipulation   \**/ FoamFile { version 2.0; format ascii; root ""; case ""; instance ""; local ""; class dictionary; object blockMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * *// //meshGenApp blockMesh; convertToMeters 0.001; r 1.1; // Radius of Inlet (mm) R #calc "20*$r"; // Domain radius (mm) Inlet_z_1 80; // Inlet1 from origin (ve) (mm) Inlet_z_2 10; // Inlet2 (exit of inlet1) from origin (ve) (mm) Outlet_z 110; // Outlet distance from origin (mm) halfAngle 45.0; // Fixed angle for midpoint radHalfAngle #calc "degToRad($halfAngle)"; mid_c1 #calc "$r/sin($radHalfAngle)"; // Midpoint for Inner cylinder arc mid_c2 #calc "$R/sin($radHalfAngle)"; // Midpoint for Outer cylinder arc vertices ( ( $r #calc"1*$r" #calc "1*$Inlet_z_1") //0 ( $r $r #calc "1*$Inlet_z_1") (#calc"1*$r" $r #calc "1*$Inlet_z_1") (#calc"1*$r" #calc"1*$r" #calc "1*$Inlet_z_1") ( $r #calc"1*$r" #calc "1*$Inlet_z_2") //4 ( $r $r #calc "1*$Inlet_z_2") (#calc"1*$r" $r #calc "1*$Inlet_z_2") (#calc"1*$r" #calc"1*$r" #calc "1*$Inlet_z_2") ( $r #calc"1*$r" 0) //8 ( $r $r 0) (#calc"1*$r" $r 0) (#calc"1*$r" #calc"1*$r" 0) ( $R #calc"1*$R" 0) //12 ( $R $R 0) (#calc"1*$R" $R 0) (#calc"1*$R" #calc"1*$R" 0) ( $r #calc"1*$r" $Outlet_z) //16 ( $r $r $Outlet_z) (#calc"1*$r" $r $Outlet_z) (#calc"1*$r" #calc"1*$r" $Outlet_z) ( $R #calc"1*$R" $Outlet_z) //20 ( $R $R $Outlet_z) (#calc"1*$R" $R $Outlet_z) (#calc"1*$R" #calc"1*$R" $Outlet_z) ); blocks ( hex (0 1 2 3 4 5 6 7) (20 20 80) simpleGrading (1 1 1) hex (4 5 6 7 8 9 10 11) (20 20 10) simpleGrading (1 1 1) hex (8 9 10 11 16 17 18 19) (20 20 80) simpleGrading (1 1 1) hex (14 10 9 13 22 18 17 21) (40 20 80) simpleGrading (0.5 1 1) hex (15 11 10 14 23 19 18 22) (40 20 80) simpleGrading (0.5 1 1) hex (12 8 11 15 20 16 19 23) (40 20 80) simpleGrading (0.5 1 1) hex (13 9 8 12 21 17 16 20) (40 20 80) simpleGrading (0.5 1 1) ); edges ( arc 2 1 (0.0 $mid_c1 #calc "1*$Inlet_z_1") arc 1 0 ($mid_c1 0.0 #calc "1*$Inlet_z_1") arc 0 3 (0.0 #calc"1*$mid_c1" #calc "1*$Inlet_z_1") arc 3 2 (#calc"1*$mid_c1" 0.0 #calc "1*$Inlet_z_1") arc 6 5 (0.0 $mid_c1 #calc "1*$Inlet_z_2") arc 5 4 ($mid_c1 0.0 #calc "1*$Inlet_z_2") arc 4 7 (0.0 #calc"1*$mid_c1" #calc "1*$Inlet_z_2") arc 7 6 (#calc"1*$mid_c1" 0.0 #calc "1*$Inlet_z_2") arc 10 9 (0.0 $mid_c1 0.0 ) arc 9 8 ($mid_c1 0.0 0.0 ) arc 8 11 (0.0 #calc"1*$mid_c1" 0.0 ) arc 11 10(#calc"1*$mid_c1" 0.0 0.0 ) arc 14 13(0.0 $mid_c2 0.0 ) arc 13 12($mid_c2 0.0 0.0 ) arc 12 15(0.0 #calc"1*$mid_c2" 0.0 ) arc 15 14(#calc"1*$mid_c2" 0.0 0.0 ) arc 18 17(0.0 $mid_c1 $Outlet_z ) arc 17 16($mid_c1 0.0 $Outlet_z ) arc 16 19(0.0 #calc"1*$mid_c1" $Outlet_z ) arc 19 18(#calc"1*$mid_c1" 0.0 $Outlet_z ) arc 22 21(0.0 $mid_c2 $Outlet_z ) arc 21 20($mid_c2 0.0 $Outlet_z ) arc 20 23 (0.0 #calc"1*$mid_c2" $Outlet_z ) arc 23 22 (#calc"1*$mid_c2" 0.0 $Outlet_z ) ); boundary ( Inlet { type patch; faces ( (0 3 2 1) ); } Outlet { type patch; faces ( (16 17 18 19) (17 21 22 18) (18 22 23 19) (20 16 19 23) (20 21 17 16) ); } Walls { type wall; faces ( (0 1 5 4) (1 2 6 5) (2 3 7 6) (3 0 4 7) (4 5 9 8) (5 6 10 9) (6 7 11 10) (7 4 8 11) (8 12 15 11) (11 15 14 10) (10 14 13 9) (9 13 12 8) (12 13 21 20) (15 12 20 23) (14 15 23 22) (13 14 22 21) ); } ); mergePatchPairs ( ); /* patches ( patch inlet ( (0 3 2 1) ) patch outlet ( (16 17 18 19) (17 21 22 18) (18 22 23 19) (20 16 19 23) (20 21 17 16) ) ); mergePatchPairs ( ); 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
3d mesh gambit (cylinder within a cylinder)  Jason  ANSYS Meshing & Geometry  29  October 30, 2015 09:59 
Cylinder mesh help to fix it  guilherme  OpenFOAM Native Meshers: blockMesh  2  December 6, 2010 11:44 
Simple postprocessing question: velcoity profile  Svetlana Nosedung  FLUENT  1  May 8, 2006 14:35 
Recommend software for simple post processing  zonexo  Main CFD Forum  5  March 4, 2006 04:20 
simple postprocessing question  Jimmy  FLUENT  0  January 23, 2006 08:42 
Sponsored Links 