From 861681df29dd15f7e99d03db9fd7e70d82efda04 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Mon, 4 Oct 2010 22:24:43 +0100 Subject: [PATCH] Added missing flux correction code --- .../cfdTools/general/MRF/MRFZones.C | 32 ++++++++++++++++++- .../cfdTools/general/MRF/MRFZones.H | 5 +++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZones.C b/src/finiteVolume/cfdTools/general/MRF/MRFZones.C index 26913e5f4..2f3d0de31 100644 --- a/src/finiteVolume/cfdTools/general/MRF/MRFZones.C +++ b/src/finiteVolume/cfdTools/general/MRF/MRFZones.C @@ -50,12 +50,42 @@ Foam::MRFZones::MRFZones(const fvMesh& mesh) IOobject::NO_WRITE ), MRFZone::iNew(mesh) - ) + ), + mesh_(mesh) {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +Foam::tmp Foam::MRFZones::fluxCorrection() const +{ + tmp tMRFZonesPhiCorr + ( + new surfaceScalarField + ( + IOobject + ( + "MRFZonesPhiCorr", + mesh_.time().timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedScalar("zero", dimVelocity*dimArea, 0) + ) + ); + surfaceScalarField& MRFZonesPhiCorr = tMRFZonesPhiCorr(); + + forAll(*this, i) + { + operator[](i).relativeFlux(MRFZonesPhiCorr); + } + + return tMRFZonesPhiCorr; +} + + void Foam::MRFZones::addCoriolis(fvVectorMatrix& UEqn) const { forAll(*this, i) diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZones.H b/src/finiteVolume/cfdTools/general/MRF/MRFZones.H index dd3640870..45502fe34 100644 --- a/src/finiteVolume/cfdTools/general/MRF/MRFZones.H +++ b/src/finiteVolume/cfdTools/general/MRF/MRFZones.H @@ -53,6 +53,11 @@ class MRFZones : public IOPtrList { + // Private data + + //- Mesh reference + const fvMesh& mesh_; + // Private Member Functions