From 855df4757fe22b0e80d0cb4f5cafe91fd36c485c Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 21 Apr 2011 15:55:33 +0100 Subject: [PATCH 01/22] ENH: Allwmake: pass through build option --- src/fvAgglomerationMethods/Allwmake | 2 +- src/regionModels/Allwmake | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/fvAgglomerationMethods/Allwmake b/src/fvAgglomerationMethods/Allwmake index c4313c1a47..aa039078e9 100755 --- a/src/fvAgglomerationMethods/Allwmake +++ b/src/fvAgglomerationMethods/Allwmake @@ -10,6 +10,6 @@ then wmake $makeType MGridGenGamgAgglomeration fi -wmake libso pairPatchAgglomeration +wmake $makeType pairPatchAgglomeration # ----------------------------------------------------------------- end-of-file diff --git a/src/regionModels/Allwmake b/src/regionModels/Allwmake index 7713ded586..b8b7bce119 100755 --- a/src/regionModels/Allwmake +++ b/src/regionModels/Allwmake @@ -1,11 +1,12 @@ #!/bin/sh cd ${0%/*} || exit 1 # run from this directory +makeType=${1:-libso} set -x -wmake libso regionModel -#wmake libso pyrolysisModels -wmake libso surfaceFilmModels -#wmake libso regionCoupling +wmake $makeType regionModel +#wmake $makeType pyrolysisModels +wmake $makeType surfaceFilmModels +#wmake $makeType regionCoupling # ----------------------------------------------------------------- end-of-file From cd083dc832823319409ccf30ee215bb9c6b96684 Mon Sep 17 00:00:00 2001 From: graham Date: Thu, 21 Apr 2011 16:09:44 +0100 Subject: [PATCH 02/22] ENH: Smaller, shorter, faster wingMotion tut. --- .../pimpleDyMFoam/wingMotion/Allrun | 2 +- .../0.org/pointDisplacement | 2 +- .../constant/polyMesh/boundary | 24 +++++++++---------- .../system/controlDict | 2 +- .../system/decomposeParDict | 11 +++------ .../constant/polyMesh/boundary | 24 +++++++++---------- .../constant/polyMesh/blockMeshDict | 18 +++++++------- .../constant/polyMesh/boundary | 24 +++++++++---------- .../system/snappyHexMeshDict | 12 +++++----- 9 files changed, 57 insertions(+), 62 deletions(-) diff --git a/tutorials/incompressible/pimpleDyMFoam/wingMotion/Allrun b/tutorials/incompressible/pimpleDyMFoam/wingMotion/Allrun index 33da567345..c1939edcae 100755 --- a/tutorials/incompressible/pimpleDyMFoam/wingMotion/Allrun +++ b/tutorials/incompressible/pimpleDyMFoam/wingMotion/Allrun @@ -23,7 +23,7 @@ cp -r 0.org 0 runApplication mapFields ../wingMotion2D_simpleFoam -sourceTime latestTime -consistent mv 0/pointDisplacement.unmapped 0/pointDisplacement runApplication decomposePar -runParallel `getApplication` 3 +runParallel `getApplication` 4 runApplication reconstructPar # ----------------------------------------------------------------- end-of-file diff --git a/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_pimpleDyMFoam/0.org/pointDisplacement b/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_pimpleDyMFoam/0.org/pointDisplacement index 2cabd2121c..1955fa5aec 100644 --- a/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_pimpleDyMFoam/0.org/pointDisplacement +++ b/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_pimpleDyMFoam/0.org/pointDisplacement @@ -35,7 +35,7 @@ boundaryField ); velocity (0 0 0); acceleration (0 0 0); - angularMomentum (0 0 -0.5); + angularMomentum (0 0 -2.0); torque (0 0 0); rhoName rhoInf; rhoInf 1; diff --git a/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_pimpleDyMFoam/constant/polyMesh/boundary b/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_pimpleDyMFoam/constant/polyMesh/boundary index a89f075e69..47ef37c902 100644 --- a/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_pimpleDyMFoam/constant/polyMesh/boundary +++ b/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_pimpleDyMFoam/constant/polyMesh/boundary @@ -20,38 +20,38 @@ FoamFile topAndBottom { type patch; - nFaces 150; - startFace 76473; + nFaces 72; + startFace 25168; } inlet { type patch; - nFaces 48; - startFace 76623; + nFaces 40; + startFace 25240; } outlet { type patch; - nFaces 48; - startFace 76671; + nFaces 62; + startFace 25280; } front { type empty; - nFaces 38129; - startFace 76719; + nFaces 12559; + startFace 25342; } back { type empty; - nFaces 38129; - startFace 114848; + nFaces 12559; + startFace 37901; } wing { type wall; - nFaces 778; - startFace 152977; + nFaces 378; + startFace 50460; } ) diff --git a/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_pimpleDyMFoam/system/controlDict b/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_pimpleDyMFoam/system/controlDict index db20cc9714..25e6e39610 100644 --- a/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_pimpleDyMFoam/system/controlDict +++ b/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_pimpleDyMFoam/system/controlDict @@ -23,7 +23,7 @@ startTime 0; stopAt endTime; -endTime 1; +endTime 0.6; deltaT 1e-5; diff --git a/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_pimpleDyMFoam/system/decomposeParDict b/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_pimpleDyMFoam/system/decomposeParDict index e63167424c..d31797fc0d 100644 --- a/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_pimpleDyMFoam/system/decomposeParDict +++ b/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_pimpleDyMFoam/system/decomposeParDict @@ -15,27 +15,22 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -numberOfSubdomains 3; +numberOfSubdomains 4; method simple; simpleCoeffs { - n ( 1 3 1 ); + n ( 2 2 1 ); delta 0.001; } hierarchicalCoeffs { - n ( 3 2 1 ); + n ( 2 2 1 ); delta 0.001; order xyz; } -manualCoeffs -{ - dataFile "cellDecomposition"; -} - // ************************************************************************* // diff --git a/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_simpleFoam/constant/polyMesh/boundary b/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_simpleFoam/constant/polyMesh/boundary index a89f075e69..47ef37c902 100644 --- a/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_simpleFoam/constant/polyMesh/boundary +++ b/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_simpleFoam/constant/polyMesh/boundary @@ -20,38 +20,38 @@ FoamFile topAndBottom { type patch; - nFaces 150; - startFace 76473; + nFaces 72; + startFace 25168; } inlet { type patch; - nFaces 48; - startFace 76623; + nFaces 40; + startFace 25240; } outlet { type patch; - nFaces 48; - startFace 76671; + nFaces 62; + startFace 25280; } front { type empty; - nFaces 38129; - startFace 76719; + nFaces 12559; + startFace 25342; } back { type empty; - nFaces 38129; - startFace 114848; + nFaces 12559; + startFace 37901; } wing { type wall; - nFaces 778; - startFace 152977; + nFaces 378; + startFace 50460; } ) diff --git a/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion_snappyHexMesh/constant/polyMesh/blockMeshDict b/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion_snappyHexMesh/constant/polyMesh/blockMeshDict index 4f129d2976..4cbd61df86 100644 --- a/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion_snappyHexMesh/constant/polyMesh/blockMeshDict +++ b/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion_snappyHexMesh/constant/polyMesh/blockMeshDict @@ -19,19 +19,19 @@ convertToMeters 1; vertices ( - (-2.5 -4.8 -0.1) - ( 10 -4.8 -0.1) - ( 10 4.8 -0.1) - (-2.5 4.8 -0.1) - (-2.5 -4.8 0.1) - ( 10 -4.8 0.1) - ( 10 4.8 0.1) - (-2.5 4.8 0.1) + (-1.2 -2.2 -0.1) + ( 5 -2.2 -0.1) + ( 5 2.2 -0.1) + (-1.2 2.2 -0.1) + (-1.2 -2.2 0.1) + ( 5 -2.2 0.1) + ( 5 2.2 0.1) + (-1.2 2.2 0.1) ); blocks ( - hex (0 1 2 3 4 5 6 7) (75 48 1) simpleGrading (1 1 1) + hex (0 1 2 3 4 5 6 7) (36 24 1) simpleGrading (1 1 1) ); edges diff --git a/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion_snappyHexMesh/constant/polyMesh/boundary b/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion_snappyHexMesh/constant/polyMesh/boundary index f7442f9703..b3aa38bcef 100644 --- a/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion_snappyHexMesh/constant/polyMesh/boundary +++ b/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion_snappyHexMesh/constant/polyMesh/boundary @@ -20,38 +20,38 @@ FoamFile topAndBottom { type patch; - nFaces 150; - startFace 2098769; + nFaces 72; + startFace 495985; } inlet { type patch; - nFaces 48; - startFace 2098919; + nFaces 72; + startFace 496057; } outlet { type patch; - nFaces 48; - startFace 2098967; + nFaces 204; + startFace 496129; } front { type empty; - nFaces 38129; - startFace 2099015; + nFaces 12559; + startFace 496333; } back { type empty; - nFaces 38120; - startFace 2137144; + nFaces 12559; + startFace 508892; } wing_5degrees.obj_WALL10 { type wall; - nFaces 49792; - startFace 2175264; + nFaces 12096; + startFace 521451; } ) diff --git a/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion_snappyHexMesh/system/snappyHexMeshDict b/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion_snappyHexMesh/system/snappyHexMeshDict index 788aa3ecbe..8d8385a190 100644 --- a/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion_snappyHexMesh/system/snappyHexMeshDict +++ b/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion_snappyHexMesh/system/snappyHexMeshDict @@ -62,10 +62,10 @@ castellatedMeshControls // actually be a lot less. maxGlobalCells 2000000; - // The surface refinement loop might spend lots of iterations refining just a - // few cells. This setting will cause refinement to stop if <= minimumRefine - // are selected for refinement. Note: it will at least do one iteration - // (unless the number of cells to refine is 0) + // The surface refinement loop might spend lots of iterations refining just + // a few cells. This setting will cause refinement to stop if <= + // minimumRefine are selected for refinement. Note: it will at least do one + // iteration (unless the number of cells to refine is 0) minRefinementCells 100; // Number of buffer layers between different levels. @@ -98,7 +98,7 @@ castellatedMeshControls wing_5degrees.obj { // Surface-wise min and max refinement level - level (6 6); + level (5 5); } } @@ -124,7 +124,7 @@ castellatedMeshControls refinementBox { mode inside; - levels ((1e15 3)); + levels ((1e15 2)); } } From 6a96e4a326f6e9dbecc511cccaaa88f917f06791 Mon Sep 17 00:00:00 2001 From: graham Date: Thu, 21 Apr 2011 18:01:38 +0100 Subject: [PATCH 03/22] ENH: Shorten dsmc tut. --- .../dsmcFoam/supersonicCorner/system/controlDict | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/discreteMethods/dsmcFoam/supersonicCorner/system/controlDict b/tutorials/discreteMethods/dsmcFoam/supersonicCorner/system/controlDict index b407d21309..d2abf98649 100644 --- a/tutorials/discreteMethods/dsmcFoam/supersonicCorner/system/controlDict +++ b/tutorials/discreteMethods/dsmcFoam/supersonicCorner/system/controlDict @@ -23,7 +23,7 @@ startTime 0; stopAt endTime; -endTime 0.025; +endTime 0.01; deltaT 1e-6; From 9245a084a0766ad6ec03cf4ea91515eb25fb3ddb Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 22 Apr 2011 10:55:37 +0100 Subject: [PATCH 04/22] ENH: domainDecomposition.C: added inbalance stats --- .../decomposePar/domainDecomposition.C | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C b/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C index fc9d2c4ff1..4882c118a0 100644 --- a/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C +++ b/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -160,8 +160,10 @@ bool Foam::domainDecomposition::writeDecomposition() } + label maxProcCells = 0; label totProcFaces = 0; label maxProcPatches = 0; + label totProcPatches = 0; label maxProcFaces = 0; @@ -749,6 +751,8 @@ bool Foam::domainDecomposition::writeDecomposition() << " Number of cells = " << procMesh.nCells() << endl; + maxProcCells = max(maxProcCells, procMesh.nCells()); + label nBoundaryFaces = 0; label nProcPatches = 0; label nProcFaces = 0; @@ -780,6 +784,7 @@ bool Foam::domainDecomposition::writeDecomposition() << " Number of boundary faces = " << nBoundaryFaces << endl; totProcFaces += nProcFaces; + totProcPatches += nProcPatches; maxProcPatches = max(maxProcPatches, nProcPatches); maxProcFaces = max(maxProcFaces, nProcFaces); @@ -851,10 +856,21 @@ bool Foam::domainDecomposition::writeDecomposition() boundaryProcAddressing.write(); } + scalar avgProcCells = scalar(nCells())/nProcs_; + scalar avgProcPatches = scalar(totProcPatches)/nProcs_; + scalar avgProcFaces = scalar(totProcFaces)/nProcs_; + Info<< nl << "Number of processor faces = " << totProcFaces/2 << nl - << "Max number of processor patches = " << maxProcPatches << nl + << "Max number of cells = " << maxProcCells + << " (" << 100.0*(maxProcCells-avgProcCells)/avgProcCells + << "% above average " << avgProcCells << ")" << nl + << "Max number of processor patches = " << maxProcPatches + << " (" << 100.0*(maxProcPatches-avgProcPatches)/avgProcPatches + << "% above average " << avgProcPatches << ")" << nl << "Max number of faces between processors = " << maxProcFaces + << " (" << 100.0*(maxProcFaces-avgProcFaces)/avgProcFaces + << "% above average " << avgProcFaces << ")" << nl << endl; return true; From 329f0bbe69d941c5b43f80d1221886a53cff82cc Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 22 Apr 2011 10:57:55 +0100 Subject: [PATCH 05/22] BUG: addPatchCellLayer: non-manifold edges on processor boundaries --- .../autoHexMeshDriver/autoLayerDriver.C | 265 +++++++++++++++++- .../autoHexMeshDriver/autoLayerDriver.H | 25 ++ 2 files changed, 285 insertions(+), 5 deletions(-) diff --git a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C index a1e274d2c0..86f4cbd977 100644 --- a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C +++ b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C @@ -251,6 +251,7 @@ void Foam::autoLayerDriver::handleNonManifolds ( const indirectPrimitivePatch& pp, const labelList& meshEdges, + const labelListList& edgeGlobalFaces, pointField& patchDisp, labelList& patchNLayers, List& extrudeStatus @@ -268,11 +269,53 @@ void Foam::autoLayerDriver::handleNonManifolds // 1. Local check checkManifold(pp, nonManifoldPoints); + // 2. Remote check for boundary edges on coupled boundaries + forAll(edgeGlobalFaces, edgeI) + { + if + ( + pp.edgeFaces()[edgeI].size() == 1 + && edgeGlobalFaces[edgeI].size() > 2 + ) + { + // So boundary edges that are connected to more than 2 processors + // i.e. a non-manifold edge which is exactly on a processor + // boundary. + const edge& e = pp.edges()[edgeI]; + nonManifoldPoints.insert(pp.meshPoints()[e[0]]); + nonManifoldPoints.insert(pp.meshPoints()[e[1]]); + } + } + + label nNonManif = returnReduce(nonManifoldPoints.size(), sumOp