diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/pEqn.H b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/pEqn.H index 5270e3d8..cb732902 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/pEqn.H +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/pEqn.H @@ -40,8 +40,6 @@ if (pimple.transonic()) fvOptions(psi, p, rho.name()) ); - fvOptions.constrain(pEqn); - pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); if (pimple.finalNonOrthogonalIter()) @@ -74,8 +72,6 @@ else fvOptions(psi, p, rho.name()) ); - fvOptions.constrain(pEqn); - pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); if (pimple.finalNonOrthogonalIter()) diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/rhoPimpleDyMFoam.C b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/rhoPimpleDyMFoam.C index e633ebee..fcfc2aa7 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/rhoPimpleDyMFoam.C +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/rhoPimpleDyMFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,6 +24,9 @@ License Application rhoPimpleFoam +Group + grpCompressibleSolvers grpMovingMeshSolvers + Description Transient solver for laminar or turbulent flow of compressible fluids for HVAC and similar applications. @@ -71,17 +74,21 @@ int main(int argc, char *argv[]) #include "setDeltaT.H" - runTime++; - - Info<< "Time = " << runTime.timeName() << nl << endl; - { + // Store divrhoU from the previous time-step/mesh for the correctPhi + volScalarField divrhoU + ( + "divrhoU", + fvc::div(fvc::absolute(phi, rho, U)) + ); + + runTime++; + + Info<< "Time = " << runTime.timeName() << nl << endl; + // Store momentum to set rhoUf for introduced faces. volVectorField rhoU("rhoU", rho*U); - // Store divrhoU from the previous time-step/mesh for the correctPhi - volScalarField divrhoU(fvc::div(fvc::absolute(phi, rho, U))); - // Do any mesh changes mesh.update(); @@ -102,12 +109,9 @@ int main(int argc, char *argv[]) #include "meshCourantNo.H" } - if (pimple.nCorrPIMPLE() <= 1) - { - #include "rhoEqn.H" - Info<< "rhoEqn max/min : " << max(rho).value() - << " " << min(rho).value() << endl; - } + #include "rhoEqn.H" + Info<< "rhoEqn max/min : " << max(rho).value() + << " " << min(rho).value() << endl; // --- Pressure-velocity PIMPLE corrector loop while (pimple.loop()) diff --git a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C index f2c091e4..e1387379 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C +++ b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -47,6 +47,7 @@ Description #include "fvMesh.H" #include "MeshedSurfaces.H" #include "globalIndex.H" +#include "cellSet.H" #include "extrudedMesh.H" #include "extrudeModel.H" @@ -192,6 +193,23 @@ void updateFaceLabels(const mapPolyMesh& map, labelList& faceLabels) } +void updateCellSet(const mapPolyMesh& map, labelHashSet& cellLabels) +{ + const labelList& reverseMap = map.reverseCellMap(); + + labelHashSet newCellLabels(2*cellLabels.size()); + + forAll(cellLabels, i) + { + label oldCellI = cellLabels[i]; + + if (reverseMap[oldCellI] >= 0) + { + newCellLabels.insert(reverseMap[oldCellI]); + } + } + cellLabels.transfer(newCellLabels); +} int main(int argc, char *argv[]) @@ -270,6 +288,9 @@ int main(int argc, char *argv[]) word backPatchName; labelList backPatchFaces; + // Optional added cells (get written to cellSet) + labelHashSet addedCellsSet; + if (mode == PATCH || mode == MESH) { if (flipNormals && mode == MESH) @@ -670,11 +691,33 @@ int main(int argc, char *argv[]) map().reverseFaceMap(), backPatchFaces ); + + // Store added cells + if (mode == MESH) + { + const labelListList addedCells + ( + layerExtrude.addedCells + ( + meshFromMesh, + layerExtrude.layerFaces() + ) + ); + forAll(addedCells, faceI) + { + const labelList& aCells = addedCells[faceI]; + forAll(aCells, i) + { + addedCellsSet.insert(aCells[i]); + } + } + } } else { // Read from surface fileName surfName(dict.lookup("surface")); + surfName.expand(); Info<< "Extruding surfaceMesh read from file " << surfName << nl << endl; @@ -810,6 +853,7 @@ int main(int argc, char *argv[]) // Update stored data updateFaceLabels(map(), frontPatchFaces); updateFaceLabels(map(), backPatchFaces); + updateCellSet(map(), addedCellsSet); // Move mesh (if inflation used) if (map().hasMotionPoints()) @@ -913,6 +957,9 @@ int main(int argc, char *argv[]) // Update fields mesh.updateMesh(map); + // Update local data + updateCellSet(map(), addedCellsSet); + // Move mesh (if inflation used) if (map().hasMotionPoints()) { @@ -929,6 +976,21 @@ int main(int argc, char *argv[]) << exit(FatalError); } + // Need writing cellSet + label nAdded = returnReduce(addedCellsSet.size(), sumOp