Specialized dotInterpolate for the efficient calculation of flux fields

e.g. (fvc::interpolate(HbyA) & mesh.Sf()) -> fvc::flux(HbyA)

This removes the need to create an intermediate face-vector field when
computing fluxes which is more efficient, reduces the peak storage and
improved cache coherency in addition to providing a simpler and cleaner
API.
This commit is contained in:
Henry Weller
2016-04-06 20:20:53 +01:00
parent 4dedba478e
commit 77b03e2e0c
101 changed files with 523 additions and 451 deletions

View File

@ -24,13 +24,13 @@ surfaceScalarField phi
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
fvc::interpolate(U) & mesh.Sf()
fvc::flux(U)
);
if (args.optionFound("initialiseUBCs"))
{
U.correctBoundaryConditions();
phi = fvc::interpolate(U) & mesh.Sf();
phi = fvc::flux(U);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -121,8 +121,7 @@ int main(int argc, char *argv[])
U.correctBoundaryConditions();
Info<< "Interpolated velocity error = "
<< (sqrt(sum(sqr((fvc::interpolate(U) & mesh.Sf()) - phi)))
/sum(mesh.magSf())).value()
<< (sqrt(sum(sqr(fvc::flux(U) - phi)))/sum(mesh.magSf())).value()
<< endl;
// Write U and phi