diff --git a/applications/solvers/Lagrangian/reactingParcelFoam/Make/files b/applications/solvers/Lagrangian/reactingParcelFoam/Make/files index ea13ecb0c59ab2c13459051e71c737ee139cc06a..3710ca4e2df104e37cd2c720455d658fd102d2d0 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 6a1392f01cc62ffcfa923a26726558e36d3f78c9..552d73450173870f57cee6a4b126b16fd63d08be 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 c12602536870ab39e1a63a81062b143d5d360c00..d152baba0bb44a1f2cd042596f94030157e0f713 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 a38135dc19a968cd10cf38beec6b3a35a4e4165b..3b5e064372bae2278984d8585dd4a3fc95e385fb 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/decomposeParDict b/applications/utilities/parallelProcessing/decomposePar/decomposeParDict index 0c566d50812ffcdbd856d09f12ebac9244177468..aad15ee459b6e01cdf6fabba08eb2fa5b8c2a4dd 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/postProcessing/patch/patchIntegrate/patchIntegrate.C b/applications/utilities/postProcessing/patch/patchIntegrate/patchIntegrate.C index dc92aade57b699d0a6b4816c1825684b304b2575..54acae002582bfa1dcb5e09c5c20255be2c7bac4 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<cyclicPolyPatch>(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 79fbbac91eff3fd29abdd775aa543a905a0c1162..f6131ce41c17a8d8d5b852fe0e1f07e1d62308f6 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 82ee27fa0ab6580cfcece3f9854718ded7abe196..67dc0df3f0e8c333fb2996255b047c34f8455f3c 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 89632547e0815e442b8f0082777fabb715fbc981..9ec5fca52baaa1f55b00483950ab4cf2ad1f9909 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 7d1e4796f2b5f75ae740b31169a522bbc9dfbd9d..a93712263e6aafbc375270c815609afc5aae904f 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 5f7ed0a2b269f283af2a0c5f9f1d624c2bb83d97..c74d82b182d556b080368ee1e920579041f1871b 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 b01ed6e8ba8240ffd7903f721c4102663baeb5dc..65f5d2d9d06f4c50e49a0232184f0dd1aedeca92 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 a33e49b82889148fb6d3db92ff7d51dd3d2bc80e..994a82419285a24da2695f3e3850ee4580d1f8ac 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 <fenv.h> +#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"); - - 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++) - { - label start = xadj[cellI]; - label end = xadj[cellI+1]; - str << end-start; + Switch writeGraph(scotchCoeffs.lookup("writeGraph")); - for (label i = start; i < end; i++) + if (writeGraph) + { + OFstream str(mesh_.time().path() / mesh_.name() + ".grf"); + + 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<label> processorWeights; + if (decompositionDict_.found("scotchCoeffs")) + { + const dictionary& scotchCoeffs = + decompositionDict_.subDict("scotchCoeffs"); + + scotchCoeffs.readIfPresent("processorWeights", processorWeights); + } + if (processorWeights.size()) + { + if (debug) + { + Info<< "scotchDecomp : Using procesor weights " << processorWeights + << endl; + } + check + ( + SCOTCH_archCmpltw(&archdat, nProcessors_, processorWeights.begin()), + "SCOTCH_archCmpltw" + ); + } + else + { + check + ( + SCOTCH_archCmplt(&archdat, nProcessors_), + "SCOTCH_archCmplt" + ); + } //SCOTCH_Mapping mapdat; @@ -209,6 +271,16 @@ Foam::label Foam::scotchDecomp::decompose //SCOTCH_graphMapExit(&grafdat, &mapdat); + // Hack:switch off fpu error trapping +# ifdef LINUX_GNUC + int oldExcepts = fedisableexcept + ( + FE_DIVBYZERO + | FE_INVALID + | FE_OVERFLOW + ); +# endif + finalDecomp.setSize(xadj.size()-1); finalDecomp = 0; check @@ -223,6 +295,11 @@ Foam::label Foam::scotchDecomp::decompose "SCOTCH_graphMap" ); +# ifdef LINUX_GNUC + feenableexcept(oldExcepts); +# endif + + //finalDecomp.setSize(xadj.size()-1); //check diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.C index c31f5acc5c3888b49479e7f11b791ae28d51c25c..b6f48ff6ada8e214e41f83c848bafabdb32de46e 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.C @@ -113,7 +113,17 @@ void fixedFluxBuoyantPressureFvPatchScalarField::updateCoeffs() const fvPatchField<scalar>& rho = patch().lookupPatchField<volScalarField, scalar>("rho"); - gradient() = -rho.snGrad()*(g.value() & patch().Cf()); + // If the variable name is "pd" assume it is p - rho*g.h + // and set the gradient appropriately. + // Otherwise assume the variable is the static pressure. + if (dimensionedInternalField().name() == "pd") + { + gradient() = -rho.snGrad()*(g.value() & patch().Cf()); + } + else + { + gradient() = rho*(g.value() & patch().nf()); + } fixedGradientFvPatchScalarField::updateCoeffs(); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.H index 3ce584bf873cef5a8a88804dd0076b82145be4c5..8e433cb8f167f0304ec840bb270c4521c9230e5b 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.H @@ -26,7 +26,10 @@ Class Foam::fixedFluxBuoyantPressureFvPatchScalarField Description - Foam::fixedFluxBuoyantPressureFvPatchScalarField + Set the pressure gradient boundary condition appropriately for buoyant flow. + + If the variable name is "pd" assume it is p - rho*g.h and set the gradient + appropriately. Otherwise assume the variable is the static pressure. SourceFiles fixedFluxBuoyantPressureFvPatchScalarField.C diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedStencil.C b/src/finiteVolume/fvMesh/extendedStencil/extendedStencil.C index 1ff00db7ba44c2350e44de2b2845f8b563d491e6..38804ccbc104d07eefe56498a4a92f1ce4f27f99 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedStencil.C +++ b/src/finiteVolume/fvMesh/extendedStencil/extendedStencil.C @@ -31,168 +31,6 @@ License // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -// Calculates per face a list of global cell/face indices. -void Foam::extendedStencil::calcFaceStencil -( - const labelListList& globalCellCells, - labelListList& faceStencil -) -{ - const polyBoundaryMesh& patches = mesh_.boundaryMesh(); - const label nBnd = mesh_.nFaces()-mesh_.nInternalFaces(); - const labelList& own = mesh_.faceOwner(); - const labelList& nei = mesh_.faceNeighbour(); - - - // Determine neighbouring global cell Cells - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - labelListList neiGlobalCellCells(nBnd); - forAll(patches, patchI) - { - const polyPatch& pp = patches[patchI]; - - if (pp.coupled()) - { - label faceI = pp.start(); - - forAll(pp, i) - { - neiGlobalCellCells[faceI-mesh_.nInternalFaces()] = - globalCellCells[own[faceI]]; - faceI++; - } - } - } - syncTools::swapBoundaryFaceList(mesh_, neiGlobalCellCells, false); - - - - // Construct stencil in global numbering - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - faceStencil.setSize(mesh_.nFaces()); - - labelHashSet faceStencilSet; - - for (label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++) - { - faceStencilSet.clear(); - - const labelList& ownCCells = globalCellCells[own[faceI]]; - label globalOwn = ownCCells[0]; - // Insert cellCells - forAll(ownCCells, i) - { - faceStencilSet.insert(ownCCells[i]); - } - - const labelList& neiCCells = globalCellCells[nei[faceI]]; - label globalNei = neiCCells[0]; - // Insert cellCells - forAll(neiCCells, i) - { - faceStencilSet.insert(neiCCells[i]); - } - - // Guarantee owner first, neighbour second. - faceStencil[faceI].setSize(faceStencilSet.size()); - label n = 0; - faceStencil[faceI][n++] = globalOwn; - faceStencil[faceI][n++] = globalNei; - forAllConstIter(labelHashSet, faceStencilSet, iter) - { - if (iter.key() != globalOwn && iter.key() != globalNei) - { - faceStencil[faceI][n++] = iter.key(); - } - } - //Pout<< "internalface:" << faceI << " toc:" << faceStencilSet.toc() - // << " faceStencil:" << faceStencil[faceI] << endl; - } - forAll(patches, patchI) - { - const polyPatch& pp = patches[patchI]; - label faceI = pp.start(); - - if (pp.coupled()) - { - forAll(pp, i) - { - faceStencilSet.clear(); - - const labelList& ownCCells = globalCellCells[own[faceI]]; - label globalOwn = ownCCells[0]; - forAll(ownCCells, i) - { - faceStencilSet.insert(ownCCells[i]); - } - - // And the neighbours of the coupled cell - const labelList& neiCCells = - neiGlobalCellCells[faceI-mesh_.nInternalFaces()]; - label globalNei = neiCCells[0]; - forAll(neiCCells, i) - { - faceStencilSet.insert(neiCCells[i]); - } - - // Guarantee owner first, neighbour second. - faceStencil[faceI].setSize(faceStencilSet.size()); - label n = 0; - faceStencil[faceI][n++] = globalOwn; - faceStencil[faceI][n++] = globalNei; - forAllConstIter(labelHashSet, faceStencilSet, iter) - { - if (iter.key() != globalOwn && iter.key() != globalNei) - { - faceStencil[faceI][n++] = iter.key(); - } - } - - //Pout<< "coupledface:" << faceI - // << " toc:" << faceStencilSet.toc() - // << " faceStencil:" << faceStencil[faceI] << endl; - - faceI++; - } - } - else if (!isA<emptyPolyPatch>(pp)) - { - forAll(pp, i) - { - faceStencilSet.clear(); - - const labelList& ownCCells = globalCellCells[own[faceI]]; - label globalOwn = ownCCells[0]; - forAll(ownCCells, i) - { - faceStencilSet.insert(ownCCells[i]); - } - - // Guarantee owner first, neighbour second. - faceStencil[faceI].setSize(faceStencilSet.size()); - label n = 0; - faceStencil[faceI][n++] = globalOwn; - forAllConstIter(labelHashSet, faceStencilSet, iter) - { - if (iter.key() != globalOwn) - { - faceStencil[faceI][n++] = iter.key(); - } - } - - //Pout<< "boundaryface:" << faceI - // << " toc:" << faceStencilSet.toc() - // << " faceStencil:" << faceStencil[faceI] << endl; - - faceI++; - } - } - } -} - - Foam::autoPtr<Foam::mapDistribute> Foam::extendedStencil::calcDistributeMap ( const globalIndex& globalNumbering, diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedStencil.H b/src/finiteVolume/fvMesh/extendedStencil/extendedStencil.H index 6faff8f3a6c7219a69b594250d78c58476136637..a1c6d41474ed01ce6565afaf06b97427c7dbdc06 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedStencil.H +++ b/src/finiteVolume/fvMesh/extendedStencil/extendedStencil.H @@ -75,13 +75,6 @@ protected: // Protected Member Functions - //- Collect cell neighbours into extended stencil - void calcFaceStencil - ( - const labelListList& globalCellCells, - labelListList& faceStencil - ); - //- Calculate distribute map autoPtr<mapDistribute> calcDistributeMap ( diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/FitData/FitData.C b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/FitData/FitData.C index 18585bc645d1db5b13784960fd315f3e8165d824..7f432462b1376577857571a4c3a6d365b86c6524 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/FitData/FitData.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/FitData/FitData.C @@ -191,6 +191,13 @@ void Foam::FitData<FitDataType, ExtendedStencil, Polynomial>::calcFit ); } + // Additional weighting for constant and linear terms + for(label i = 0; i < B.n(); i++) + { + B[i][0] *= wts[0]; + B[i][1] *= wts[0]; + } + // Set the fit label stencilSize = C.size(); coeffsi.setSize(stencilSize); @@ -205,7 +212,7 @@ void Foam::FitData<FitDataType, ExtendedStencil, Polynomial>::calcFit for(label i=0; i<stencilSize; i++) { - coeffsi[i] = wts[i]*svd.VSinvUt()[0][i]; + coeffsi[i] = wts[0]*wts[i]*svd.VSinvUt()[0][i]; if (mag(coeffsi[i]) > maxCoeff) { maxCoeff = mag(coeffsi[i]); @@ -229,7 +236,8 @@ void Foam::FitData<FitDataType, ExtendedStencil, Polynomial>::calcFit // << " sing vals " << svd.S() << endl; // } - if (!goodFit) // (not good fit so increase weight in the centre) + if (!goodFit) // (not good fit so increase weight in the centre and weight + // for constant and linear terms) { // if (iIt == 7) // { @@ -237,7 +245,10 @@ void Foam::FitData<FitDataType, ExtendedStencil, Polynomial>::calcFit // ( // "FitData<Polynomial>::calcFit" // "(const List<point>& C, const label facei" - // ) << "Cannot fit face " << facei + // ) << "Cannot fit face " << facei << " iteration " << iIt + // << " with sum of weights " << sum(coeffsi) << nl + // << " Weights " << coeffsi << nl + // << " Linear weights " << wLin << " " << 1 - wLin << nl // << " sing vals " << svd.S() << endl; // } @@ -249,6 +260,12 @@ void Foam::FitData<FitDataType, ExtendedStencil, Polynomial>::calcFit B[0][j] *= 10; B[1][j] *= 10; } + + for(label i = 0; i < B.n(); i++) + { + B[i][0] *= 10; + B[i][1] *= 10; + } } } diff --git a/src/lagrangian/coalCombustion/Make/files b/src/lagrangian/coalCombustion/Make/files index c8fb192aea89081987d98a244d718aeb2b0d897e..b31ee16529164c5642272756982255d03f9312fc 100755 --- a/src/lagrangian/coalCombustion/Make/files +++ b/src/lagrangian/coalCombustion/Make/files @@ -19,4 +19,4 @@ submodels/surfaceReactionModel/COxidationKineticDiffusionLimitedRate/COxidationK submodels/surfaceReactionModel/COxidationMurphyShaddix/COxidationMurphyShaddix.C -LIB = $(FOAM_USER_LIBBIN)/libcoalCombustion +LIB = $(FOAM_LIBBIN)/libcoalCombustion diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelIO.C b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelIO.C index bbf58e49a04cfd0ccf3891ea318cf5824b6d2557..b836c1c412663db6213081458eee60b883b3cfe4 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelIO.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelIO.C @@ -276,15 +276,15 @@ Foam::Ostream& Foam::operator<< scalarField YSolidLoc = p.YSolid()*p.Y()[2]; if (os.format() == IOstream::ASCII) { - os << static_cast<const ReactingMultiphaseParcel<ParcelType>&>(p) + os << static_cast<const ReactingParcel<ParcelType>&>(p) << token::SPACE << YGasLoc << token::SPACE << YLiquidLoc << token::SPACE << YSolidLoc; } else { - os << static_cast<const ReactingMultiphaseParcel<ParcelType>&>(p); - os << YGasLoc << YLiquidLoc << YSolidLoc; + os << static_cast<const ReactingParcel<ParcelType>&>(p); + os << YGasLoc << YLiquidLoc << YSolidLoc; } // Check state of Ostream