Skip to content
Snippets Groups Projects
Commit 2bfa9c18 authored by Henry's avatar Henry Committed by Andrew Heather
Browse files

fvcMeshPhi: added 'relative' equivalent of absolute function

parent b7fcf23f
Branches
Tags
No related merge requests found
...@@ -2,7 +2,7 @@ ...@@ -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 ...@@ -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,
......
...@@ -2,7 +2,7 @@ ...@@ -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 ...@@ -33,7 +33,6 @@ SourceFiles
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef fvcMeshPhi_H #ifndef fvcMeshPhi_H
#define fvcMeshPhi_H #define fvcMeshPhi_H
...@@ -118,6 +117,22 @@ namespace fvc ...@@ -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
( (
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment