hi all,
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. :D |
it's ok, i did it ! :cool:
|
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! |
@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 |
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) |
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 ( ); |
1 Attachment(s)
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 |
Smed,
you were right. There was an issue with the patches definition, i.e. : (2 4(fiveoclocksqb oneoclocksqb elevenoclocksqb sevenoclocksqb)) Now, everything works, thanks! |
1 Attachment(s)
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 |
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? |
1 Attachment(s)
Quote:
Quote:
|
create cylineder mesh by collapsing one edge
2 Attachment(s)
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 |
Quote:
Seems that some syntax has changed... Thanks |
Error in blockMeshDict
Hi Foamers,
I am very new to OpenFoam and I have modified the codes posted by the members in this thread as follows. Code:
/*-----------------------------------------------------*\ Quote:
|
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 |
Hi Antimony,
Thanks for your reply, I got it. I have corrected the script as follows. Code:
/*-----------------------------------------------------*\ |
Update for OpenFOAM V5
He everyone there have been some updates to OpenFOAM since this was last posted I updated the .m4 file for the the version 5.
Paste in a text file and see under extension .m4: /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 5.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "constant/polyMesh"; object blockMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // changecom(//)changequote([,]) define(calc, [esyscmd(perl -e 'printf ($1)')]) define(VCOUNT, 0) define(vlabel, [[// ]Vertex $1 = VCOUNT define($1, VCOUNT)define([VCOUNT], incr(VCOUNT))]) meshGenApp blockMesh; convertToMeters 0.001; define(D, 10) //10 mm column diameter define(L, 500) //50 cm length define(PI, 3.14159265) define(R, calc(D/2)) define(CW, calc(D/4)) //Width of middle square section define(CX, calc(R*cos((PI/180)*45))) define(CZ, calc(R*sin((PI/180)*45))) define(NPS, 50) // how many cells in width of square section define(NPD, 50) // how many cells from square section edge to perimeter of cylinder define(NPY, 50) // how many cells from top to bottom vertices ( ( CW 0.0 CW) vlabel(fiveoclocksqb) (-CW 0.0 CW) vlabel(sevenoclocksqb) (-CW 0.0 -CW) vlabel(elevenoclocksqb) ( CW 0.0 -CW) vlabel(oneoclocksqb) ( CX 0.0 CZ) vlabel(fiveoclockcb) (-CX 0.0 CZ) vlabel(sevenoclockcb) (-CX 0.0 -CZ) vlabel(elevenoclockcb) ( CX 0.0 -CZ) vlabel(oneoclockcb) ( CW L CW) vlabel(fiveoclocksqt) (-CW L CW) vlabel(sevenoclocksqt) (-CW L -CW) vlabel(elevenoclocksqt) ( CW L -CW) vlabel(oneoclocksqt) ( CX L CZ) vlabel(fiveoclockct) (-CX L CZ) vlabel(sevenoclockct) (-CX L -CZ) vlabel(elevenoclockct) ( CX L -CZ) vlabel(oneoclockct) ); blocks ( //square block hex ( sevenoclocksqb fiveoclocksqb oneoclocksqb elevenoclocksqb sevenoclocksqt fiveoclocksqt oneoclocksqt elevenoclocksqt ) (NPS NPS NPY) simpleGrading (1 1 1) //slice1 hex ( sevenoclockcb fiveoclockcb fiveoclocksqb sevenoclocksqb sevenoclockct fiveoclockct fiveoclocksqt sevenoclocksqt ) (NPS NPD NPY) simpleGrading (1 1 1) //slice2 hex ( sevenoclocksqb elevenoclocksqb elevenoclockcb sevenoclockcb sevenoclocksqt elevenoclocksqt elevenoclockct sevenoclockct ) (NPS NPD NPY) simpleGrading (1 1 1) //slice3 hex ( elevenoclocksqb oneoclocksqb oneoclockcb elevenoclockcb elevenoclocksqt oneoclocksqt oneoclockct elevenoclockct ) (NPS NPD NPY) simpleGrading (1 1 1) //slice4 hex ( oneoclocksqb fiveoclocksqb fiveoclockcb oneoclockcb oneoclocksqt fiveoclocksqt fiveoclockct oneoclockct ) (NPS NPD NPY) simpleGrading (1 1 1) ); //create the quarter circles edges ( arc fiveoclockcb sevenoclockcb (0.0 0.0 R) arc sevenoclockcb elevenoclockcb (-R 0.0 0.0) arc elevenoclockcb oneoclockcb (0.0 0.0 -R) arc oneoclockcb fiveoclockcb (R 0.0 0.0) arc fiveoclockct sevenoclockct (0.0 L R) arc sevenoclockct elevenoclockct (-R L 0.0) arc elevenoclockct oneoclockct (0.0 L -R) arc oneoclockct fiveoclockct (R L 0.0) ); boundary ( outlet { type patch; faces ( (fiveoclocksqb oneoclocksqb elevenoclocksqb sevenoclocksqb) (fiveoclocksqb fiveoclockcb oneoclockcb oneoclocksqb) (fiveoclockcb fiveoclocksqb sevenoclocksqb sevenoclockcb) (sevenoclocksqb elevenoclocksqb elevenoclockcb sevenoclockcb) (oneoclocksqb oneoclockcb elevenoclockcb elevenoclocksqb) ); } inlet { type patch; faces ( (fiveoclocksqt oneoclocksqt elevenoclocksqt sevenoclocksqt) (fiveoclocksqt fiveoclockct oneoclockct oneoclocksqt) (fiveoclockct fiveoclocksqt sevenoclocksqt sevenoclockct) (sevenoclocksqt elevenoclocksqt elevenoclockct sevenoclockct) (oneoclocksqt oneoclockct elevenoclockct elevenoclocksqt) ); } walls { type wall; faces ( (sevenoclockcb fiveoclockcb fiveoclockct sevenoclockct) (sevenoclockcb sevenoclockct elevenoclockct elevenoclockcb) (elevenoclockcb elevenoclockct oneoclockct oneoclockcb) (oneoclockcb oneoclockct fiveoclockct fiveoclockcb) ); } ); // ************************************************** *********************** // |
Here is a pipe mesh done with OpenFOAM-dev and the #calc function. As well as the new methods to adress patches via their block and face number. Also naming the points etc is used. The values 0.278 and 0.35 are chosen in such a way, that the non orthogonality and skewness of the resulting mesh is optimal for the current mesh size. It also features an additional outer region for increased resolution of the boundary layer.
Code:
/*--------------------------------*- C++ -*----------------------------------*\ |
1/4 of pipe with blockmesh
hello,
i am fairly new with OpenFOAM and well, the preprocessing is a little bit complicated, OF it is super powerfull as software but a little bit complicated to get the hand on it.... i wanted to do a 1/4 of a cylinder with blockmesh, is it possible to do the blockmesh with polyhedral cells for the mesh? also how can i define a simple quarter of cylinder, i found some examples in the comments of a cylinder but it was difficult to follow them.... i wanted to finish with something where i can define the R and the lenght of the hight in Z with the 5 different patches defined... |
3 Attachment(s)
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! |
All times are GMT -4. The time now is 23:14. |