diff --git a/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C b/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C index f6794e92b2..389a065935 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C +++ b/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C @@ -26,8 +26,13 @@ Application coalChemistryFoam Description - Transient solver for compressible, turbulent flow with coal and - limestone parcel injections, and combustion. + Transient solver for: + - compressible, + - turbulent flow, + with + - coal and limestone parcel injections, + - energy source, and + - combustion. \*---------------------------------------------------------------------------*/ @@ -38,7 +43,7 @@ Description #include "CoalCloud.H" #include "psiChemistryModel.H" #include "chemistrySolver.H" -#include "timeActivatedExplicitCellSource.H" +#include "timeActivatedExplicitSource.H" #include "radiationModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/lagrangian/coalChemistryFoam/createFields.H b/applications/solvers/lagrangian/coalChemistryFoam/createFields.H index f79e48c17b..d0a284a0e1 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/createFields.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/createFields.H @@ -127,10 +127,11 @@ fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p) ); - Info<< "\nConstructing explicit enthalpy cell source" << endl; - timeActivatedExplicitCellSource enthalpySource + Info<< "\nConstructing explicit enthalpy source" << endl; + scalarTimeActivatedExplicitSourceList enthalpySource ( - "enthalpySource", + "energy", mesh, - h.dimensions()*phi.dimensions()/mesh.V().dimensions() + dimEnergy/dimTime/dimVolume, + "h" ); diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/UEqn.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/UEqn.H index b408709aed..e77fe75dab 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/UEqn.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/UEqn.H @@ -7,6 +7,7 @@ == rho.dimensionedInternalField()*g + parcels.SU() + + momentumSource.Su() ); pZones.addResistance(UEqn); diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/YEqn.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/YEqn.H index 4e9c29815a..f54be04bb8 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/YEqn.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/YEqn.H @@ -28,7 +28,7 @@ tmp > mvConvection == parcels.Srho(i) + kappa*chemistry.RR(i)().dimensionedInternalField() - + pointMassSources.Su(i), + + massSource.Su(i), mesh.solver("Yi") ); diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createClouds.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createClouds.H index 2accb8e1c9..74a66b63e8 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createClouds.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createClouds.H @@ -1,5 +1,5 @@ Info<< "\nConstructing reacting cloud" << endl; -icoPoly8ThermoReactingCloud parcels +icoPoly8ThermoReactingMultiphaseCloud parcels ( "reactingCloud1", rho, diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createExplicitSources.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createExplicitSources.H new file mode 100644 index 0000000000..0f2b52e536 --- /dev/null +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createExplicitSources.H @@ -0,0 +1,27 @@ +Info<< "Creating mass source\n" << endl; +scalarTimeActivatedExplicitSourceList massSource +( + "mass", + mesh, + dimMass/dimTime/dimVolume, + composition.species() +); + + +Info<< "Creating momentum source\n" << endl; +vectorTimeActivatedExplicitSourceList momentumSource +( + "momentum", + mesh, + dimMass*dimVelocity/dimTime/dimVolume, + "U" +); + +Info<< "Creating energy source\n" << endl; +scalarTimeActivatedExplicitSourceList energySource +( + "energy", + mesh, + dimEnergy/dimTime/dimVolume, + "h" +); diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createMulticomponentPointSources.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createMulticomponentPointSources.H deleted file mode 100644 index 52de65dc50..0000000000 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createMulticomponentPointSources.H +++ /dev/null @@ -1,8 +0,0 @@ -Info<< "\nConstructing multi-component mass flow rate point sources" << endl; -timeActivatedExplicitMulticomponentPointSource pointMassSources -( - "pointMassSources", - mesh, - Y, - dimMass/dimVolume/dimTime -); diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/hEqn.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/hEqn.H index 6e6b0c763a..0715989df7 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/hEqn.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/hEqn.H @@ -39,6 +39,7 @@ pWork() + parcels.Sh() + radiation->Sh(thermo) + + energySource.Su() ); thermo.correct(); diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/pEqn.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/pEqn.H index 32657588b0..9d03624e43 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/pEqn.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/pEqn.H @@ -32,7 +32,7 @@ - fvm::laplacian(rho*rAU, p) == parcels.Srho() - + pointMassSources.Su() + + massSource.SuTot() ); if (corr == nCorr-1 && nonOrth == nNonOrthCorr) diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/porousExplicitSourceReactingParcelFoam.C b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/porousExplicitSourceReactingParcelFoam.C index bf0a16af28..b345ffe28a 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/porousExplicitSourceReactingParcelFoam.C +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/porousExplicitSourceReactingParcelFoam.C @@ -27,10 +27,11 @@ Application Description Transient PISO solver for compressible, laminar or turbulent flow with - reacting Lagrangian parcels for porous media, including explicit sources + reacting multiphase Lagrangian parcels for porous media, including explicit + sources for mass, momentum and energy The solver includes: - - reacting parcel cloud + - reacting multiphase parcel cloud - porous media - point mass sources - polynomial based, incompressible thermodynamics (f(T)) @@ -43,12 +44,12 @@ Description #include "fvCFD.H" #include "hReactionThermo.H" #include "turbulenceModel.H" -#include "BasicReactingCloud.H" +#include "BasicReactingMultiphaseCloud.H" #include "rhoChemistryModel.H" #include "chemistrySolver.H" #include "radiationModel.H" #include "porousZones.H" -#include "timeActivatedExplicitMulticomponentPointSource.H" +#include "timeActivatedExplicitSource.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -63,7 +64,7 @@ int main(int argc, char *argv[]) #include "createFields.H" #include "createRadiationModel.H" #include "createClouds.H" - #include "createMulticomponentPointSources.H" + #include "createExplicitSources.H" #include "createPorousZones.H" #include "initContinuityErrs.H" #include "readTimeControls.H" diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/rhoEqn.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/rhoEqn.H index 5bc5e120a0..50f3beb603 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/rhoEqn.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/rhoEqn.H @@ -37,7 +37,7 @@ Description + fvc::div(phi) == parcels.Srho() - + pointMassSources.Su() + + massSource.SuTot() ); rhoEqn.relax(); diff --git a/applications/test/globalMeshData/globalMeshDataTest.C b/applications/test/globalMeshData/globalMeshDataTest.C index 75f98b1b9c..47c062433e 100644 --- a/applications/test/globalMeshData/globalMeshDataTest.C +++ b/applications/test/globalMeshData/globalMeshDataTest.C @@ -53,7 +53,7 @@ int main(int argc, char *argv[]) const indirectPrimitivePatch& coupledPatch = globalData.coupledPatch(); - // Test:print shared points + // Test:print (collocated) shared points { const labelListList& globalPointSlaves = globalData.globalPointSlaves(); @@ -90,7 +90,7 @@ int main(int argc, char *argv[]) - // Test: point to faces addressing + // Test: (collocated) point to faces addressing { const labelListList& globalPointBoundaryFaces = globalData.globalPointBoundaryFaces(); @@ -137,7 +137,7 @@ int main(int argc, char *argv[]) - // Test:point to cells addressing + // Test:(collocated) point to cells addressing { const labelList& boundaryCells = globalData.boundaryCells(); const labelListList& globalPointBoundaryCells = @@ -172,7 +172,7 @@ int main(int argc, char *argv[]) - // Test:print shared edges + // Test:print (collocated) shared edges { const labelListList& globalEdgeSlaves = globalData.globalEdgeSlaves(); diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/checkData.H b/applications/utilities/postProcessing/dataConversion/foamToEnsight/checkData.H index 1144833a01..76b55aada7 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/checkData.H +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/checkData.H @@ -1,7 +1,7 @@ // ignore special fields or fields that we don't handle // bool variableGood = true; -for (label n1=startTime; n1 2 && fieldName(fieldName.size() - 2, 2) == "_0") diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightCaseTail.H b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightCaseTail.H index 0ddde7448a..6ec8373fcf 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightCaseTail.H +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightCaseTail.H @@ -19,7 +19,7 @@ if (Pstream::master()) Info<< "Correcting time values. Adding " << Tcorr << endl; } - for (int n=startTime; n& pf, - const labelList& patchProcessors, OFstream& ensightFile ) { @@ -199,16 +198,12 @@ void writeAllFaceData { writeData(map(pf, prims, cmpt), ensightFile); - forAll(patchProcessors, i) + for (int slave=1; slave& pf, - const labelList& patchProcessors, std::ofstream& ensightFile ) { @@ -245,16 +239,12 @@ void writeAllFaceDataBinary { writeEnsDataBinary(map(pf, prims, cmpt), ensightFile); - forAll(patchProcessors, i) + for (int slave=1; slave& boundaryFaceSets = eMesh.boundaryFaceSets(); const wordList& allPatchNames = eMesh.allPatchNames(); - const List& allPatchProcs = eMesh.allPatchProcs(); const HashTable& nPatchPrims = eMesh.nPatchPrims(); @@ -425,8 +406,6 @@ void writePatchField } - const labelList& patchProcessors = allPatchProcs[patchi]; - word pfName = patchName + '.' + fieldName; word timeFile = prepend + itoa(timeIndex); @@ -473,7 +452,6 @@ void writePatchField ensightPatchI, boundaryFaceSets[patchi], nPatchPrims.find(patchName)(), - patchProcessors, ensightFile ); } @@ -488,7 +466,6 @@ void writePatchField ensightPatchI, nullFaceSets, nPatchPrims.find(patchName)(), - patchProcessors, ensightFile ); } @@ -521,7 +498,6 @@ void ensightFieldAscii const cellSets& meshCellSets = eMesh.meshCellSets(); const List& boundaryFaceSets = eMesh.boundaryFaceSets(); const wordList& allPatchNames = eMesh.allPatchNames(); - const List& allPatchProcs = eMesh.allPatchProcs(); const wordHashSet& patchNames = eMesh.patchNames(); const HashTable& nPatchPrims = eMesh.nPatchPrims(); @@ -619,50 +595,23 @@ void ensightFieldAscii forAll(allPatchNames, patchi) { const word& patchName = allPatchNames[patchi]; - const labelList& patchProcessors = allPatchProcs[patchi]; if (patchNames.empty() || patchNames.found(patchName)) { - if (mesh.boundary()[patchi].size()) - { - if + if + ( + writePatchField ( - writePatchField - ( - vf.boundaryField()[patchi], - patchi, - ensightPatchI, - boundaryFaceSets[patchi], - nPatchPrims.find(patchName)(), - patchProcessors, - ensightFile - ) + vf.boundaryField()[patchi], + patchi, + ensightPatchI, + boundaryFaceSets[patchi], + nPatchPrims.find(patchName)(), + ensightFile ) - { - ensightPatchI++; - } - - } - else if (Pstream::master()) + ) { - faceSets nullFaceSet; - - if - ( - writePatchField - ( - Field(), - -1, - ensightPatchI, - nullFaceSet, - nPatchPrims.find(patchName)(), - patchProcessors, - ensightFile - ) - ) - { - ensightPatchI++; - } + ensightPatchI++; } } } @@ -695,7 +644,6 @@ void ensightFieldBinary const cellSets& meshCellSets = eMesh.meshCellSets(); const List& boundaryFaceSets = eMesh.boundaryFaceSets(); const wordList& allPatchNames = eMesh.allPatchNames(); - const List& allPatchProcs = eMesh.allPatchProcs(); const wordHashSet& patchNames = eMesh.patchNames(); const HashTable& nPatchPrims = eMesh.nPatchPrims(); @@ -819,50 +767,23 @@ void ensightFieldBinary forAll(allPatchNames, patchi) { const word& patchName = allPatchNames[patchi]; - const labelList& patchProcessors = allPatchProcs[patchi]; if (patchNames.empty() || patchNames.found(patchName)) { - if (mesh.boundary()[patchi].size()) - { - if + if + ( + writePatchFieldBinary ( - writePatchFieldBinary - ( - vf.boundaryField()[patchi], - patchi, - ensightPatchI, - boundaryFaceSets[patchi], - nPatchPrims.find(patchName)(), - patchProcessors, - ensightFile - ) + vf.boundaryField()[patchi], + patchi, + ensightPatchI, + boundaryFaceSets[patchi], + nPatchPrims.find(patchName)(), + ensightFile ) - { - ensightPatchI++; - } - - } - else if (Pstream::master()) + ) { - faceSets nullFaceSet; - - if - ( - writePatchFieldBinary - ( - Field(), - -1, - ensightPatchI, - nullFaceSet, - nPatchPrims.find(patchName)(), - patchProcessors, - ensightFile - ) - ) - { - ensightPatchI++; - } + ensightPatchI++; } } } diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C index 4e566e1376..48435c749b 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C @@ -43,42 +43,6 @@ License // * * * * * * * * * * * * * Private Functions * * * * * * * * * * * * * * // -namespace Foam -{ - //- Proxy-class to hold the patch processor list combination operator - class concatPatchProcs - { - - public: - - void operator() - ( - List& x, - const List& y - ) const - { - forAll(y, i) - { - const labelList& yPatches = y[i]; - - if (yPatches.size()) - { - labelList& xPatches = x[i]; - - label offset = xPatches.size(); - xPatches.setSize(offset + yPatches.size()); - - forAll(yPatches, i) - { - xPatches[i + offset] = yPatches[i]; - } - } - } - } - }; -} // End namespace Foam - - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::ensightMesh::ensightMesh @@ -94,7 +58,6 @@ Foam::ensightMesh::ensightMesh meshCellSets_(mesh_.nCells()), boundaryFaceSets_(mesh_.boundary().size()), allPatchNames_(0), - allPatchProcs_(0), patchNames_(0), nPatchPrims_(0) { @@ -108,6 +71,9 @@ Foam::ensightMesh::ensightMesh if (!args.optionFound("noPatches")) { + // Patches are output. Check that they're synced. + mesh_.boundaryMesh().checkParallelSync(true); + allPatchNames_ = wordList::subList ( mesh_.boundaryMesh().names(), @@ -115,19 +81,6 @@ Foam::ensightMesh::ensightMesh - mesh_.globalData().processorPatches().size() ); - allPatchProcs_.setSize(allPatchNames_.size()); - - forAll(allPatchProcs_, patchi) - { - if (mesh_.boundary()[patchi].size()) - { - allPatchProcs_[patchi].setSize(1); - allPatchProcs_[patchi][0] = Pstream::myProcNo(); - } - } - - combineReduce(allPatchProcs_, concatPatchProcs()); - if (args.optionFound("patches")) { wordList patchNameList(args.optionLookup("patches")()); @@ -275,14 +228,12 @@ Foam::ensightMesh::ensightMesh { if (mesh.boundary()[patchi].size()) { - nfp.nPoints = mesh.boundaryMesh()[patchi].localPoints().size(); nfp.nTris = boundaryFaceSets_[patchi].tris.size(); nfp.nQuads = boundaryFaceSets_[patchi].quads.size(); nfp.nPolys = boundaryFaceSets_[patchi].polys.size(); } } - reduce(nfp.nPoints, sumOp