diff --git a/src/finiteVolume/finiteVolume/fvc/fvcMeshPhi.C b/src/finiteVolume/finiteVolume/fvc/fvcMeshPhi.C index 5c53f64fdd066a75cf84c4cd4ba9a93af3496633..741321612c97fd5b16316b0ac3784ee7caef7d57 100644 --- a/src/finiteVolume/finiteVolume/fvc/fvcMeshPhi.C +++ b/src/finiteVolume/finiteVolume/fvc/fvcMeshPhi.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 @@ -148,6 +148,41 @@ void Foam::fvc::makeAbsolute } +Foam::tmp<Foam::surfaceScalarField> Foam::fvc::relative +( + const tmp<surfaceScalarField>& tphi, + const volVectorField& U +) +{ + if (tphi().mesh().moving()) + { + return tphi - fvc::meshPhi(U); + } + else + { + return tmp<surfaceScalarField>(tphi, true); + } +} + + +Foam::tmp<Foam::surfaceScalarField> Foam::fvc::relative +( + const tmp<surfaceScalarField>& tphi, + const volScalarField& rho, + const volVectorField& U +) +{ + if (tphi().mesh().moving()) + { + return tphi - fvc::interpolate(rho)*fvc::meshPhi(rho, U); + } + else + { + return tmp<surfaceScalarField>(tphi, true); + } +} + + Foam::tmp<Foam::surfaceScalarField> Foam::fvc::absolute ( const tmp<surfaceScalarField>& tphi, diff --git a/src/finiteVolume/finiteVolume/fvc/fvcMeshPhi.H b/src/finiteVolume/finiteVolume/fvc/fvcMeshPhi.H index 4f47c381e39960fbf1ebcdda9b59a8f7483cdeef..e055d4d9703e6c4846a0dc10983ca6bdf09f7089 100644 --- a/src/finiteVolume/finiteVolume/fvc/fvcMeshPhi.H +++ b/src/finiteVolume/finiteVolume/fvc/fvcMeshPhi.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -33,7 +33,6 @@ SourceFiles \*---------------------------------------------------------------------------*/ - #ifndef fvcMeshPhi_H #define fvcMeshPhi_H @@ -118,6 +117,22 @@ namespace fvc ); + //- Return the given absolute flux in relative form + tmp<surfaceScalarField> relative + ( + const tmp<surfaceScalarField>& tphi, + const volVectorField& U + ); + + //- Return the given absolute flux in relative form + tmp<surfaceScalarField> relative + ( + const tmp<surfaceScalarField>& tphi, + const volScalarField& rho, + const volVectorField& U + ); + + //- Return the given relative flux in absolute form tmp<surfaceScalarField> absolute (