From 10ae335e08f66df0aceafdcc7550c97dbe9b0ad8 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 10 Sep 2009 12:43:51 +0100 Subject: [PATCH 1/6] added warning message - coupled bcs not handled --- .../mesh/manipulation/mirrorMesh/mirrorFvMesh.C | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/applications/utilities/mesh/manipulation/mirrorMesh/mirrorFvMesh.C b/applications/utilities/mesh/manipulation/mirrorMesh/mirrorFvMesh.C index 83b1894f82..9876f4a06f 100644 --- a/applications/utilities/mesh/manipulation/mirrorMesh/mirrorFvMesh.C +++ b/applications/utilities/mesh/manipulation/mirrorMesh/mirrorFvMesh.C @@ -167,6 +167,16 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io) forAll (oldPatches, patchI) { const polyPatch& curPatch = oldPatches[patchI]; + + if (curPatch.coupled()) + { + WarningIn("mirrorFvMesh::mirrorFvMesh(const IOobject&)") + << "Found coupled patch " << curPatch.name() << endl + << " Mirroring faces on coupled patches destroys" + << " the ordering. This might be fixed by running a dummy" + << " createPatch afterwards." << endl; + } + boolList& curInsBouFace = insertedBouFace[patchI]; curInsBouFace.setSize(curPatch.size()); From da4337fcce9e7c201a85a1ce692139c525d603f3 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 10 Sep 2009 12:44:20 +0100 Subject: [PATCH 2/6] derive from wall patch instead of generic patch --- .../derived/directMapped/directMappedWallFvPatch.H | 8 ++++---- .../directMappedPointPatch/directMappedWallPointPatch.H | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/finiteVolume/fvMesh/fvPatches/derived/directMapped/directMappedWallFvPatch.H b/src/finiteVolume/fvMesh/fvPatches/derived/directMapped/directMappedWallFvPatch.H index 4be7eed592..be979c91c3 100644 --- a/src/finiteVolume/fvMesh/fvPatches/derived/directMapped/directMappedWallFvPatch.H +++ b/src/finiteVolume/fvMesh/fvPatches/derived/directMapped/directMappedWallFvPatch.H @@ -36,7 +36,7 @@ SourceFiles #ifndef directMappedWallFvPatch_H #define directMappedWallFvPatch_H -#include "fvPatch.H" +#include "wallFvPatch.H" #include "directMappedWallPolyPatch.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -45,12 +45,12 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class directMappedWallFvPatch Declaration + Class directMappedWallFvPatch Declaration \*---------------------------------------------------------------------------*/ class directMappedWallFvPatch : - public fvPatch + public wallFvPatch { public: @@ -68,7 +68,7 @@ public: const fvBoundaryMesh& bm ) : - fvPatch(patch, bm) + wallFvPatch(patch, bm) {} }; diff --git a/src/meshTools/directMapped/directMappedPointPatch/directMappedWallPointPatch.H b/src/meshTools/directMapped/directMappedPointPatch/directMappedWallPointPatch.H index 28bb877105..0c33de30b0 100644 --- a/src/meshTools/directMapped/directMappedPointPatch/directMappedWallPointPatch.H +++ b/src/meshTools/directMapped/directMappedPointPatch/directMappedWallPointPatch.H @@ -36,7 +36,7 @@ SourceFiles #ifndef directMappedWallPointPatch_H #define directMappedWallPointPatch_H -#include "facePointPatch.H" +#include "wallPointPatch.H" #include "directMappedWallPolyPatch.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -50,7 +50,7 @@ namespace Foam class directMappedWallPointPatch : - public facePointPatch + public wallPointPatch { public: @@ -68,7 +68,7 @@ public: const pointBoundaryMesh& bm ) : - facePointPatch(patch, bm) + wallPointPatch(patch, bm) {} }; From eb2d394420202505c7920991334f04397836b572 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 10 Sep 2009 12:44:41 +0100 Subject: [PATCH 3/6] clip pressure drop --- .../derived/fan/fanFvPatchFields.C | 31 +++++++++++-------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C index 100fe188a2..4280698c2e 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C @@ -29,19 +29,18 @@ License #include "volFields.H" #include "surfaceFields.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { + makePatchTypeField(fvPatchScalarField, fanFvPatchScalarField); +} -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -makePatchTypeField(fvPatchScalarField, fanFvPatchScalarField); - +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // //- Specialisation of the jump-condition for the pressure template<> -void fanFvPatchField::updateCoeffs() +void Foam::fanFvPatchField::updateCoeffs() { if (updated()) { @@ -58,27 +57,33 @@ void fanFvPatchField::updateCoeffs() const fvsPatchField& phip = patch().patchField(phi); - scalarField Un = + scalarField Un = max + ( scalarField::subField(phip, size()/2) - /scalarField::subField(patch().magSf(), size()/2); + /scalarField::subField(patch().magSf(), size()/2), + 0.0 + ); if (phi.dimensions() == dimDensity*dimVelocity*dimArea) { - Un /= patch().lookupPatchField("rho"); + Un /= + scalarField::subField + ( + patch().lookupPatchField("rho"), + size()/2 + ); } for(label i=1; i::updateCoeffs(); } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // From 9215ef540e112e7dc675b305ae98645867e9a57b Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 10 Sep 2009 15:34:18 +0100 Subject: [PATCH 4/6] moved UEqn to within outer loop --- applications/solvers/combustion/reactingFoam/reactingFoam.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/solvers/combustion/reactingFoam/reactingFoam.C b/applications/solvers/combustion/reactingFoam/reactingFoam.C index f989c43d41..875191eea4 100644 --- a/applications/solvers/combustion/reactingFoam/reactingFoam.C +++ b/applications/solvers/combustion/reactingFoam/reactingFoam.C @@ -68,10 +68,10 @@ int main(int argc, char *argv[]) #include "chemistry.H" #include "rhoEqn.H" - #include "UEqn.H" for (label ocorr=1; ocorr <= nOuterCorr; ocorr++) { + #include "UEqn.H" #include "YEqn.H" #define Db turbulence->alphaEff() From e829004a717bc32d1743e8919165249aa2cc04e3 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 10 Sep 2009 16:02:35 +0100 Subject: [PATCH 5/6] bugfix: use ptf.name() on point fields --- .../graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamPointFields.H | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamPointFields.H b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamPointFields.H index fc421ff4a2..3a609b2bde 100644 --- a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamPointFields.H +++ b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamPointFields.H @@ -191,7 +191,7 @@ void Foam::vtkPV3Foam::convertPointField pointData->SetNumberOfTuples(nPoints + addPointCellLabels.size()); pointData->SetNumberOfComponents(nComp); pointData->Allocate(nComp*(nPoints + addPointCellLabels.size())); - pointData->SetName(tf.name().c_str()); + pointData->SetName(ptf.name().c_str()); if (debug) { From feba218914a3bd3026b4a9df73e7a38d4a899c8b Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 10 Sep 2009 21:11:43 +0100 Subject: [PATCH 6/6] make -cellDist output compatible with manualDecomp --- .../decomposePar/decomposePar.C | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C index a26179507a..b2e08a6907 100644 --- a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C +++ b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C @@ -237,23 +237,28 @@ int main(int argc, char *argv[]) if (writeCellDist) { + const labelList& procIds = mesh.cellToProc(); + // Write the decomposition as labelList for use with 'manual' // decomposition method. - - // FIXME: may attempt to write to a non-existent "region0/" - OFstream os + labelIOList cellDecomposition ( - runTime.path() - / mesh.facesInstance() - / regionName - / "cellDecomposition" + IOobject + ( + "cellDecomposition", + mesh.facesInstance(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ), + procIds ); - - os << mesh.cellToProc(); + cellDecomposition.write(); Info<< nl << "Wrote decomposition to " - << os.name() << " for use in manual decomposition." - << endl; + << cellDecomposition.objectPath() + << " for use in manual decomposition." << endl; // Write as volScalarField for postprocessing. volScalarField cellDist @@ -271,7 +276,6 @@ int main(int argc, char *argv[]) zeroGradientFvPatchScalarField::typeName ); - const labelList& procIds = mesh.cellToProc(); forAll(procIds, celli) { cellDist[celli] = procIds[celli];