From 31b83d862b2c63fe4b3ca0729604bbb610f43c6c Mon Sep 17 00:00:00 2001
From: "h.weller@opencfd.co.uk" <h.weller@opencfd.co.uk>
Date: Fri, 27 Jun 2008 12:19:08 +0100
Subject: [PATCH] Corrected the handling of mass-fluxes.

---
 .../finiteVolume/fvc/fvcMeshPhi.C             | 48 ++++++-------------
 1 file changed, 15 insertions(+), 33 deletions(-)

diff --git a/src/finiteVolume/finiteVolume/fvc/fvcMeshPhi.C b/src/finiteVolume/finiteVolume/fvc/fvcMeshPhi.C
index f9fb437d918..1bba333eae5 100644
--- a/src/finiteVolume/finiteVolume/fvc/fvcMeshPhi.C
+++ b/src/finiteVolume/finiteVolume/fvc/fvcMeshPhi.C
@@ -30,17 +30,7 @@ License
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-namespace Foam
-{
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-namespace fvc
-{
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-tmp<surfaceScalarField> meshPhi
+Foam::tmp<Foam::surfaceScalarField> Foam::fvc::meshPhi
 (
     const volVectorField& vf
 )
@@ -53,13 +43,13 @@ tmp<surfaceScalarField> meshPhi
 }
 
 
-tmp<surfaceScalarField> meshPhi
+Foam::tmp<Foam::surfaceScalarField> Foam::fvc::meshPhi
 (
     const dimensionedScalar& rho,
     const volVectorField& vf
 )
 {
-    return rho*fv::ddtScheme<vector>::New
+    return fv::ddtScheme<vector>::New
     (
         vf.mesh(),
         vf.mesh().ddtScheme("ddt(" + rho.name() + ',' + vf.name() + ')')
@@ -67,13 +57,13 @@ tmp<surfaceScalarField> meshPhi
 }
 
 
-tmp<surfaceScalarField> meshPhi
+Foam::tmp<Foam::surfaceScalarField> Foam::fvc::meshPhi
 (
     const volScalarField& rho,
     const volVectorField& vf
 )
 {
-    return fvc::interpolate(rho)*fv::ddtScheme<vector>::New
+    return fv::ddtScheme<vector>::New
     (
         vf.mesh(),
         vf.mesh().ddtScheme("ddt(" + rho.name() + ',' + vf.name() + ')')
@@ -81,7 +71,7 @@ tmp<surfaceScalarField> meshPhi
 }
 
 
-void makeRelative
+void Foam::fvc::makeRelative
 (
     surfaceScalarField& phi,
     const volVectorField& U
@@ -93,7 +83,7 @@ void makeRelative
     }
 }
 
-void makeRelative
+void Foam::fvc::makeRelative
 (
     surfaceScalarField& phi,
     const dimensionedScalar& rho,
@@ -102,11 +92,11 @@ void makeRelative
 {
     if (phi.mesh().moving())
     {
-        phi -= fvc::meshPhi(rho, U);
+        phi -= rho*fvc::meshPhi(rho, U);
     }
 }
 
-void makeRelative
+void Foam::fvc::makeRelative
 (
     surfaceScalarField& phi,
     const volScalarField& rho,
@@ -115,12 +105,12 @@ void makeRelative
 {
     if (phi.mesh().moving())
     {
-        phi -= fvc::meshPhi(rho, U);
+        phi -= fvc::interpolate(rho)*fvc::meshPhi(rho, U);
     }
 }
 
 
-void makeAbsolute
+void Foam::fvc::makeAbsolute
 (
     surfaceScalarField& phi,
     const volVectorField& U
@@ -132,7 +122,7 @@ void makeAbsolute
     }
 }
 
-void makeAbsolute
+void Foam::fvc::makeAbsolute
 (
     surfaceScalarField& phi,
     const dimensionedScalar& rho,
@@ -141,11 +131,11 @@ void makeAbsolute
 {
     if (phi.mesh().moving())
     {
-        phi += fvc::meshPhi(rho, U);
+        phi += rho*fvc::meshPhi(rho, U);
     }
 }
 
-void makeAbsolute
+void Foam::fvc::makeAbsolute
 (
     surfaceScalarField& phi,
     const volScalarField& rho,
@@ -154,17 +144,9 @@ void makeAbsolute
 {
     if (phi.mesh().moving())
     {
-        phi += fvc::meshPhi(rho, U);
+        phi += fvc::interpolate(rho)*fvc::meshPhi(rho, U);
     }
 }
 
 
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-} // End namespace fvc
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-} // End namespace Foam
-
 // ************************************************************************* //
-- 
GitLab