diff --git a/applications/solvers/incompressible/pisoFoam/pisoFoam.C b/applications/solvers/incompressible/pisoFoam/pisoFoam.C index 555e6e0cfe..feacdd34ad 100644 --- a/applications/solvers/incompressible/pisoFoam/pisoFoam.C +++ b/applications/solvers/incompressible/pisoFoam/pisoFoam.C @@ -23,7 +23,7 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Application - turbFoam + pisoFoam Description Transient solver for incompressible flow. @@ -40,15 +40,14 @@ Description int main(int argc, char *argv[]) { + #include "setRootCase.H" -# include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + #include "createFields.H" + #include "initContinuityErrs.H" -# include "createTime.H" -# include "createMesh.H" -# include "createFields.H" -# include "initContinuityErrs.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; @@ -56,8 +55,8 @@ int main(int argc, char *argv[]) { Info<< "Time = " << runTime.timeName() << nl << endl; -# include "readPISOControls.H" -# include "CourantNo.H" + #include "readPISOControls.H" + #include "CourantNo.H" // Pressure-velocity PISO corrector { @@ -120,7 +119,7 @@ int main(int argc, char *argv[]) } } -# include "continuityErrs.H" + #include "continuityErrs.H" U -= rUA*fvc::grad(p); U.correctBoundaryConditions(); diff --git a/bin/foamPackSource b/bin/foamPackSource index 898fa6677e..c4d0fc7eb4 100755 --- a/bin/foamPackSource +++ b/bin/foamPackSource @@ -77,9 +77,9 @@ find -H $packDir \ -a ! -name "core.[1-9]*" \ -a ! -name "log[0-9]*" \ -a ! -name "libccmio*" \ - -a ! -name "\.ebrowse" \ | sed \ -e "\@$packDir/.git/@d" \ + -e "\@/.tags/@d" \ -e "\@$packDir/lib/@d" \ -e "\@libccmio.*/@d" \ -e '\@applications/bin/@d' \ diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZone.C b/src/finiteVolume/cfdTools/general/MRF/MRFZone.C index 8b689d0d66..7808ef5362 100644 --- a/src/finiteVolume/cfdTools/general/MRF/MRFZone.C +++ b/src/finiteVolume/cfdTools/general/MRF/MRFZone.C @@ -32,53 +32,96 @@ License #include "syncTools.H" #include "faceSet.H" +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(Foam::MRFZone, 0); + // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -void Foam::MRFZone::setMRFFaces -( - labelList& faceType, - const labelList& excludedPatchIDs -) +void Foam::MRFZone::setMRFFaces() { const polyBoundaryMesh& patches = mesh_.boundaryMesh(); - // Knock out coupled patches - forAll(patches, patchi) + // Type per face: + // 0:not in zone + // 1:moving with frame + // 2:other + labelList faceType(mesh_.nFaces(), 0); + + // Determine faces in cell zone + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // (without constructing cells) + + const labelList& own = mesh_.faceOwner(); + const labelList& nei = mesh_.faceNeighbour(); + + // Cells in zone + boolList zoneCell(mesh_.nCells(), false); + + if (cellZoneID_ != -1) { - if (patches[patchi].coupled()) + const labelList& cellLabels = mesh_.cellZones()[cellZoneID_]; + forAll(cellLabels, i) { - const polyPatch& pp = patches[patchi]; + zoneCell[cellLabels[i]] = true; + } + } - forAll(pp, j) + + label nZoneFaces = 0; + + for (label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++) + { + if (zoneCell[own[faceI]] || zoneCell[nei[faceI]]) + { + faceType[faceI] = 1; + nZoneFaces++; + } + } + + + labelHashSet excludedPatches(excludedPatchLabels_); + + forAll(patches, patchI) + { + const polyPatch& pp = patches[patchI]; + + if (pp.coupled() || excludedPatches.found(patchI)) + { + forAll(pp, i) { - label faceI = pp.start()+j; + label faceI = pp.start()+i; - if (faceType[faceI] == 1) + if (zoneCell[own[faceI]]) { faceType[faceI] = 2; + nZoneFaces++; + } + } + } + else if (!isA(pp)) + { + forAll(pp, i) + { + label faceI = pp.start()+i; + + if (zoneCell[own[faceI]]) + { + faceType[faceI] = 1; + nZoneFaces++; } } } } - // All explicitly provided exclusions - forAll(excludedPatchIDs, i) - { - const polyPatch& pp = patches[excludedPatchIDs[i]]; + // Now we have for faceType: + // 0 : face not in cellZone + // 1 : internal face or normal patch face + // 2 : coupled patch face or excluded patch face - forAll(pp, j) - { - label faceI = pp.start()+j; + // Sort into lists per patch. - if (faceType[faceI] == 1) - { - faceType[faceI] = 2; - } - } - } - - // Collect into lists per patch. internalFaces_.setSize(mesh_.nFaces()); label nInternal = 0; @@ -142,149 +185,43 @@ void Foam::MRFZone::setMRFFaces } } - //if (debug) - //{ - // faceSet internalFaces(mesh_, "internalFaces", internalFaces_); - // Pout<< "Writing internal faces in MRF zone to faceSet " - // << internalFaces.name() << endl; - // internalFaces.write(); - //} - //{ - // faceSet MRFFaces(mesh_, "includedFaces", 100); - // forAll(includedFaces_, patchi) - // { - // forAll(includedFaces_[patchi], i) - // { - // label patchFacei = includedFaces_[patchi][i]; - // MRFFaces.insert(patches[patchi].start()+patchFacei); - // } - // } - // Pout<< "Writing patch faces in MRF zone to faceSet " - // << MRFFaces.name() << endl; - // MRFFaces.write(); - //} - //{ - // faceSet excludedFaces(mesh_, "excludedFaces", 100); - // forAll(excludedFaces_, patchi) - // { - // forAll(excludedFaces_[patchi], i) - // { - // label patchFacei = excludedFaces_[patchi][i]; - // excludedFaces.insert(patches[patchi].start()+patchFacei); - // } - // } - // Pout<< "Writing faces in MRF zone with special handling to faceSet " - // << excludedFaces.name() << endl; - // excludedFaces.write(); - //} -} - -void Foam::MRFZone::setMRFFaces() -{ - const polyBoundaryMesh& patches = mesh_.boundaryMesh(); - - // Type per face: - // 0:not in zone - // 1:moving with frame - // 2:other - labelList faceType(mesh_.nFaces(), 0); - - bool faceZoneFound = (faceZoneID_ != -1); - reduce(faceZoneFound, orOp()); - - if (faceZoneFound) + if (debug) { - // Explicitly provided faces. - if (faceZoneID_ != -1) + faceSet internalFaces(mesh_, "internalFaces", internalFaces_); + Pout<< "Writing " << internalFaces.size() + << " internal faces in MRF zone to faceSet " + << internalFaces.name() << endl; + internalFaces.write(); + + faceSet MRFFaces(mesh_, "includedFaces", 100); + forAll(includedFaces_, patchi) { - const labelList& zoneFaces = mesh_.faceZones()[faceZoneID_]; - - forAll(zoneFaces, i) + forAll(includedFaces_[patchi], i) { - faceType[zoneFaces[i]] = 1; - } - - if (allPatchesMove_) - { - // Explicitly provided patches that do not move - setMRFFaces(faceType, patchLabels_); - } - else - { - setMRFFaces(faceType, labelList(0)); + label patchFacei = includedFaces_[patchi][i]; + MRFFaces.insert(patches[patchi].start()+patchFacei); } } + Pout<< "Writing " << MRFFaces.size() + << " patch faces in MRF zone to faceSet " + << MRFFaces.name() << endl; + MRFFaces.write(); + + faceSet excludedFaces(mesh_, "excludedFaces", 100); + forAll(excludedFaces_, patchi) + { + forAll(excludedFaces_[patchi], i) + { + label patchFacei = excludedFaces_[patchi][i]; + excludedFaces.insert(patches[patchi].start()+patchFacei); + } + } + Pout<< "Writing " << excludedFaces.size() + << " faces in MRF zone with special handling to faceSet " + << excludedFaces.name() << endl; + excludedFaces.write(); } - else - { - // Determine faces in cell zone - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - // (without constructing cells) - - const labelList& own = mesh_.faceOwner(); - const labelList& nei = mesh_.faceNeighbour(); - - // Cells in zone - boolList zoneCell(mesh_.nCells(), false); - - if (cellZoneID_ != -1) - { - const labelList& cellLabels = mesh_.cellZones()[cellZoneID_]; - forAll(cellLabels, i) - { - zoneCell[cellLabels[i]] = true; - } - } - - - label nZoneFaces = 0; - - for (label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++) - { - if (zoneCell[own[faceI]] || zoneCell[nei[faceI]]) - { - faceType[faceI] = 1; - nZoneFaces++; - } - } - forAll(patches, patchI) - { - const polyPatch& pp = patches[patchI]; - - if (!isA(pp)) - { - forAll(pp, i) - { - label faceI = pp.start()+i; - - if (zoneCell[own[faceI]]) - { - faceType[faceI] = 1; - nZoneFaces++; - } - } - } - } - syncTools::syncFaceList(mesh_, faceType, maxEqOp