mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
fvcMeshPhi: added 'relative' equivalent of absolute function
This commit is contained in:
@ -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,
|
||||||
|
|||||||
@ -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
|
||||||
(
|
(
|
||||||
|
|||||||
Reference in New Issue
Block a user