diff --git a/applications/solvers/basic/potentialFoam/createControls.H b/applications/solvers/basic/potentialFoam/createControls.H new file mode 100644 index 0000000000..7015cae02e --- /dev/null +++ b/applications/solvers/basic/potentialFoam/createControls.H @@ -0,0 +1,9 @@ +const dictionary& potentialFlow +( + mesh.solutionDict().subDict("potentialFlow") +); + +const int nNonOrthCorr +( + potentialFlow.lookupOrDefault("nNonOrthogonalCorrectors", 0) +); diff --git a/applications/solvers/basic/potentialFoam/createFields.H b/applications/solvers/basic/potentialFoam/createFields.H index 2682bf6833..eda7cbc0c2 100644 --- a/applications/solvers/basic/potentialFoam/createFields.H +++ b/applications/solvers/basic/potentialFoam/createFields.H @@ -119,3 +119,5 @@ setRefCell PhiRefValue ); mesh.setFluxRequired(Phi.name()); + +#include "createMRF.H" diff --git a/applications/solvers/basic/potentialFoam/potentialFoam.C b/applications/solvers/basic/potentialFoam/potentialFoam.C index f0c04eadb4..dfc80be425 100644 --- a/applications/solvers/basic/potentialFoam/potentialFoam.C +++ b/applications/solvers/basic/potentialFoam/potentialFoam.C @@ -132,7 +132,6 @@ int main(int argc, char *argv[]) pisoControl potentialFlow(mesh, "potentialFlow"); #include "createFields.H" - #include "createMRF.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/compressibleMultiRegionCourantNo.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/compressibleMultiRegionCourantNo.H index 82dc875847..dd129047dc 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/compressibleMultiRegionCourantNo.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/compressibleMultiRegionCourantNo.H @@ -1,32 +1,32 @@ scalar CoNum = -GREAT; - forAll(fluidRegions, regionI) + forAll(fluidRegions, regioni) { CoNum = max ( compressibleCourantNo ( - fluidRegions[regionI], + fluidRegions[regioni], runTime, - rhoFluid[regionI], - phiFluid[regionI] + rhoFluid[regioni], + phiFluid[regioni] ), CoNum ); } /* - forAll(porousFluidRegions, porousI) + forAll(porousFluidRegions, porousi) { CoNum = max ( compressibleCourantNo ( - porousFluidRegions[porousI], + porousFluidRegions[porousi], runTime, - rhoPorous[porousI], - phiPorous[porousI] + rhoPorous[porousi], + phiPorous[porousi] ), CoNum ); } -*/ \ No newline at end of file +*/ diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/twoPhaseMixtureEThermo/twoPhaseMixtureEThermo.C b/applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/twoPhaseMixtureEThermo/twoPhaseMixtureEThermo.C index e8ae64ce1d..0c443f2c14 100644 --- a/applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/twoPhaseMixtureEThermo/twoPhaseMixtureEThermo.C +++ b/applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/twoPhaseMixtureEThermo/twoPhaseMixtureEThermo.C @@ -204,13 +204,13 @@ Foam::tmp Foam::twoPhaseMixtureEThermo::he ( const scalarField& p, const scalarField& T, - const label patchI + const label patchi ) const { - const scalarField& alpha1p = alpha1().boundaryField()[patchI]; - const scalarField& alpha2p = alpha2().boundaryField()[patchI]; + const scalarField& alpha1p = alpha1().boundaryField()[patchi]; + const scalarField& alpha2p = alpha2().boundaryField()[patchi]; - const scalarField& Tp = T_.boundaryField()[patchI]; + const scalarField& Tp = T_.boundaryField()[patchi]; return ( @@ -429,11 +429,11 @@ Foam::tmp Foam::twoPhaseMixtureEThermo::Cpv ( const scalarField& p, const scalarField& T, - const label patchI + const label patchi ) const { // This is a e thermo (Cpv = Cv) - return Cv(p, T, patchI); + return Cv(p, T, patchi); } diff --git a/applications/utilities/mesh/advanced/snappyRefineMesh/snappyRefineMesh.C b/applications/utilities/mesh/advanced/snappyRefineMesh/snappyRefineMesh.C index 4e4f7e0263..6b5e74c71f 100644 --- a/applications/utilities/mesh/advanced/snappyRefineMesh/snappyRefineMesh.C +++ b/applications/utilities/mesh/advanced/snappyRefineMesh/snappyRefineMesh.C @@ -127,9 +127,9 @@ scalar getEdgeStats(const primitiveMesh& mesh, const direction excludeCmpt) const edgeList& edges = mesh.edges(); - forAll(edges, edgeI) + forAll(edges, edgei) { - const edge& e = edges[edgeI]; + const edge& e = edges[edgei]; vector eVec(e.vec(mesh.points())); @@ -196,24 +196,24 @@ scalar getEdgeStats(const primitiveMesh& mesh, const direction excludeCmpt) // Adds empty patch if not yet there. Returns patchID. label addPatch(polyMesh& mesh, const word& patchName) { - label patchI = mesh.boundaryMesh().findPatchID(patchName); + label patchi = mesh.boundaryMesh().findPatchID(patchName); - if (patchI == -1) + if (patchi == -1) { const polyBoundaryMesh& patches = mesh.boundaryMesh(); List newPatches(patches.size() + 1); // Add empty patch as 0th entry (Note: only since subsetMesh wants this) - patchI = 0; + patchi = 0; - newPatches[patchI] = + newPatches[patchi] = new emptyPolyPatch ( Foam::word(patchName), 0, mesh.nInternalFaces(), - patchI, + patchi, patches, emptyPolyPatch::typeName ); @@ -235,15 +235,15 @@ label addPatch(polyMesh& mesh, const word& patchName) mesh.removeBoundary(); mesh.addPatches(newPatches); - Info<< "Created patch oldInternalFaces at " << patchI << endl; + Info<< "Created patch oldInternalFaces at " << patchi << endl; } else { - Info<< "Reusing patch oldInternalFaces at " << patchI << endl; + Info<< "Reusing patch oldInternalFaces at " << patchi << endl; } - return patchI; + return patchi; } @@ -302,20 +302,20 @@ void addCutNeighbours forAllConstIter(labelHashSet, cutCells, iter) { - const label cellI = iter.key(); - const labelList& cFaces = mesh.cells()[cellI]; + const label celli = iter.key(); + const labelList& cFaces = mesh.cells()[celli]; forAll(cFaces, i) { - const label faceI = cFaces[i]; + const label facei = cFaces[i]; - if (mesh.isInternalFace(faceI)) + if (mesh.isInternalFace(facei)) { - label nbr = mesh.faceOwner()[faceI]; + label nbr = mesh.faceOwner()[facei]; - if (nbr == cellI) + if (nbr == celli) { - nbr = mesh.faceNeighbour()[faceI]; + nbr = mesh.faceNeighbour()[facei]; } if (selectInside && inside.found(nbr)) @@ -354,11 +354,11 @@ bool limitRefinementLevel ) { // Do simple check on validity of refinement level. - forAll(refLevel, cellI) + forAll(refLevel, celli) { - if (!excludeCells.found(cellI)) + if (!excludeCells.found(celli)) { - const labelList& cCells = mesh.cellCells()[cellI]; + const labelList& cCells = mesh.cellCells()[celli]; forAll(cCells, i) { @@ -366,13 +366,13 @@ bool limitRefinementLevel if (!excludeCells.found(nbr)) { - if (refLevel[cellI] - refLevel[nbr] >= limitDiff) + if (refLevel[celli] - refLevel[nbr] >= limitDiff) { FatalErrorInFunction << "Level difference between neighbouring cells " - << cellI << " and " << nbr + << celli << " and " << nbr << " greater than or equal to " << limitDiff << endl - << "refLevels:" << refLevel[cellI] << ' ' + << "refLevels:" << refLevel[celli] << ' ' << refLevel[nbr] << abort(FatalError); } } @@ -386,8 +386,8 @@ bool limitRefinementLevel forAllConstIter(labelHashSet, cutCells, iter) { // cellI will be refined. - const label cellI = iter.key(); - const labelList& cCells = mesh.cellCells()[cellI]; + const label celli = iter.key(); + const labelList& cCells = mesh.cellCells()[celli]; forAll(cCells, i) { @@ -395,7 +395,7 @@ bool limitRefinementLevel if (!excludeCells.found(nbr) && !cutCells.found(nbr)) { - if (refLevel[cellI] + 1 - refLevel[nbr] >= limitDiff) + if (refLevel[celli] + 1 - refLevel[nbr] >= limitDiff) { addCutCells.insert(nbr); } @@ -454,22 +454,22 @@ void doRefinement refLevel.setSize(mesh.nCells()); - for (label cellI = oldCells; cellI < mesh.nCells(); cellI++) + for (label celli = oldCells; celli < mesh.nCells(); celli++) { - refLevel[cellI] = 0; + refLevel[celli] = 0; } const labelListList& addedCells = multiRef.addedCells(); - forAll(addedCells, oldCellI) + forAll(addedCells, oldCelli) { - const labelList& added = addedCells[oldCellI]; + const labelList& added = addedCells[oldCelli]; if (added.size()) { // Give all cells resulting from split the refinement level // of the master. - label masterLevel = ++refLevel[oldCellI]; + label masterLevel = ++refLevel[oldCelli]; forAll(added, i) { @@ -485,7 +485,7 @@ void subsetMesh ( polyMesh& mesh, const label writeMesh, - const label patchI, // patchID for exposed faces + const label patchi, // patchID for exposed faces const labelHashSet& cellsToRemove, cellSet& cutCells, labelIOList& refLevel @@ -506,7 +506,7 @@ void subsetMesh ( cellLabels, exposedFaces, - labelList(exposedFaces.size(), patchI), + labelList(exposedFaces.size(), patchi), meshMod ); @@ -632,7 +632,7 @@ int main(int argc, char *argv[]) #include "createPolyMesh.H" // If nessecary add oldInternalFaces patch - label newPatchI = addPatch(mesh, "oldInternalFaces"); + label newPatchi = addPatch(mesh, "oldInternalFaces"); // @@ -725,9 +725,9 @@ int main(int argc, char *argv[]) meshSearch queryMesh(mesh, polyMesh::FACE_PLANES); // Check all 'outside' points - forAll(outsidePts, outsideI) + forAll(outsidePts, outsidei) { - const point& outsidePoint = outsidePts[outsideI]; + const point& outsidePoint = outsidePts[outsidei]; if (queryMesh.findCell(outsidePoint, -1, false) == -1) { @@ -857,7 +857,7 @@ int main(int argc, char *argv[]) { // Subset mesh to remove inside cells altogether. Updates cutCells, // refLevel. - subsetMesh(mesh, writeMesh, newPatchI, inside, cutCells, refLevel); + subsetMesh(mesh, writeMesh, newPatchi, inside, cutCells, refLevel); } diff --git a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C index 235f81db47..1f4414fcbd 100644 --- a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C +++ b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C @@ -91,39 +91,39 @@ autoPtr createRefinementSurfaces autoPtr surfacePtr; // Count number of surfaces. - label surfI = 0; - forAll(allGeometry.names(), geomI) + label surfi = 0; + forAll(allGeometry.names(), geomi) { - const word& geomName = allGeometry.names()[geomI]; + const word& geomName = allGeometry.names()[geomi]; if (surfacesDict.found(geomName)) { - surfI++; + surfi++; } } - labelList surfaces(surfI); - wordList names(surfI); - PtrList surfZones(surfI); + labelList surfaces(surfi); + wordList names(surfi); + PtrList surfZones(surfi); - labelList regionOffset(surfI); + labelList regionOffset(surfi); - labelList globalMinLevel(surfI, 0); - labelList globalMaxLevel(surfI, 0); - labelList globalLevelIncr(surfI, 0); - PtrList globalPatchInfo(surfI); - List> regionMinLevel(surfI); - List> regionMaxLevel(surfI); - List> regionLevelIncr(surfI); - List> regionAngle(surfI); - List>> regionPatchInfo(surfI); + labelList globalMinLevel(surfi, 0); + labelList globalMaxLevel(surfi, 0); + labelList globalLevelIncr(surfi, 0); + PtrList globalPatchInfo(surfi); + List> regionMinLevel(surfi); + List> regionMaxLevel(surfi); + List> regionLevelIncr(surfi); + List> regionAngle(surfi); + List>> regionPatchInfo(surfi); HashSet unmatchedKeys(surfacesDict.toc()); - surfI = 0; - forAll(allGeometry.names(), geomI) + surfi = 0; + forAll(allGeometry.names(), geomi) { - const word& geomName = allGeometry.names()[geomI]; + const word& geomName = allGeometry.names()[geomi]; const entry* ePtr = surfacesDict.lookupEntryPtr(geomName, false, true); @@ -132,10 +132,10 @@ autoPtr createRefinementSurfaces const dictionary& shapeDict = ePtr->dict(); unmatchedKeys.erase(ePtr->keyword()); - names[surfI] = geomName; - surfaces[surfI] = geomI; + names[surfi] = geomName; + surfaces[surfi] = geomi; - const searchableSurface& surface = allGeometry[geomI]; + const searchableSurface& surface = allGeometry[geomi]; // Find the index in shapeControlDict // Invert surfaceCellSize to get the refinementLevel @@ -154,12 +154,12 @@ autoPtr createRefinementSurfaces surfaceCellSize ); - globalMinLevel[surfI] = refLevel; - globalMaxLevel[surfI] = refLevel; - globalLevelIncr[surfI] = gapLevelIncrement; + globalMinLevel[surfi] = refLevel; + globalMaxLevel[surfi] = refLevel; + globalLevelIncr[surfi] = gapLevelIncrement; // Surface zones - surfZones.set(surfI, new surfaceZonesInfo(surface, shapeDict)); + surfZones.set(surfi, new surfaceZonesInfo(surface, shapeDict)); // Global perpendicular angle @@ -167,7 +167,7 @@ autoPtr createRefinementSurfaces { globalPatchInfo.set ( - surfI, + surfi, shapeDict.subDict("patchInfo").clone() ); } @@ -179,23 +179,23 @@ autoPtr createRefinementSurfaces { const dictionary& regionsDict = shapeDict.subDict("regions"); const wordList& regionNames = - allGeometry[surfaces[surfI]].regions(); + allGeometry[surfaces[surfi]].regions(); - forAll(regionNames, regionI) + forAll(regionNames, regioni) { - if (regionsDict.found(regionNames[regionI])) + if (regionsDict.found(regionNames[regioni])) { // Get the dictionary for region const dictionary& regionDict = regionsDict.subDict ( - regionNames[regionI] + regionNames[regioni] ); if (regionDict.found("patchInfo")) { - regionPatchInfo[surfI].insert + regionPatchInfo[surfi].insert ( - regionI, + regioni, regionDict.subDict("patchInfo").clone() ); } @@ -209,16 +209,16 @@ autoPtr createRefinementSurfaces const dictionary& shapeControlRegionsDict = shapeDict.subDict("regions"); const wordList& regionNames = - allGeometry[surfaces[surfI]].regions(); + allGeometry[surfaces[surfi]].regions(); - forAll(regionNames, regionI) + forAll(regionNames, regioni) { - if (shapeControlRegionsDict.found(regionNames[regionI])) + if (shapeControlRegionsDict.found(regionNames[regioni])) { const dictionary& shapeControlRegionDict = shapeControlRegionsDict.subDict ( - regionNames[regionI] + regionNames[regioni] ); const word scsFuncName = @@ -244,24 +244,24 @@ autoPtr createRefinementSurfaces surfaceCellSize ); - regionMinLevel[surfI].insert(regionI, refLevel); - regionMaxLevel[surfI].insert(regionI, refLevel); - regionLevelIncr[surfI].insert(regionI, 0); + regionMinLevel[surfi].insert(regioni, refLevel); + regionMaxLevel[surfi].insert(regioni, refLevel); + regionLevelIncr[surfi].insert(regioni, 0); } } } - surfI++; + surfi++; } } // Calculate local to global region offset label nRegions = 0; - forAll(surfaces, surfI) + forAll(surfaces, surfi) { - regionOffset[surfI] = nRegions; - nRegions += allGeometry[surfaces[surfI]].regions().size(); + regionOffset[surfi] = nRegions; + nRegions += allGeometry[surfaces[surfi]].regions().size(); } // Rework surface specific information into information per global region @@ -270,47 +270,47 @@ autoPtr createRefinementSurfaces labelList gapLevel(nRegions, -1); PtrList patchInfo(nRegions); - forAll(globalMinLevel, surfI) + forAll(globalMinLevel, surfi) { - label nRegions = allGeometry[surfaces[surfI]].regions().size(); + label nRegions = allGeometry[surfaces[surfi]].regions().size(); // Initialise to global (i.e. per surface) for (label i = 0; i < nRegions; i++) { - label globalRegionI = regionOffset[surfI] + i; - minLevel[globalRegionI] = globalMinLevel[surfI]; - maxLevel[globalRegionI] = globalMaxLevel[surfI]; - gapLevel[globalRegionI] = - maxLevel[globalRegionI] - + globalLevelIncr[surfI]; + label globalRegioni = regionOffset[surfi] + i; + minLevel[globalRegioni] = globalMinLevel[surfi]; + maxLevel[globalRegioni] = globalMaxLevel[surfi]; + gapLevel[globalRegioni] = + maxLevel[globalRegioni] + + globalLevelIncr[surfi]; - if (globalPatchInfo.set(surfI)) + if (globalPatchInfo.set(surfi)) { patchInfo.set ( - globalRegionI, - globalPatchInfo[surfI].clone() + globalRegioni, + globalPatchInfo[surfi].clone() ); } } // Overwrite with region specific information - forAllConstIter(Map