diff --git a/applications/solvers/compressible/sonicDyMFoam/UEqn.H b/applications/solvers/compressible/sonicDyMFoam/UEqn.H index 54edd4e23..a6908756c 100644 --- a/applications/solvers/compressible/sonicDyMFoam/UEqn.H +++ b/applications/solvers/compressible/sonicDyMFoam/UEqn.H @@ -7,7 +7,10 @@ UEqn.relax ( - mesh.solutionDict().equationRelaxationFactor(U.select(pimple.finalIter())) + mesh.solutionDict().equationRelaxationFactor + ( + U.select(pimple.finalIter()) + ) ); solve(UEqn == -fvc::grad(p)); diff --git a/applications/solvers/compressible/sonicFoam/pEqn.H b/applications/solvers/compressible/sonicFoam/pEqn.H index 686acebaa..bd9dab41a 100644 --- a/applications/solvers/compressible/sonicFoam/pEqn.H +++ b/applications/solvers/compressible/sonicFoam/pEqn.H @@ -27,8 +27,6 @@ fvm::ddt(psis, p) + fvm::div(phid, p) // Convective flux relaxation terms - + fvm::SuSp(-divPhid, p) - + divPhid*p + fvc::div(phid2) - fvm::laplacian(rho*rUA, p) ); diff --git a/applications/solvers/engine/sonicTurbDyMEngineFoam/UEqn.H b/applications/solvers/engine/sonicTurbDyMEngineFoam/UEqn.H index 9c11a3332..32bd0e614 100644 --- a/applications/solvers/engine/sonicTurbDyMEngineFoam/UEqn.H +++ b/applications/solvers/engine/sonicTurbDyMEngineFoam/UEqn.H @@ -8,7 +8,10 @@ UEqn.relax ( - mesh.solutionDict().equationRelaxationFactor(U.select(pimple.finalIter())) + mesh.solutionDict().equationRelaxationFactor + ( + U.select(pimple.finalIter()) + ) ); solve(UEqn == -fvc::grad(p)); diff --git a/applications/solvers/engine/sonicTurbDyMEngineFoam/hEqn.H b/applications/solvers/engine/sonicTurbDyMEngineFoam/hEqn.H index 530b4ef30..261366d08 100644 --- a/applications/solvers/engine/sonicTurbDyMEngineFoam/hEqn.H +++ b/applications/solvers/engine/sonicTurbDyMEngineFoam/hEqn.H @@ -12,4 +12,8 @@ hEqn.solve(); thermo.correct(); + + // Recalculate density + rho = thermo.rho(); + rho.correctBoundaryConditions(); } diff --git a/applications/solvers/engine/sonicTurbDyMEngineFoam/pEqn.H b/applications/solvers/engine/sonicTurbDyMEngineFoam/pEqn.H index 45d692a63..dd396282e 100644 --- a/applications/solvers/engine/sonicTurbDyMEngineFoam/pEqn.H +++ b/applications/solvers/engine/sonicTurbDyMEngineFoam/pEqn.H @@ -1,6 +1,4 @@ { - rho = thermo.rho(); - rUA = 1.0/UEqn.A(); U = rUA*UEqn.H(); @@ -56,12 +54,10 @@ p.relax(); } -# include "rhoEqn.H" # include "compressibleContinuityErrs.H" U -= rUA*fvc::grad(p); U.correctBoundaryConditions(); DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); - dpdt = fvc::ddt(p); } diff --git a/applications/solvers/engine/sonicTurbDyMEngineFoam/sonicTurbDyMEngineFoam.C b/applications/solvers/engine/sonicTurbDyMEngineFoam/sonicTurbDyMEngineFoam.C index 587c19dc6..dd8707474 100644 --- a/applications/solvers/engine/sonicTurbDyMEngineFoam/sonicTurbDyMEngineFoam.C +++ b/applications/solvers/engine/sonicTurbDyMEngineFoam/sonicTurbDyMEngineFoam.C @@ -79,14 +79,15 @@ int main(int argc, char *argv[]) Info<< "Crank angle = " << runTime.theta() << " CA-deg" << endl; - // Make flux absolute - phi += meshFlux; + // Make the fluxes absolute (using the ddt(rho, U) scheme) + phi += fvc::interpolate(rho)*fvc::meshPhi(rho, U); bool meshChanged = mesh.update(); # include "volContinuity.H" - mesh.setBoundaryVelocity(U); + // Make the fluxes relative (using the ddt(rho, U) scheme) + phi -= fvc::interpolate(rho)*fvc::meshPhi(rho, U); if (meshChanged) { @@ -95,14 +96,7 @@ int main(int argc, char *argv[]) rho.correctBoundaryConditions(); } - meshFlux = fvc::interpolate(rho)*fvc::meshPhi(rho, U); - - phi = fvc::interpolate(rho) - *((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U)); - - DpDt = dpdt + fvc::div(phi/fvc::interpolate(rho), p) - - fvc::div(phi/fvc::interpolate(rho) + fvc::meshPhi(U))*p; - + if (meshChanged) { # include "compressibleCourantNo.H" } @@ -111,22 +105,20 @@ int main(int argc, char *argv[]) while (pimple.loop()) { # include "rhoEqn.H" +# include "hEqn.H" # include "UEqn.H" // --- PISO loop while (pimple.correct()) { # include "pEqn.H" -# include "hEqn.H" } + + turbulence->correct(); } - turbulence->correct(); - # include "logSummary.H" - rho = thermo.rho(); - runTime.write(); # include "infoDataOutput.H" diff --git a/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C b/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C index 1eef9c952..975c4f809 100644 --- a/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C +++ b/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C @@ -338,30 +338,39 @@ autoPtr reorderMesh ( new mapPolyMesh ( - mesh, //const polyMesh& mesh, + mesh, // const polyMesh& mesh, mesh.nPoints(), // nOldPoints, mesh.nFaces(), // nOldFaces, mesh.nCells(), // nOldCells, + identity(mesh.nPoints()), // pointMap, List(0), // pointsFromPoints, + faceOrder, // faceMap, List(0), // facesFromPoints, List(0), // facesFromEdges, List(0), // facesFromFaces, + cellOrder, // cellMap, List(0), // cellsFromPoints, List(0), // cellsFromEdges, List(0), // cellsFromFaces, List(0), // cellsFromCells, + identity(mesh.nPoints()), // reversePointMap, reverseFaceOrder, // reverseFaceMap, reverseCellOrder, // reverseCellMap, + labelHashSet(0), // flipFaceFlux, + patchPointMap, // patchPointMap, labelListList(0), // pointZoneMap, labelListList(0), // faceZonePointMap, labelListList(0), // faceZoneFaceMap, labelListList(0), // cellZoneMap, + + boolList(mesh.boundaryMesh().size(), false), // resetPatchFlag + pointField(0), // preMotionPoints, patchStarts, // oldPatchStarts, oldPatchNMeshPoints // oldPatchNMeshPoints diff --git a/applications/utilities/parallelProcessing/decomposePar/Make/files b/applications/utilities/parallelProcessing/decomposePar/Make/files index a86648f25..8e29865cd 100644 --- a/applications/utilities/parallelProcessing/decomposePar/Make/files +++ b/applications/utilities/parallelProcessing/decomposePar/Make/files @@ -1,12 +1,3 @@ -decomposeMesh.C decomposePar.C -domainDecomposition.C -distributeCells.C -faMeshDecomposition.C -fvFieldDecomposer.C -faFieldDecomposer.C -pointFieldDecomposer.C -tetPointFieldDecomposer.C -lagrangianFieldDecomposer.C EXE = $(FOAM_APPBIN)/decomposePar diff --git a/applications/utilities/parallelProcessing/decomposePar/Make/options b/applications/utilities/parallelProcessing/decomposePar/Make/options index 682187cd5..eb2754920 100644 --- a/applications/utilities/parallelProcessing/decomposePar/Make/options +++ b/applications/utilities/parallelProcessing/decomposePar/Make/options @@ -1,5 +1,6 @@ EXE_INC = \ -I$(LIB_SRC)/decompositionMethods/decompositionMethods/lnInclude \ + -I$(LIB_SRC)/decompositionMethods/decomposeReconstruct/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteArea/lnInclude \ @@ -8,6 +9,7 @@ EXE_INC = \ EXE_LIBS = \ -ldecompositionMethods \ + -ldecomposeReconstruct \ -lmeshTools \ -lfiniteVolume \ -lfiniteArea \ diff --git a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C index 06ba968ae..42071d39a 100644 --- a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C +++ b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C @@ -235,26 +235,45 @@ int main(int argc, char *argv[]) } Info<< "Create mesh for region " << regionName << endl; - domainDecomposition mesh + fvMesh mesh ( IOobject ( regionName, runTime.timeName(), - runTime + runTime, + IOobject::MUST_READ, + IOobject::NO_WRITE ) ); + domainDecomposition meshDecomp + ( + mesh, + IOdictionary + ( + IOobject + ( + "decomposeParDict", + runTime.system(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ) + ); + + // Decompose the mesh if (!decomposeFieldsOnly) { - mesh.decomposeMesh(filterPatches); + meshDecomp.decomposeMesh(filterPatches); - mesh.writeDecomposition(); + meshDecomp.writeDecomposition(); if (writeCellDist) { - const labelList& procIds = mesh.cellToProc(); + const labelList& procIds = meshDecomp.cellToProc(); // Write the decomposition as labelList for use with 'manual' // decomposition method. @@ -345,7 +364,7 @@ int main(int argc, char *argv[]) // Construct the point fields // ~~~~~~~~~~~~~~~~~~~~~~~~~~ - pointMesh pMesh(mesh); + const pointMesh& pMesh = pointMesh::New(mesh); PtrList pointScalarFields; readFields(pMesh, objects, pointScalarFields); @@ -595,7 +614,7 @@ int main(int argc, char *argv[]) Info<< endl; // Split the fields over processors - for (label procI = 0; procI < mesh.nProcs(); procI++) + for (label procI = 0; procI < meshDecomp.nProcs(); procI++) { Info<< "Processor " << procI << ": field transfer" << endl; @@ -632,6 +651,7 @@ int main(int argc, char *argv[]) processorDb ) ); + procMesh.syncUpdateMesh(); labelIOList cellProcAddressing ( @@ -872,7 +892,7 @@ int main(int argc, char *argv[]) { const fileName timePath = processorDb.timePath(); - if (copyUniform || mesh.distributed()) + if (copyUniform || meshDecomp.distributed()) { cp ( @@ -962,7 +982,7 @@ int main(int argc, char *argv[]) Info << endl; // Split the fields over processors - for (label procI = 0; procI < mesh.nProcs(); procI++) + for (label procI = 0; procI < meshDecomp.nProcs(); procI++) { Info<< "Processor " << procI << ": finite area field transfer" << endl; diff --git a/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C b/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C deleted file mode 100644 index 015761d1b..000000000 --- a/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C +++ /dev/null @@ -1,694 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | foam-extend: Open Source CFD - \\ / O peration | Version: 4.0 - \\ / A nd | Web: http://www.foam-extend.org - \\/ M anipulation | For copyright notice see file Copyright -------------------------------------------------------------------------------- -License - This file is part of foam-extend. - - foam-extend is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation, either version 3 of the License, or (at your - option) any later version. - - foam-extend is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with foam-extend. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "domainDecomposition.H" -#include "foamTime.H" -#include "dictionary.H" -#include "labelIOList.H" -#include "processorPolyPatch.H" -#include "fvMesh.H" -#include "OSspecific.H" -#include "Map.H" -#include "globalMeshData.H" -#include "DynamicList.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -domainDecomposition::domainDecomposition(const IOobject& io) -: - fvMesh(io), - decompositionDict_ - ( - IOobject - ( - "decomposeParDict", - time().system(), - *this, - IOobject::MUST_READ, - IOobject::NO_WRITE - ) - ), - nProcs_(readInt(decompositionDict_.lookup("numberOfSubdomains"))), - distributed_(false), - cellToProc_(nCells()), - procPointAddressing_(nProcs_), - procFaceAddressing_(nProcs_), - nInternalProcFaces_(nProcs_), - nLiveProcFaces_(nProcs_), - procCellAddressing_(nProcs_), - procBoundaryAddressing_(nProcs_), - procPatchSize_(nProcs_), - procPatchStartIndex_(nProcs_), - procNeighbourProcessors_(nProcs_), - procProcessorPatchSize_(nProcs_), - procProcessorPatchStartIndex_(nProcs_), - globallySharedPoints_(0), - cyclicParallel_(false) -{ - if (decompositionDict_.found("distributed")) - { - distributed_ = Switch(decompositionDict_.lookup("distributed")); - } -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -domainDecomposition::~domainDecomposition() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -bool domainDecomposition::writeDecomposition() -{ - Info<< "\nConstructing processor meshes" << endl; - - // Make a lookup map for globally shared points - Map