diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZone.C b/src/finiteVolume/cfdTools/general/MRF/MRFZone.C index 569d12bfc..788bf1af8 100644 --- a/src/finiteVolume/cfdTools/general/MRF/MRFZone.C +++ b/src/finiteVolume/cfdTools/general/MRF/MRFZone.C @@ -695,7 +695,43 @@ void Foam::MRFZone::meshPhi surfaceScalarField& phi ) const { - phi += meshVelocity(); + const surfaceScalarField& meshVel = meshVelocity(); + + register label faceI, patchFaceI; + + scalarField& phiIn = phi.internalField(); + const scalarField& meshVelIn = meshVel.internalField(); + + forAll (internalFaces_, i) + { + faceI = internalFaces_[i]; + phiIn[faceI] = meshVelIn[faceI]; + } + + // Included patches + + forAll (includedFaces_, patchI) + { + forAll (includedFaces_[patchI], i) + { + patchFaceI = includedFaces_[patchI][i]; + + phi.boundaryField()[patchI][patchFaceI] = + meshVel.boundaryField()[patchI][patchFaceI]; + } + } + + // Excluded patches + forAll (excludedFaces_, patchI) + { + forAll (excludedFaces_[patchI], i) + { + patchFaceI = excludedFaces_[patchI][i]; + + phi.boundaryField()[patchI][patchFaceI] = + meshVel.boundaryField()[patchI][patchFaceI]; + } + } } diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZoneTemplates.C b/src/finiteVolume/cfdTools/general/MRF/MRFZoneTemplates.C index 467567702..07ec2591e 100644 --- a/src/finiteVolume/cfdTools/general/MRF/MRFZoneTemplates.C +++ b/src/finiteVolume/cfdTools/general/MRF/MRFZoneTemplates.C @@ -62,7 +62,7 @@ void Foam::MRFZone::relativeRhoFlux { patchFaceI = includedFaces_[patchI][i]; - phi.boundaryField()[patchI][patchFaceI] = 0; + phi.boundaryField()[patchI][patchFaceI] = 0.0; } } @@ -102,7 +102,7 @@ void Foam::MRFZone::absoluteRhoFlux { faceI = internalFaces_[i]; - phiIn[faceI] += meshVelIn[faceI]; + phiIn[faceI] += rho[faceI]*meshVelIn[faceI]; } // Included patches @@ -113,6 +113,7 @@ void Foam::MRFZone::absoluteRhoFlux patchFaceI = includedFaces_[patchI][i]; phi.boundaryField()[patchI][patchFaceI] += + rho.boundaryField()[patchI][patchFaceI]* meshVel.boundaryField()[patchI][patchFaceI]; } } @@ -125,6 +126,7 @@ void Foam::MRFZone::absoluteRhoFlux patchFaceI = excludedFaces_[patchI][i]; phi.boundaryField()[patchI][patchFaceI] += + rho.boundaryField()[patchI][patchFaceI]* meshVel.boundaryField()[patchI][patchFaceI]; } }