fvcMeshPhi: added 'relative' equivalent of absolute function

This commit is contained in:
Henry
2014-04-29 14:54:55 +01:00
committed by Andrew Heather
parent b7fcf23f69
commit 2bfa9c18f5
2 changed files with 53 additions and 3 deletions

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License 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 Foam::tmp<Foam::surfaceScalarField> Foam::fvc::absolute
( (
const tmp<surfaceScalarField>& tphi, const tmp<surfaceScalarField>& tphi,

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -33,7 +33,6 @@ SourceFiles
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef fvcMeshPhi_H #ifndef fvcMeshPhi_H
#define 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 //- Return the given relative flux in absolute form
tmp<surfaceScalarField> absolute tmp<surfaceScalarField> absolute
( (