View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003580 | OpenFOAM | Bug | public | 2020-10-21 03:51 | 2020-10-23 11:31 |
Reporter | Beginning OpenFOAM | Assigned To | henry | ||
Priority | immediate | Severity | major | Reproducibility | sometimes |
Status | closed | Resolution | no change required | ||
Platform | GNU/Linux | OS | Ubuntu | OS Version | 18.04 LTS |
Summary | 0003580: Directions echange in number of cells input area | ||||
Description | To me, this is odd and likely a bug. I used pointField.H to build my full cylinder points. I got the following error: 'FOAM FATAL ERROR : Inconsistent number of faces between block pair 0 and 10' Seemed my meshing wasn't matching up. With that said, I was confident I was correctly specifying the right number of cells for (x y z). I found that the top half of my geometry hex blocks were normal: hex (0 1 2 3 4 5 6 7) (x y z) simpleGrading (1 1 1). I found that my bottom half of geometry was abnormal: hex (0 1 2 3 4 5 6 7) (y x z) simpleGrading (1 1 1). Notice, the number of cells exchanged. | ||||
Steps To Reproduce | Download case files and run: >foamCleanTutorials >foamCleanPolyMesh >blockMesh Open system/blockMeshDict and read the comments under hex blocks. | ||||
Additional Information | This happened one other time, but it switched back. I don't know why. | ||||
Tags | No tags attached. | ||||
|
blockMeshDict (6,927 bytes)
/*--------------------------------*- 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; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // convertToMeters 1; vertices #codeStream { codeInclude #{ #include "pointField.H" #}; code #{ pointField points(19); points[0] = point(-35, 0, 0); points[1] = point(9, 0, 0); points[2] = point(10, 0, 0); points[3] = point(12, 0, 0); points[4] = point(13, 0, 0); points[5] = point(115, 0, 0); points[6] = point(-35, 1.4142136, 0); points[7] = point(9.5857864, 1.4142136, 0); points[8] = point(11, 2, 0); points[9] = point(12.4142136, 1.4142136, 0); points[10] = point(115, 1.4142136, 0); points[11] = point(-35, 50, 0); points[12] = point(9.5857864, 50, 0); points[13] = point(11, 50, 0); points[14] = point(12.4142136, 50, 0); points[15] = point(115, 50, 0); points[16] = point(10.292893, 0.707107, 0); points[17] = point(11, 1, 0); points[18] = point(11.707107, 0.707107, 0); // Duplicate z points label sz = points.size(); points.setSize(2*sz); for (label i = 0; i < sz; i++) { const point& pt = points[i]; points[i+sz] = point(pt.x(), pt.y(), pt.z()+2); } //Mirror above geometry in the -y direction label my = points.size(); points.setSize(2*my); for (label i = 6; i < my; i++) { if (i < 19) { const point& pt = points[i]; points[i+(my-6)] = point(pt.x(), -pt.y(), pt.z()); } if (i > 24 && i < 38) { const point& pt = points[i]; points[i+26] = point(pt.x(), -pt.y(), pt.z()); } } //Print points for ( label k = 0; k < 2*my-12; k++) { Info << "This is point:" << k << points[k] << endl; } os << points; #}; }; blocks ( //Normal cell numbering of (x y z): hex (0 1 7 6 19 20 26 25) (10 25 1) simpleGrading (1 1 1)//1 hex (1 2 16 7 20 21 35 26) (10 25 1) simpleGrading (1 1 1)//2 hex (7 16 17 8 26 35 36 27) (10 25 1) simpleGrading (1 1 1)//3 hex (8 17 18 9 27 36 37 28) (10 25 1) simpleGrading (1 1 1)//4 hex (3 4 9 18 22 23 28 37) (10 25 1) simpleGrading (1 1 1)//5 hex (4 5 10 9 23 24 29 28) (10 25 1) simpleGrading (1 1 1)//6 hex (6 7 12 11 25 26 31 30) (10 10 1) simpleGrading (1 1 1)//7 hex (7 8 13 12 26 27 32 31) (25 10 1) simpleGrading (1 1 1)//8 hex (8 9 14 13 27 28 33 32) (25 10 1) simpleGrading (1 1 1)//9 hex (9 10 15 14 28 29 34 33) (10 10 1) simpleGrading (1 1 1)//10 //Abnormal cell numbering of (y x z) : hex (0 38 39 1 19 51 52 20) (25 10 1) simpleGrading (1 1 1)//11 hex (1 39 48 2 20 52 61 21) (25 10 1) simpleGrading (1 1 1)//12 hex (39 40 49 48 52 53 62 61) (25 10 1) simpleGrading (1 1 1)//13 hex (40 41 50 49 53 54 63 62) (25 10 1) simpleGrading (1 1 1)//14 hex (3 50 41 4 22 63 54 23) (25 10 1) simpleGrading (1 1 1)//15 hex (4 41 42 5 23 54 55 24) (25 10 1) simpleGrading (1 1 1)//16 hex (38 43 44 39 51 56 57 52) (10 10 1) simpleGrading (1 1 1)//17 hex (39 44 45 40 52 57 58 53) (10 25 1) simpleGrading (1 1 1)//18 hex (40 45 46 41 53 58 59 54) (10 25 1) simpleGrading (1 1 1)//19 hex (41 46 47 42 54 59 60 55) (10 10 1) simpleGrading (1 1 1)//20 ); edges ( arc 1 7 (9.1522409 0.76536686 0)//1 arc 7 8 (10.234633 1.8477591 0)//2 arc 8 9 (11.765367 1.8477591 0)//3 arc 9 4 (12.847759 0.76536686 0)//4 arc 2 16 (10.076120 0.38268343 0)//5 arc 16 17 (10.617317 0.92387953 0)//6 arc 17 18 (11.382683 0.92387953 0)//7 arc 18 3 (11.923880 0.38268343 0)//8 arc 20 26 (9.1522409 0.76536686 2)//9 arc 26 27 (10.234633 1.8477591 2)//10 arc 27 28 (11.765367 1.8477591 2)//11 arc 28 23 (12.847759 0.76536686 2)//12 arc 21 35 (10.076120 0.38268343 2)//13 arc 35 36 (10.617317 0.92387953 2)//14 arc 36 37 (11.382683 0.92387953 2)//15 arc 37 22 (11.923880 0.38268343 2)//16 //bottom geometry arc 1 39 (9.1522409 -0.76536686 0)//17 arc 39 40 (10.234633 -1.8477591 0)//18 arc 40 41 (11.765367 -1.8477591 0)//19 arc 41 4 (12.847759 -0.76536686 0)//20 arc 2 48 (10.076120 -0.38268343 0)//21 arc 48 49 (10.617317 -0.92387953 0)//22 arc 49 50 (11.382683 -0.92387953 0)//23 arc 50 3 (11.923880 -0.38268343 0)//24 arc 20 52 (9.1522409 -0.76536686 2)//25 arc 52 53 (10.234633 -1.8477591 2)//26 arc 53 54 (11.765367 -1.8477591 2)//27 arc 54 23 (12.847759 -0.76536686 2)//28 arc 21 61 (10.076120 -0.38268343 2)//29 arc 61 62 (10.617317 -0.92387953 2)//30 arc 62 63 (11.382683 -0.92387953 2)//31 arc 63 22 (11.923880 -0.38268343 2)//32 ); boundary ( bottomWall { type symmetry; faces ( (43 44 57 56) (44 45 58 57) (45 46 59 58) (46 47 60 59) ); } outlet { type patch; faces ( (10 15 34 29) (5 10 29 24) (5 24 55 42) (42 55 60 47) ); } topWall { type symmetry; faces ( (11 30 31 12) (12 31 32 13) (13 32 33 14) (14 33 34 15) ); } inlet { type patch; faces ( (6 25 30 11) (0 19 25 6) (0 38 51 19) (38 43 56 51) ); } cylinder { type wall; faces ( (2 16 35 21) (16 17 36 35) (17 18 37 36) (3 22 37 18) (2 21 61 48) (48 61 62 49) (49 62 63 50) (3 50 63 22) ); } frontandBack { type empty; faces ( //back (0 6 7 1) (1 7 16 2) (7 8 17 16) (8 9 18 17) (3 18 9 4) (4 9 10 5) (6 11 12 7) (7 12 13 8) (8 13 14 9) (9 14 15 10) //(1 2 48 39) //front (19 20 26 25) (20 21 35 26) (26 35 36 27) (27 36 37 28) (22 23 28 37) (23 24 29 28) (25 26 31 30) (26 27 32 31) (27 28 33 32) (28 29 34 33) ); } ); mergePatchPairs ( ); // ************************************************************************* // |
|
controlDict (3,818 bytes)
/*--------------------------------*- 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; location "system"; object controlDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // application potentialFoam; startFrom latestTime; startTime 0; stopAt nextWrite; endTime 1; deltaT 1; writeControl timeStep; writeInterval 1; purgeWrite 0; writeFormat ascii; writePrecision 6; writeCompression off; timeFormat general; timePrecision 6; runTimeModifiable true; functions { error { // Load the library containing the 'coded' functionObject libs ("libutilityFunctionObjects.so"); type coded; // Name of on-the-fly generated functionObject name error; codeEnd #{ // Lookup U Info<< "Looking up field U\n" << endl; const volVectorField& U = mesh().lookupObject<volVectorField>("U"); Info<< "Reading inlet velocity uInfX\n" << endl; scalar ULeft = 0.0; label leftI = mesh().boundaryMesh().findPatchID("left"); const fvPatchVectorField& fvp = U.boundaryField()[leftI]; if (fvp.size()) { ULeft = fvp[0].x(); } reduce(ULeft, maxOp<scalar>()); dimensionedScalar uInfX ( "uInfx", dimensionSet(0, 1, -1, 0, 0), ULeft ); Info << "U at inlet = " << uInfX.value() << " m/s" << endl; scalar magCylinder = 0.0; label cylI = mesh().boundaryMesh().findPatchID("cylinder"); const fvPatchVectorField& cylFvp = mesh().C().boundaryField()[cylI]; if (cylFvp.size()) { magCylinder = mag(cylFvp[0]); } reduce(magCylinder, maxOp<scalar>()); dimensionedScalar radius ( "radius", dimensionSet(0, 1, 0, 0, 0), magCylinder ); Info << "Cylinder radius = " << radius.value() << " m" << endl; volVectorField UA ( IOobject ( "UA", mesh().time().timeName(), U.mesh(), IOobject::NO_READ, IOobject::AUTO_WRITE ), U ); Info<< "\nEvaluating analytical solution" << endl; const volVectorField& centres = UA.mesh().C(); volScalarField magCentres(mag(centres)); volScalarField theta(acos((centres & vector(1,0,0))/magCentres)); volVectorField cs2theta ( cos(2*theta)*vector(1,0,0) + sin(2*theta)*vector(0,1,0) ); UA = uInfX*(dimensionedVector(vector(1,0,0)) - pow((radius/magCentres),2)*cs2theta); // Force writing of UA (since time has not changed) UA.write(); volScalarField error("error", mag(U-UA)/mag(UA)); Info<<"Writing relative error in U to " << error.objectPath() << endl; error.write(); #}; } } // ************************************************************************* // fvSchemes (1,079 bytes)
/*--------------------------------*- 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; location "system"; object fvSchemes; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ddtSchemes { default steadyState; } gradSchemes { default leastSquares; } divSchemes { default none; div(phi,U) bounded Gauss linear; div(div(phi,U)) Gauss linear; } laplacianSchemes { default Gauss linear corrected; } interpolationSchemes { default linear; } snGradSchemes { default corrected; } // ************************************************************************* // fvSolution (930 bytes)
/*--------------------------------*- 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; location "system"; object fvSolution; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solvers { Phi { solver GAMG; smoother DIC; tolerance 1e-06; relTol 0.01; } p { $Phi; } } potentialFlow { nNonOrthogonalCorrectors 3; } // ************************************************************************* // blockMeshDict-2 (6,927 bytes)
/*--------------------------------*- 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; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // convertToMeters 1; vertices #codeStream { codeInclude #{ #include "pointField.H" #}; code #{ pointField points(19); points[0] = point(-35, 0, 0); points[1] = point(9, 0, 0); points[2] = point(10, 0, 0); points[3] = point(12, 0, 0); points[4] = point(13, 0, 0); points[5] = point(115, 0, 0); points[6] = point(-35, 1.4142136, 0); points[7] = point(9.5857864, 1.4142136, 0); points[8] = point(11, 2, 0); points[9] = point(12.4142136, 1.4142136, 0); points[10] = point(115, 1.4142136, 0); points[11] = point(-35, 50, 0); points[12] = point(9.5857864, 50, 0); points[13] = point(11, 50, 0); points[14] = point(12.4142136, 50, 0); points[15] = point(115, 50, 0); points[16] = point(10.292893, 0.707107, 0); points[17] = point(11, 1, 0); points[18] = point(11.707107, 0.707107, 0); // Duplicate z points label sz = points.size(); points.setSize(2*sz); for (label i = 0; i < sz; i++) { const point& pt = points[i]; points[i+sz] = point(pt.x(), pt.y(), pt.z()+2); } //Mirror above geometry in the -y direction label my = points.size(); points.setSize(2*my); for (label i = 6; i < my; i++) { if (i < 19) { const point& pt = points[i]; points[i+(my-6)] = point(pt.x(), -pt.y(), pt.z()); } if (i > 24 && i < 38) { const point& pt = points[i]; points[i+26] = point(pt.x(), -pt.y(), pt.z()); } } //Print points for ( label k = 0; k < 2*my-12; k++) { Info << "This is point:" << k << points[k] << endl; } os << points; #}; }; blocks ( //Normal cell numbering of (x y z): hex (0 1 7 6 19 20 26 25) (10 25 1) simpleGrading (1 1 1)//1 hex (1 2 16 7 20 21 35 26) (10 25 1) simpleGrading (1 1 1)//2 hex (7 16 17 8 26 35 36 27) (10 25 1) simpleGrading (1 1 1)//3 hex (8 17 18 9 27 36 37 28) (10 25 1) simpleGrading (1 1 1)//4 hex (3 4 9 18 22 23 28 37) (10 25 1) simpleGrading (1 1 1)//5 hex (4 5 10 9 23 24 29 28) (10 25 1) simpleGrading (1 1 1)//6 hex (6 7 12 11 25 26 31 30) (10 10 1) simpleGrading (1 1 1)//7 hex (7 8 13 12 26 27 32 31) (25 10 1) simpleGrading (1 1 1)//8 hex (8 9 14 13 27 28 33 32) (25 10 1) simpleGrading (1 1 1)//9 hex (9 10 15 14 28 29 34 33) (10 10 1) simpleGrading (1 1 1)//10 //Abnormal cell numbering of (y x z) : hex (0 38 39 1 19 51 52 20) (25 10 1) simpleGrading (1 1 1)//11 hex (1 39 48 2 20 52 61 21) (25 10 1) simpleGrading (1 1 1)//12 hex (39 40 49 48 52 53 62 61) (25 10 1) simpleGrading (1 1 1)//13 hex (40 41 50 49 53 54 63 62) (25 10 1) simpleGrading (1 1 1)//14 hex (3 50 41 4 22 63 54 23) (25 10 1) simpleGrading (1 1 1)//15 hex (4 41 42 5 23 54 55 24) (25 10 1) simpleGrading (1 1 1)//16 hex (38 43 44 39 51 56 57 52) (10 10 1) simpleGrading (1 1 1)//17 hex (39 44 45 40 52 57 58 53) (10 25 1) simpleGrading (1 1 1)//18 hex (40 45 46 41 53 58 59 54) (10 25 1) simpleGrading (1 1 1)//19 hex (41 46 47 42 54 59 60 55) (10 10 1) simpleGrading (1 1 1)//20 ); edges ( arc 1 7 (9.1522409 0.76536686 0)//1 arc 7 8 (10.234633 1.8477591 0)//2 arc 8 9 (11.765367 1.8477591 0)//3 arc 9 4 (12.847759 0.76536686 0)//4 arc 2 16 (10.076120 0.38268343 0)//5 arc 16 17 (10.617317 0.92387953 0)//6 arc 17 18 (11.382683 0.92387953 0)//7 arc 18 3 (11.923880 0.38268343 0)//8 arc 20 26 (9.1522409 0.76536686 2)//9 arc 26 27 (10.234633 1.8477591 2)//10 arc 27 28 (11.765367 1.8477591 2)//11 arc 28 23 (12.847759 0.76536686 2)//12 arc 21 35 (10.076120 0.38268343 2)//13 arc 35 36 (10.617317 0.92387953 2)//14 arc 36 37 (11.382683 0.92387953 2)//15 arc 37 22 (11.923880 0.38268343 2)//16 //bottom geometry arc 1 39 (9.1522409 -0.76536686 0)//17 arc 39 40 (10.234633 -1.8477591 0)//18 arc 40 41 (11.765367 -1.8477591 0)//19 arc 41 4 (12.847759 -0.76536686 0)//20 arc 2 48 (10.076120 -0.38268343 0)//21 arc 48 49 (10.617317 -0.92387953 0)//22 arc 49 50 (11.382683 -0.92387953 0)//23 arc 50 3 (11.923880 -0.38268343 0)//24 arc 20 52 (9.1522409 -0.76536686 2)//25 arc 52 53 (10.234633 -1.8477591 2)//26 arc 53 54 (11.765367 -1.8477591 2)//27 arc 54 23 (12.847759 -0.76536686 2)//28 arc 21 61 (10.076120 -0.38268343 2)//29 arc 61 62 (10.617317 -0.92387953 2)//30 arc 62 63 (11.382683 -0.92387953 2)//31 arc 63 22 (11.923880 -0.38268343 2)//32 ); boundary ( bottomWall { type symmetry; faces ( (43 44 57 56) (44 45 58 57) (45 46 59 58) (46 47 60 59) ); } outlet { type patch; faces ( (10 15 34 29) (5 10 29 24) (5 24 55 42) (42 55 60 47) ); } topWall { type symmetry; faces ( (11 30 31 12) (12 31 32 13) (13 32 33 14) (14 33 34 15) ); } inlet { type patch; faces ( (6 25 30 11) (0 19 25 6) (0 38 51 19) (38 43 56 51) ); } cylinder { type wall; faces ( (2 16 35 21) (16 17 36 35) (17 18 37 36) (3 22 37 18) (2 21 61 48) (48 61 62 49) (49 62 63 50) (3 50 63 22) ); } frontandBack { type empty; faces ( //back (0 6 7 1) (1 7 16 2) (7 8 17 16) (8 9 18 17) (3 18 9 4) (4 9 10 5) (6 11 12 7) (7 12 13 8) (8 13 14 9) (9 14 15 10) //(1 2 48 39) //front (19 20 26 25) (20 21 35 26) (26 35 36 27) (27 36 37 28) (22 23 28 37) (23 24 29 28) (25 26 31 30) (26 27 32 31) (27 28 33 32) (28 29 34 33) ); } ); mergePatchPairs ( ); // ************************************************************************* // p.orig (1,209 bytes)
/*--------------------------------*- 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 volScalarField; object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField uniform 0; boundaryField { bottomWall { type symmetry; } outlet { type fixedValue; value uniform 0; } topWall { type symmetry; } Inlet { type zeroGradient; } cylinder { type wall; value noSlip; frontandback { type empty; } defaultFaces { type empty; } } // ************************************************************************* // U.orig (1,157 bytes)
/*--------------------------------*- 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 volVectorField; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { bottomWall { type symmetry; } outlet { type zeroGradient; } topWall { type symmetry; } inlet { type uniformFixedValue; uniformValue constant (1 0 0); } cylinder { type noSlip; } frontandBack { type empty; } } // ************************************************************************* // |
|
HEre is a video that visualizes the above mentioned error on my OpenFOAM7: https://youtu.be/bCU2XqcAmgs |
|
User support request. |
Date Modified | Username | Field | Change |
---|---|---|---|
2020-10-21 03:51 | Beginning OpenFOAM | New Issue | |
2020-10-21 03:56 | Beginning OpenFOAM | File Added: blockMeshDict | |
2020-10-21 03:59 | Beginning OpenFOAM | File Added: controlDict | |
2020-10-21 03:59 | Beginning OpenFOAM | File Added: fvSchemes | |
2020-10-21 03:59 | Beginning OpenFOAM | File Added: fvSolution | |
2020-10-21 03:59 | Beginning OpenFOAM | File Added: blockMeshDict-2 | |
2020-10-21 03:59 | Beginning OpenFOAM | File Added: p.orig | |
2020-10-21 03:59 | Beginning OpenFOAM | File Added: U.orig | |
2020-10-22 19:10 | Beginning OpenFOAM | Note Added: 0011638 | |
2020-10-23 11:31 | henry | Assigned To | => henry |
2020-10-23 11:31 | henry | Status | new => closed |
2020-10-23 11:31 | henry | Resolution | open => no change required |
2020-10-23 11:31 | henry | Note Added: 0011639 |