diff --git a/applications/solvers/Lagrangian/reactingParcelFoam/Make/files b/applications/solvers/Lagrangian/reactingParcelFoam/Make/files index ea13ecb0c5..3710ca4e2d 100644 --- a/applications/solvers/Lagrangian/reactingParcelFoam/Make/files +++ b/applications/solvers/Lagrangian/reactingParcelFoam/Make/files @@ -1,3 +1,3 @@ reactingParcelFoam.C -EXE = $(FOAM_USER_APPBIN)/reactingParcelFoam +EXE = $(FOAM_APPBIN)/reactingParcelFoam diff --git a/applications/solvers/combustion/coalChemistryFoam/Make/files b/applications/solvers/combustion/coalChemistryFoam/Make/files index 6a1392f01c..552d734501 100644 --- a/applications/solvers/combustion/coalChemistryFoam/Make/files +++ b/applications/solvers/combustion/coalChemistryFoam/Make/files @@ -1,3 +1,3 @@ coalChemistryFoam.C -EXE = $(FOAM_USER_APPBIN)/coalChemistryFoam +EXE = $(FOAM_APPBIN)/coalChemistryFoam diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqn.H b/applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqn.H index c126025368..d152baba0b 100644 --- a/applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqn.H +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqn.H @@ -3,7 +3,11 @@ ( fvm::ddt(alpha1) + fvm::div(phi, alpha1) - - fvm::laplacian(Dab, alpha1) + - fvm::laplacian + ( + Dab + alphatab*turbulence->nut(), alpha1, + "laplacian(Dab,alpha1)" + ) ); alpha1Eqn.solve(); diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/createFields.H b/applications/solvers/multiphase/twoLiquidMixingFoam/createFields.H index a38135dc19..3b5e064372 100644 --- a/applications/solvers/multiphase/twoLiquidMixingFoam/createFields.H +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/createFields.H @@ -50,6 +50,9 @@ dimensionedScalar Dab(twoPhaseProperties.lookup("Dab")); + // Read the reciprocal of the turbulent Schmidt number + dimensionedScalar alphatab(twoPhaseProperties.lookup("alphatab")); + // Need to store rho for ddt(rho, U) volScalarField rho("rho", alpha1*rho1 + (scalar(1) - alpha1)*rho2); rho.oldTime(); diff --git a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C index 65dd679ecd..a26179507a 100644 --- a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C +++ b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C @@ -566,7 +566,7 @@ int main(int argc, char *argv[]) IOobject ( "cellProcAddressing", - "constant", + procMesh.facesInstance(), procMesh.meshSubDir, procMesh, IOobject::MUST_READ, @@ -579,7 +579,7 @@ int main(int argc, char *argv[]) IOobject ( "boundaryProcAddressing", - "constant", + procMesh.facesInstance(), procMesh.meshSubDir, procMesh, IOobject::MUST_READ, @@ -603,7 +603,7 @@ int main(int argc, char *argv[]) IOobject ( "faceProcAddressing", - "constant", + procMesh.facesInstance(), procMesh.meshSubDir, procMesh, IOobject::MUST_READ, @@ -645,7 +645,7 @@ int main(int argc, char *argv[]) IOobject ( "pointProcAddressing", - "constant", + procMesh.facesInstance(), procMesh.meshSubDir, procMesh, IOobject::MUST_READ, diff --git a/applications/utilities/parallelProcessing/decomposePar/decomposeParDict b/applications/utilities/parallelProcessing/decomposePar/decomposeParDict index 0c566d5081..aad15ee459 100644 --- a/applications/utilities/parallelProcessing/decomposePar/decomposeParDict +++ b/applications/utilities/parallelProcessing/decomposePar/decomposeParDict @@ -55,7 +55,17 @@ metisCoeffs } scotchCoeffs -{} +{ + //processorWeights + //( + // 1 + // 1 + // 1 + // 1 + //); + //writeGraph true; + //strategy "b"; +} manualCoeffs { diff --git a/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C b/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C index 2940577d16..e310cc758f 100644 --- a/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C +++ b/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C @@ -269,7 +269,7 @@ bool domainDecomposition::writeDecomposition() IOobject ( this->polyMesh::name(), // region name of undecomposed mesh - "constant", + pointsInstance(), processorDb ), xferMove(procPoints), @@ -620,7 +620,7 @@ bool domainDecomposition::writeDecomposition() IOobject ( "pointProcAddressing", - "constant", + procMesh.facesInstance(), procMesh.meshSubDir, procMesh, IOobject::NO_READ, @@ -635,7 +635,7 @@ bool domainDecomposition::writeDecomposition() IOobject ( "faceProcAddressing", - "constant", + procMesh.facesInstance(), procMesh.meshSubDir, procMesh, IOobject::NO_READ, @@ -650,7 +650,7 @@ bool domainDecomposition::writeDecomposition() IOobject ( "cellProcAddressing", - "constant", + procMesh.facesInstance(), procMesh.meshSubDir, procMesh, IOobject::NO_READ, @@ -665,7 +665,7 @@ bool domainDecomposition::writeDecomposition() IOobject ( "boundaryProcAddressing", - "constant", + procMesh.facesInstance(), procMesh.meshSubDir, procMesh, IOobject::NO_READ, diff --git a/applications/utilities/postProcessing/patch/patchIntegrate/patchIntegrate.C b/applications/utilities/postProcessing/patch/patchIntegrate/patchIntegrate.C index dc92aade57..54acae0025 100644 --- a/applications/utilities/postProcessing/patch/patchIntegrate/patchIntegrate.C +++ b/applications/utilities/postProcessing/patch/patchIntegrate/patchIntegrate.C @@ -78,7 +78,7 @@ int main(int argc, char *argv[]) // Give patch area if (isType(mesh.boundaryMesh()[patchi])) { - Info<< " Cyclic patch area: " << nl; + Info<< " Cyclic patch vector area: " << nl; label nFaces = mesh.boundaryMesh()[patchi].size(); vector sum1 = vector::zero; vector sum2 = vector::zero; @@ -92,12 +92,18 @@ int main(int argc, char *argv[]) Info<< " - half 1 = " << sum1 << ", " << mag(sum1) << nl << " - half 2 = " << sum2 << ", " << mag(sum2) << nl << " - total = " << (sum1 + sum2) << ", " - << mag(sum1 + sum2) << endl;; + << mag(sum1 + sum2) << endl; + Info<< " Cyclic patch area magnitude = " + << gSum(mesh.magSf().boundaryField()[patchi])/2.0 << endl; } else { - Info<< " Patch area = " + Info<< " Area vector of patch " + << patchName << '[' << patchi << ']' << " = " << gSum(mesh.Sf().boundaryField()[patchi]) << endl; + Info<< " Area magnitude of patch " + << patchName << '[' << patchi << ']' << " = " + << gSum(mesh.magSf().boundaryField()[patchi]) << endl; } // Read field and calc integral @@ -107,15 +113,26 @@ int main(int argc, char *argv[]) << fieldName << endl; volScalarField field(fieldHeader, mesh); - vector sumField = gSum - ( - mesh.Sf().boundaryField()[patchi] - *field.boundaryField()[patchi] - ); - Info<< " Integral of " << fieldName << " over patch " + Info<< " Integral of " << fieldName + << " over vector area of patch " << patchName << '[' << patchi << ']' << " = " - << sumField << nl; + << gSum + ( + mesh.Sf().boundaryField()[patchi] + *field.boundaryField()[patchi] + ) + << nl; + + Info<< " Integral of " << fieldName + << " over area magnitude of patch " + << patchName << '[' << patchi << ']' << " = " + << gSum + ( + mesh.magSf().boundaryField()[patchi] + *field.boundaryField()[patchi] + ) + << nl; } else if ( diff --git a/applications/utilities/postProcessing/wall/yPlusLES/Make/options b/applications/utilities/postProcessing/wall/yPlusLES/Make/options index 79fbbac91e..f6131ce41c 100644 --- a/applications/utilities/postProcessing/wall/yPlusLES/Make/options +++ b/applications/utilities/postProcessing/wall/yPlusLES/Make/options @@ -1,4 +1,5 @@ EXE_INC = \ + -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels/incompressible/LES/LESModel \ -I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \ diff --git a/applications/utilities/postProcessing/wall/yPlusLES/yPlusLES.C b/applications/utilities/postProcessing/wall/yPlusLES/yPlusLES.C index 82ee27fa0a..67dc0df3f0 100644 --- a/applications/utilities/postProcessing/wall/yPlusLES/yPlusLES.C +++ b/applications/utilities/postProcessing/wall/yPlusLES/yPlusLES.C @@ -34,6 +34,7 @@ Description #include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H" #include "LESModel.H" #include "nearWallDist.H" +#include "wallDist.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -49,7 +50,18 @@ int main(int argc, char *argv[]) { runTime.setTime(timeDirs[timeI], timeI); Info<< "Time = " << runTime.timeName() << endl; - mesh.readUpdate(); + fvMesh::readUpdateState state = mesh.readUpdate(); + + // Wall distance + if (timeI == 0 || state != fvMesh::UNCHANGED) + { + Info<< "Calculating wall distance\n" << endl; + wallDist y(mesh, true); + Info<< "Writing wall distance to field " + << y.name() << nl << endl; + y.write(); + } + volScalarField yPlus ( @@ -116,6 +128,9 @@ int main(int argc, char *argv[]) } } + Info<< "Writing yPlus to field " + << yPlus.name() << nl << endl; + yPlus.write(); } diff --git a/applications/utilities/postProcessing/wall/yPlusRAS/Make/options b/applications/utilities/postProcessing/wall/yPlusRAS/Make/options index 89632547e0..9ec5fca52b 100644 --- a/applications/utilities/postProcessing/wall/yPlusRAS/Make/options +++ b/applications/utilities/postProcessing/wall/yPlusRAS/Make/options @@ -1,4 +1,5 @@ EXE_INC = \ + -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels/incompressible/RAS/RASModel \ diff --git a/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C b/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C index 7d1e4796f2..a93712263e 100644 --- a/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C +++ b/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C @@ -34,6 +34,7 @@ Description #include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H" #include "RASModel.H" #include "wallFvPatch.H" +#include "wallDist.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -49,7 +50,17 @@ int main(int argc, char *argv[]) { runTime.setTime(timeDirs[timeI], timeI); Info<< "Time = " << runTime.timeName() << endl; - mesh.readUpdate(); + fvMesh::readUpdateState state = mesh.readUpdate(); + + // Wall distance + if (timeI == 0 || state != fvMesh::UNCHANGED) + { + Info<< "Calculating wall distance\n" << endl; + wallDist y(mesh, true); + Info<< "Writing wall distance to field " + << y.name() << nl << endl; + y.write(); + } volScalarField yPlus ( @@ -106,6 +117,9 @@ int main(int argc, char *argv[]) } } + Info<< "Writing yPlus to field " + << yPlus.name() << nl << endl; + yPlus.write(); } diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndex.H b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndex.H index 5f7ed0a2b2..c74d82b182 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndex.H +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndex.H @@ -84,6 +84,9 @@ public: //- Start of procI+1 data inline const labelList& offsets() const; + //- my local size + inline label localSize() const; + //- Global sum of localSizes inline label size() const; diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndexI.H b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndexI.H index b01ed6e8ba..65f5d2d9d0 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndexI.H +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndexI.H @@ -34,6 +34,17 @@ inline const Foam::labelList& Foam::globalIndex::offsets() const } +inline Foam::label Foam::globalIndex::localSize() const +{ + return + ( + Pstream::myProcNo() == 0 + ? offsets_[Pstream::myProcNo()] + : offsets_[Pstream::myProcNo()] - offsets_[Pstream::myProcNo()-1] + ); +} + + inline Foam::label Foam::globalIndex::size() const { return offsets_[Pstream::nProcs()-1]; diff --git a/src/decompositionMethods/decompositionMethods/scotchDecomp/scotchDecomp.C b/src/decompositionMethods/decompositionMethods/scotchDecomp/scotchDecomp.C index a33e49b828..994a824192 100644 --- a/src/decompositionMethods/decompositionMethods/scotchDecomp/scotchDecomp.C +++ b/src/decompositionMethods/decompositionMethods/scotchDecomp/scotchDecomp.C @@ -75,6 +75,24 @@ extern "C" } +// Hack: scotch generates floating point errors so need to switch of error +// trapping! +#if defined(linux) || defined(linuxAMD64) || defined(linuxIA64) +# define LINUX +#endif + +#if defined(LINUX) && defined(__GNUC__) +# define LINUX_GNUC +#endif + +#ifdef LINUX_GNUC +# ifndef __USE_GNU +# define __USE_GNU +# endif +# include +#endif + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam @@ -113,13 +131,30 @@ Foam::label Foam::scotchDecomp::decompose { // Strategy // ~~~~~~~~ + // Default. SCOTCH_Strat stradat; check(SCOTCH_stratInit(&stradat), "SCOTCH_stratInit"); - //SCOTCH_stratGraphMap(&stradat, &argv[i][2]); - //fprintf(stdout, "S\tStrat="); - //SCOTCH_stratSave(&stradat, stdout); - //fprintf(stdout, "\n"); + + if (decompositionDict_.found("scotchCoeffs")) + { + const dictionary& scotchCoeffs = + decompositionDict_.subDict("scotchCoeffs"); + + + string strategy; + if (scotchCoeffs.readIfPresent("strategy", strategy)) + { + if (debug) + { + Info<< "scotchDecomp : Using strategy " << strategy << endl; + } + SCOTCH_stratGraphMap(&stradat, strategy.c_str()); + //fprintf(stdout, "S\tStrat="); + //SCOTCH_stratSave(&stradat, stdout); + //fprintf(stdout, "\n"); + } + } // Graph @@ -153,37 +188,40 @@ Foam::label Foam::scotchDecomp::decompose const dictionary& scotchCoeffs = decompositionDict_.subDict("scotchCoeffs"); - Switch writeGraph(scotchCoeffs.lookup("writeGraph")); - - if (writeGraph) + if (scotchCoeffs.found("writeGraph")) { - OFstream str(mesh_.time().path() / mesh_.name() + ".grf"); + Switch writeGraph(scotchCoeffs.lookup("writeGraph")); - Info<< "Dumping Scotch graph file to " << str.name() << endl - << "Use this in combination with gpart." << endl; - - label version = 0; - str << version << nl; - // Numer of vertices - str << xadj.size()-1 << ' ' << adjncy.size() << nl; - // Numbering starts from 0 - label baseval = 0; - // Has weights? - label hasEdgeWeights = 0; - label hasVertexWeights = 0; - label numericflag = 10*hasEdgeWeights+hasVertexWeights; - str << baseval << ' ' << numericflag << nl; - for (label cellI = 0; cellI < xadj.size()-1; cellI++) + if (writeGraph) { - label start = xadj[cellI]; - label end = xadj[cellI+1]; - str << end-start; + OFstream str(mesh_.time().path() / mesh_.name() + ".grf"); - for (label i = start; i < end; i++) + Info<< "Dumping Scotch graph file to " << str.name() << endl + << "Use this in combination with gpart." << endl; + + label version = 0; + str << version << nl; + // Numer of vertices + str << xadj.size()-1 << ' ' << adjncy.size() << nl; + // Numbering starts from 0 + label baseval = 0; + // Has weights? + label hasEdgeWeights = 0; + label hasVertexWeights = 0; + label numericflag = 10*hasEdgeWeights+hasVertexWeights; + str << baseval << ' ' << numericflag << nl; + for (label cellI = 0; cellI < xadj.size()-1; cellI++) { - str << ' ' << adjncy[i]; + label start = xadj[cellI]; + label end = xadj[cellI+1]; + str << end-start; + + for (label i = start; i < end; i++) + { + str << ' ' << adjncy[i]; + } + str << nl; } - str << nl; } } } @@ -195,12 +233,36 @@ Foam::label Foam::scotchDecomp::decompose SCOTCH_Arch archdat; check(SCOTCH_archInit(&archdat), "SCOTCH_archInit"); - check - ( - // SCOTCH_archCmpltw for weighted. - SCOTCH_archCmplt(&archdat, nProcessors_), - "SCOTCH_archCmplt" - ); + + List