|
[Sponsors] |
February 9, 2021, 14:06 |
Mesh defining with parameters
|
#1 | |
Member
|
Hi everyone,
I want to simulate a kind of tubular heat exchanger and prepared the mesh via blockmesh. Because of its symmetry I made the model as a wedge. Maybe this is irrelevant depending my question but I get the same warning for a change in the geometry setup. For some bigger angles I get the known (?) error below. Quote:
All constructive data are set as parameters in the first part of the blockMeshDict file. There comes the strange thing, I recognised that it is not a problem to do some calculation with the parametric setup but for the grading it is not possible. I did the grading as shown below according to this file: http://www.wolfdynamics.com/wiki/mes..._blockmesh.pdf Code:
hex (5 7 8 9 23 25 26 27) ($ZR3 $ZL2 1) simpleGrading // Block 3 Fluid ( ( //x-Achse ($BB $DD $EE) ($AA $CC 1) ($BB $DD $FF) ) ( //y-Achse 1; ) ( //z-Achse 1 ) ) At this time my blockMeshDict file looks like this and it works fine. But I would prefer to calculate the FF dependent on EE as shown in the commented lines: Code:
// Grading der Zellen, Ringspalt AA 0.2; // Anteil Kernbereich BB #calc "(1-$AA)/2"; // Bereich Grenzschicht CC 0.1; // Anteil Zellen Kernbereich DD #calc "(1-$CC)/2"; // Anteil Zellen Grenzschicht EE 4; // Grading Da FF 0.25; // FF #calc "(5-$EE)"; // Grading Di // FF #calc "pow ($EE, -1)"; // Grading Di - Berechnen geht nicht // FF #calc "1/($EE)"; // Grading Di - Berechnen geht nicht So far I realised in the last few attemts that the meshing works with values for EE<2. I have no problem setting one more parameter for FF but I would like to know why this calculation is not working in that intented use. Does anyone have a clue? Best regards Michael |
||
February 9, 2021, 15:43 |
|
#2 |
Senior Member
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 932
Rep Power: 12 |
I have no idea regarding the main question (my apologies), but please use `eval` instead of `calc` to gain considerable level of speed by avoiding compilations.
__________________
The OpenFOAM community is the biggest contributor to OpenFOAM: User guide/Wiki-1/Wiki-2/Code guide/Code Wiki/Journal Nilsson/Guerrero/Holzinger/Holzmann/Nagy/Santos/Nozaki/Jasak/Primer Governance Bugs/Features: OpenFOAM (ESI-OpenCFD-Trademark) Bugs/Features: FOAM-Extend (Wikki-FSB) Bugs: OpenFOAM.org How to create a MWE New: Forkable OpenFOAM mirror |
|
February 10, 2021, 02:29 |
|
#3 |
Senior Member
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 339
Rep Power: 28 |
I came across something similar, when creating wedge geometries along with inline calculation using blockMesh.
I could solve my problems by increasing the setting for writePrecision to 10 or higher. Note, that some mesh-generation or -processing tools will always write in ASCII, hence changing to writing in binary format will not always solve such issues. |
|
February 10, 2021, 15:15 |
|
#4 | ||
Member
|
Quote:
I tried a few variations but later I found out that this is not working with my Foundation version OF8. Nevertheless, this and some other features I'll try in a further upcoming case... Quote:
I tried but without success in my case. I'll keep it in mind but go on with setting the FF parameter. Enough other jobs at my first case so far... Best regards Michael |
|||
February 10, 2021, 15:20 |
|
#5 |
Senior Member
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 932
Rep Power: 12 |
Hi,
Would you consider to attach the blockMeshDict of yours, so that we can try to test it locally?
__________________
The OpenFOAM community is the biggest contributor to OpenFOAM: User guide/Wiki-1/Wiki-2/Code guide/Code Wiki/Journal Nilsson/Guerrero/Holzinger/Holzmann/Nagy/Santos/Nozaki/Jasak/Primer Governance Bugs/Features: OpenFOAM (ESI-OpenCFD-Trademark) Bugs/Features: FOAM-Extend (Wikki-FSB) Bugs: OpenFOAM.org How to create a MWE New: Forkable OpenFOAM mirror |
|
February 10, 2021, 15:33 |
|
#6 | |
Member
|
Quote:
Here it is: Code:
/*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 7 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object blockMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // R1 3; // ri Innenrohr x R2 4; // ra Innenrohr x R3 5; // ri Außenrohr x R4 6; // ra Außenrohr x L1 110; // Länge Innenrohr y L2 5; // Innenrohr bis Boden y L3 5; // Bodenstärke y W #calc "degToRad(0.00002)"; // Winkel für z // Zellen in Länge ZL1 500; // Zellen in L1 ZL2 30; // Zellen in L2 ZL3 10; // Zellen in L3 // Zellen Radial ZR1 20; // Innen ZR2 15; // Cu ZR3 30; // Ringspalt ZR4 10; // Cu // Grading der Zellen, Ringspalt AA 0.2; // Anteil Kernbereich BB #calc "(1-$AA)/2"; // Bereich Grenzschicht CC 0.1; // Anteil Zellen Kernbereich DD #calc "(1-$CC)/2"; // Anteil Zellen Grenzschicht EE 4; // Grading Da FF 0.25; // FF #calc "(5-$EE)""; // Grading Di // FF #calc "pow ($EE, -1)"; // Grading Di - Berechnen geht nicht // FF #calc "1/($EE)"; // Grading Di - Berechnen geht nicht // Grading der Zellen, Kupfer -> Ringspalt GG 10; // Alle benötigten Punkte: x0 0; y0 0; z0 0; x1 $R1; y1 0; z1 #calc "-1*sin($W)*$R1"; x2 $R1; y2 $L1; z2 $z1; x3 0; y3 $L1; z3 0; x4 $R2; y4 0; z4 #calc "-1*sin($W)*$R2"; x5 $R2; y5 $L1; z5 $z4; x6 $R3; y6 0; z6 #calc "-1*sin($W)*$R3"; x7 $R3; y7 $L1; z7 $z6; x8 $R3; y8 #calc "$L1+$L2"; z8 $z6; x9 $R2; y9 #calc "$L1+$L2"; z9 $z4; x10 $R1; y10 #calc "$L1+$L2"; z10 $z1; x11 0; y11 #calc "$L1+$L2"; z11 0; x12 $R4; y12 0; z12 #calc "-1*sin($W)*$R4"; x13 $R4; y13 $L1; z13 $z12; x14 $R4; y14 #calc "$L1+$L2"; z14 $z12; x15 $R4; y15 #calc "$L1+$L2+$L3"; z15 $z12; x16 $R3; y16 #calc "$L1+$L2+$L3"; z16 $z6; x17 $R2; y17 #calc "$L1+$L2+$L3"; z17 $z4; x18 $R1; y18 #calc "$L1+$L2+$L3"; z18 $z1; x19 0; y19 #calc "$L1+$L2+$L3"; z19 0; z20 #calc "-1*$z1"; z21 #calc "-1*$z2"; z22 #calc "-1*$z4"; z23 #calc "-1*$z5"; z24 #calc "-1*$z6"; z25 #calc "-1*$z7"; z26 #calc "-1*$z8"; z27 #calc "-1*$z9"; z28 #calc "-1*$z10"; z29 #calc "-1*$z12"; z30 #calc "-1*$z13"; z31 #calc "-1*$z14"; z32 #calc "-1*$z15"; z33 #calc "-1*$z16"; z34 #calc "-1*$z17"; z35 #calc "-1*$z18"; // Alle Zylinder geometry { Zyl_Boden { type searchableCylinder; point1 (0 $y11 0); point2 (0 $y18 0); radius $R4; } Zyl_R4 { type searchableCylinder; point1 (0 $y0 0); point2 (0 $y11 0); radius $R4; } Zyl_R3 { type searchableCylinder; point1 (0 $y0 0); point2 (0 $y11 0); radius $R3; } Zyl_R2 { type searchableCylinder; point1 (0 $y0 0); point2 (0 $y3 0); radius $R2; } Zyl_R1 { type searchableCylinder; point1 (0 $y0 0); point2 (0 $y3 0); radius $R1; } } vertices ( ($x0 $y0 $z0) // 0 ($x1 $y1 $z1) // 1 ($x2 $y2 $z2) // 2 ($x3 $y3 $z3) // 3 ($x4 $y4 $z4) // 4 ($x5 $y5 $z5) // 5 ($x6 $y6 $z6) // 6 ($x7 $y7 $z7) // 7 ($x8 $y8 $z8) // 8 ($x9 $y9 $z9) // 9 ($x10 $y10 $z10) // 10 ($x11 $y11 $z11) // 11 ($x12 $y12 $z12) // 12 ($x13 $y13 $z13) // 13 ($x14 $y14 $z14) // 14 ($x15 $y15 $z15) // 15 ($x16 $y16 $z16) // 16 ($x17 $y17 $z17) // 17 ($x18 $y18 $z18) // 18 ($x19 $y19 $z19) // 19 ($x1 $y1 $z20) // 20 ($x2 $y2 $z21) // 21 ($x4 $y4 $z22) // 22 ($x5 $y5 $z23) // 23 ($x6 $y6 $z24) // 24 ($x7 $y7 $z25) // 25 ($x8 $y8 $z26) // 26 ($x9 $y9 $z27) // 27 ($x10 $y10 $z28) // 28 ($x12 $y12 $z29) // 29 ($x13 $y13 $z30) // 30 ($x14 $y14 $z31) // 31 ($x15 $y15 $z32) // 32 ($x16 $y16 $z33) // 33 ($x17 $y17 $z34) // 34 ($x18 $y18 $z35) // 36 ); blocks ( hex (0 1 2 3 0 20 21 3) ($ZR1 $ZL1 1) simpleGrading (1 1 1) // Block 0 Fluid Innenrohr hex (3 2 10 11 3 21 28 11) ($ZR1 $ZL2 1) simpleGrading (1 1 1) // Block 1 Fluid Innenrohr hex (2 5 9 10 21 23 27 28) ($ZR2 $ZL2 1) simpleGrading (1 1 1) // Block 2 Fluid Innenrohr hex (5 7 8 9 23 25 26 27) ($ZR3 $ZL2 1) simpleGrading // Block 3 Fluid ( ( //x-Achse ($BB $DD $EE) ($AA $CC 1) ($BB $DD $FF) ) ( //y-Achse 1; ) ( //z-Achse 1 ) ) hex (4 6 7 5 22 24 25 23) ($ZR3 $ZL1 1) simpleGrading // Block 4 Fluid Wärmeaufnahme ( ( //x-Achse ($BB $DD $EE) ($AA $CC 1) ($BB $DD $FF) ) ( //y-Achse 1; ) ( //z-Achse 1 ) ) hex (1 4 5 2 20 22 23 21) ($ZR2 $ZL1 1) simpleGrading (1 1 1) // Block 5 Kupfer Innenrohr hex (6 12 13 7 24 29 30 25) ($ZR4 $ZL1 1) simpleGrading ($GG 1 1) // Block 6 Kupfer Innenrohr hex (7 13 14 8 25 30 31 26) ($ZR4 $ZL2 1) simpleGrading ($GG 1 1) // Block 7 Kupfer Innenrohr hex (8 14 15 16 26 31 32 33 ) ($ZR4 $ZL3 1) simpleGrading ($GG $GG 1) // Block 8 Kupfer Boden hex (9 8 16 17 27 26 33 34) ($ZR3 $ZL3 1) simpleGrading // Block 9 Kupfer Boden ( ( //x-Achse ($BB $DD $EE) ($AA $CC 1) ($BB $DD $FF) ) ( //y-Achse $GG ) ( //z-Achse 1 ) ) hex (10 9 17 18 28 27 34 35) ($ZR2 $ZL3 1) simpleGrading (1 $GG 1) // Block 10 Kupfer Boden hex (11 10 18 19 11 28 35 19) ($ZR1 $ZL3 1) simpleGrading (1 $GG 1) // Block 11 Kupfer Boden ); edges ( ); boundary ( // Achsensymmetrie symmetrie_front { type wedge; faces ( (0 1 2 3) (3 2 10 11) (2 5 9 10) (5 7 8 9) (4 6 7 5) (1 4 5 2) (6 12 13 7) (7 13 14 8) (8 14 15 16) (9 8 16 17) (10 9 17 18) (11 10 18 19) ); } symmetrie_back { type wedge; faces ( (0 20 21 3) (3 21 28 11) (21 23 27 28) (23 25 26 27) (22 24 25 23) (20 22 23 21) (24 29 30 25) (25 30 31 26) (26 31 32 33) (27 26 33 34) (28 27 34 35) (11 28 35 19) ); } inlet { type patch; faces ( (0 1 20 0) ); } outlet { type patch; faces ( (4 6 24 22) ); } HotSide { type patch; faces ( (14 15 31 32) (13 14 31 30) (12 13 30 29) ); } ); // ************************************************************************* // Thanks in advance, I have to leave for today but will be back latest at the weekend. Best regards Michael |
||
February 13, 2021, 13:40 |
|
#7 | ||||
Member
|
Hi everyone,
I tried to use the OF2012 version just to see if there is a difference to OF8. Strange things happened... I used the blockMeshDict file as listed above and OF2012 gave me this error: Quote:
Also checkMesh gave that reportings: Quote:
Gave me the very first warning as seen in the beginning of this thread: "Either correct the patch or split it into planar parts" checkMesh told me: Quote:
Meshing seems ok and only two mesh check failed with two reports as above: Quote:
I see that there are differences between OF8 and OF2012. This might be too many different steps listed but maybe this helps somebody... I tried this meshing with my laptop and will try the calculation on my other machine by next week. Am I right that the zero face and max skewness shouldn be a problem with the wedge type? Best regards Michael |
|||||
March 5, 2021, 16:45 |
|
#8 |
Member
Join Date: Jan 2017
Posts: 71
Rep Power: 9 |
Is it possible to introduce stretching through a formula in blockMesh. For example, introduce stretching through the attached expression.
Any hint how to do so? |
|
March 7, 2021, 13:31 |
|
#9 | |
Member
|
Quote:
At the moment I still have a similar problem with angles and the "asin" function. Maybe someone else has a hint? Best regards |
||
March 7, 2021, 14:12 |
|
#10 |
Member
Join Date: Jan 2017
Posts: 71
Rep Power: 9 |
I managed to introduce stretching, but not with blockMesh. But still facing a minor issue!
|
|
March 9, 2021, 11:54 |
|
#11 |
Member
|
Meanwhile I changed my workstyle to get the mesh for the calculation.
At the beginning I thought it is a good idea to do all the parametric calculation in the blockMesDict. Meanwhile I changed the calculation to Excel. I got my parametric values and depending on them I calculate the vertices. In the attached pic is an example. Beginning in line 13 I copy to paste in blockMesDict. For me this is easier to handle. Also debugging is easier. Maybe this helps some other users. Best reagrds, Michael Excel_Verticies.png |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[snappyHexMesh] Creating multiple multiple cell zones with snappyHexMesh - a newbie in deep water! | divergence | OpenFOAM Meshing & Mesh Conversion | 0 | January 23, 2019 04:17 |
[snappyHexMesh] SnappyHexMesh no layers and no decent mesh for complex geometry | pizzaspinate | OpenFOAM Meshing & Mesh Conversion | 1 | February 25, 2015 07:05 |
[Gmsh] 2D Mesh Generation Tutorial for GMSH | aeroslacker | OpenFOAM Meshing & Mesh Conversion | 12 | January 19, 2012 03:52 |
Convergence moving mesh | lr103476 | OpenFOAM Running, Solving & CFD | 30 | November 19, 2007 14:09 |
Icemcfd 11: Loss of mesh from surface mesh option? | Joe | CFX | 2 | March 26, 2007 18:10 |