From 7bcd64a243957bbfa576b67bb611f36a6d9761ae Mon Sep 17 00:00:00 2001 From: graham Date: Thu, 2 Dec 2010 10:37:15 +0000 Subject: [PATCH] ENH: deltaCoeff test application. --- applications/test/deltaCoeffs/Make/files | 3 + applications/test/deltaCoeffs/Make/options | 4 + .../test/deltaCoeffs/Test-deltaCoeffs.C | 90 +++++++++++++++++++ 3 files changed, 97 insertions(+) create mode 100644 applications/test/deltaCoeffs/Make/files create mode 100644 applications/test/deltaCoeffs/Make/options create mode 100644 applications/test/deltaCoeffs/Test-deltaCoeffs.C diff --git a/applications/test/deltaCoeffs/Make/files b/applications/test/deltaCoeffs/Make/files new file mode 100644 index 0000000000..1186a01344 --- /dev/null +++ b/applications/test/deltaCoeffs/Make/files @@ -0,0 +1,3 @@ +Test-deltaCoeffs.C + +EXE = $(FOAM_USER_APPBIN)/Test-deltaCoeffs diff --git a/applications/test/deltaCoeffs/Make/options b/applications/test/deltaCoeffs/Make/options new file mode 100644 index 0000000000..725122ea1d --- /dev/null +++ b/applications/test/deltaCoeffs/Make/options @@ -0,0 +1,4 @@ +EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude + +EXE_LIBS = -lfiniteVolume diff --git a/applications/test/deltaCoeffs/Test-deltaCoeffs.C b/applications/test/deltaCoeffs/Test-deltaCoeffs.C new file mode 100644 index 0000000000..cb234ba774 --- /dev/null +++ b/applications/test/deltaCoeffs/Test-deltaCoeffs.C @@ -0,0 +1,90 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Application + Test-deltaCoeffs + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + +# include "setRootCase.H" +# include "createTime.H" +# include "createMesh.H" + + const surfaceScalarField& d = mesh.deltaCoeffs(); + + label minInternalFaceI = findMin(d.internalField()); + label maxInternalFaceI = findMax(d.internalField()); + + if (minInternalFaceI >= 0 && maxInternalFaceI >= 0) + { + Info<< "Internal field" << endl; + + Info<< " min deltaCoeff " + << d.internalField()[minInternalFaceI] + << " on face " << minInternalFaceI << nl + << " max deltaCoeff " + << d.internalField()[maxInternalFaceI] + << " on face " << maxInternalFaceI << nl + << endl; + } + + forAll(mesh.boundaryMesh(), patchI) + { + label minPatchFaceI = findMin(d.boundaryField()[patchI]); + label maxPatchFaceI = findMax(d.boundaryField()[patchI]); + + Info<< "Patch " << mesh.boundaryMesh()[patchI].name() << nl + << " type " << mesh.boundaryMesh()[patchI].type() << endl; + + if (minPatchFaceI >= 0 && maxPatchFaceI >= 0) + { + Info<< " min deltaCoeff " + << d.boundaryField()[patchI][minPatchFaceI] + << " on face " + << minPatchFaceI + mesh.boundaryMesh()[patchI].start() << nl + << " max deltaCoeff " + << d.boundaryField()[patchI][maxPatchFaceI] + << " on face " + << maxPatchFaceI + mesh.boundaryMesh()[patchI].start() << nl + << endl; + } + else + { + Info<< endl; + } + } + + Info<< nl << "End" << nl << endl; + + return 0; +} + + +// ************************************************************************* //