From a33fbc12b21b2ee584dd795ead57ec36a23dd5db Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 28 Aug 2009 12:35:39 +0100 Subject: [PATCH 1/7] added error checking --- .../triSurface/triSurfaceTools/triSurfaceTools.C | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/meshTools/triSurface/triSurfaceTools/triSurfaceTools.C b/src/meshTools/triSurface/triSurfaceTools/triSurfaceTools.C index b406fb0467..0e97a63316 100644 --- a/src/meshTools/triSurface/triSurfaceTools/triSurfaceTools.C +++ b/src/meshTools/triSurface/triSurfaceTools/triSurfaceTools.C @@ -2560,7 +2560,7 @@ Foam::triSurface Foam::triSurfaceTools::delaunay2D(const List& pts) // Triangulate int nTris = 0; - dtris2 + int err = dtris2 ( pts.size(), geompackVertices.begin(), @@ -2569,6 +2569,13 @@ Foam::triSurface Foam::triSurfaceTools::delaunay2D(const List& pts) triangle_neighbor.begin() ); + if (err != 0) + { + FatalErrorIn("triSurfaceTools::delaunay2D(const List&)") + << "Failed dtris2 with vertices:" << pts.size() + << abort(FatalError); + } + // Trim triangle_node.setSize(3*nTris); triangle_neighbor.setSize(3*nTris); From b9e8d0fa82ec67d8335c2368d11495c28b8ea55a Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 28 Aug 2009 12:35:58 +0100 Subject: [PATCH 2/7] corrected comment --- .../functionObjects/field/streamLine/streamLineParticle.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.C b/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.C index 9f5789bba6..03b5a80288 100644 --- a/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.C +++ b/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.C @@ -355,7 +355,7 @@ void Foam::streamLineParticle::hitWallPatch streamLineParticle::trackData& td ) { - // Keep particle + // Remove particle td.keepParticle = false; } From 48c77d83a7e6de7b7c0cf2bd9ed457986c6c03b6 Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 28 Aug 2009 12:36:32 +0100 Subject: [PATCH 3/7] added check for outstanding requests --- src/Pstream/mpi/Pstream.C | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Pstream/mpi/Pstream.C b/src/Pstream/mpi/Pstream.C index 074ba1aa28..a535f4804e 100644 --- a/src/Pstream/mpi/Pstream.C +++ b/src/Pstream/mpi/Pstream.C @@ -131,6 +131,19 @@ void Foam::Pstream::exit(int errnum) delete[] buff; # endif + if (PstreamGlobals::outstandingRequests_.size()) + { + label n = PstreamGlobals::outstandingRequests_.size(); + PstreamGlobals::outstandingRequests_.clear(); + + WarningIn("Pstream::exit(int)") + << "There are still " << n << " outstanding MPI_Requests." << endl + << "This means that your code exited before doing a" + << " Pstream::waitRequests()." << endl + << "This should not happen for a normal code exit." + << endl; + } + if (errnum == 0) { MPI_Finalize(); From 6519dc62e272e7fc3d55568b866b5facf1f029a3 Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 28 Aug 2009 12:37:31 +0100 Subject: [PATCH 4/7] to be able to handle wall function bcs --- .../incompressible/simpleFoam/motorBike/system/controlDict | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tutorials/incompressible/simpleFoam/motorBike/system/controlDict b/tutorials/incompressible/simpleFoam/motorBike/system/controlDict index 65174d65d1..eeb1d43a1d 100644 --- a/tutorials/incompressible/simpleFoam/motorBike/system/controlDict +++ b/tutorials/incompressible/simpleFoam/motorBike/system/controlDict @@ -14,6 +14,8 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +libs ("libincompressibleRASModels.so"); + application simpleFoam; startFrom latestTime; From 6f530e77cb97addab9f2cc4f0ff2ef81a6ae2005 Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 28 Aug 2009 12:38:44 +0100 Subject: [PATCH 5/7] moved non-IOobject files to subdirectory --- tutorials/incompressible/simpleFoam/motorBike/0/U | 6 +++--- tutorials/incompressible/simpleFoam/motorBike/0/k | 6 +++--- tutorials/incompressible/simpleFoam/motorBike/0/omega | 6 +++--- tutorials/incompressible/simpleFoam/motorBike/0/p | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tutorials/incompressible/simpleFoam/motorBike/0/U b/tutorials/incompressible/simpleFoam/motorBike/0/U index d24226ef2f..b074474b00 100644 --- a/tutorials/incompressible/simpleFoam/motorBike/0/U +++ b/tutorials/incompressible/simpleFoam/motorBike/0/U @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "initialConditions" +#include "include/initialConditions" dimensions [0 1 -1 0 0 0 0]; @@ -23,7 +23,7 @@ internalField uniform $flowVelocity; boundaryField { - #include "fixedInlet" + #include "include/fixedInlet" outlet { @@ -44,7 +44,7 @@ boundaryField value uniform (0 0 0); } - #include "frontBackUpperPatches" + #include "include/frontBackUpperPatches" } diff --git a/tutorials/incompressible/simpleFoam/motorBike/0/k b/tutorials/incompressible/simpleFoam/motorBike/0/k index 457efefed2..f8da4fe9ab 100644 --- a/tutorials/incompressible/simpleFoam/motorBike/0/k +++ b/tutorials/incompressible/simpleFoam/motorBike/0/k @@ -14,7 +14,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "initialConditions" +#include "include/initialConditions" dimensions [0 2 -2 0 0 0 0]; @@ -22,7 +22,7 @@ internalField uniform $turbulentKE; boundaryField { - #include "fixedInlet" + #include "include/fixedInlet" outlet { @@ -41,7 +41,7 @@ boundaryField type kqRWallFunction; } - #include "frontBackUpperPatches" + #include "include/frontBackUpperPatches" } diff --git a/tutorials/incompressible/simpleFoam/motorBike/0/omega b/tutorials/incompressible/simpleFoam/motorBike/0/omega index 16424f9bb3..dcd88e8d67 100644 --- a/tutorials/incompressible/simpleFoam/motorBike/0/omega +++ b/tutorials/incompressible/simpleFoam/motorBike/0/omega @@ -14,7 +14,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "initialConditions" +#include "include/initialConditions" dimensions [0 0 -1 0 0 0 0]; @@ -22,7 +22,7 @@ internalField uniform $turbulentOmega; boundaryField { - #include "fixedInlet" + #include "include/fixedInlet" outlet { @@ -41,7 +41,7 @@ boundaryField type omegaWallFunction; } - #include "frontBackUpperPatches" + #include "include/frontBackUpperPatches" } diff --git a/tutorials/incompressible/simpleFoam/motorBike/0/p b/tutorials/incompressible/simpleFoam/motorBike/0/p index a7ef4983d1..9bf8e9d43d 100644 --- a/tutorials/incompressible/simpleFoam/motorBike/0/p +++ b/tutorials/incompressible/simpleFoam/motorBike/0/p @@ -14,7 +14,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "initialConditions" +#include "include/initialConditions" dimensions [0 2 -2 0 0 0 0]; @@ -43,7 +43,7 @@ boundaryField type zeroGradient; } - #include "frontBackUpperPatches" + #include "include/frontBackUpperPatches" } // ************************************************************************* // From 65f59bc99269ef18ec23a3a0ed092a9d35b73639 Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 28 Aug 2009 12:39:03 +0100 Subject: [PATCH 6/7] moved non-IOobject files to subdirectory --- .../simpleFoam/motorBike/0/fixedInlet | 15 --------------- .../motorBike/0/frontBackUpperPatches | 19 ------------------- .../simpleFoam/motorBike/0/initialConditions | 15 --------------- 3 files changed, 49 deletions(-) delete mode 100644 tutorials/incompressible/simpleFoam/motorBike/0/fixedInlet delete mode 100644 tutorials/incompressible/simpleFoam/motorBike/0/frontBackUpperPatches delete mode 100644 tutorials/incompressible/simpleFoam/motorBike/0/initialConditions diff --git a/tutorials/incompressible/simpleFoam/motorBike/0/fixedInlet b/tutorials/incompressible/simpleFoam/motorBike/0/fixedInlet deleted file mode 100644 index ccf1d6e897..0000000000 --- a/tutorials/incompressible/simpleFoam/motorBike/0/fixedInlet +++ /dev/null @@ -1,15 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.6 | -| \\ / A nd | Web: http://www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ - -inlet -{ - type fixedValue; - value $internalField; -} - -// ************************************************************************* // diff --git a/tutorials/incompressible/simpleFoam/motorBike/0/frontBackUpperPatches b/tutorials/incompressible/simpleFoam/motorBike/0/frontBackUpperPatches deleted file mode 100644 index d858932a9d..0000000000 --- a/tutorials/incompressible/simpleFoam/motorBike/0/frontBackUpperPatches +++ /dev/null @@ -1,19 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.6 | -| \\ / A nd | Web: http://www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ - -upperWall -{ - type slip; -} - -frontAndBack -{ - type slip; -} - -// ************************************************************************* // diff --git a/tutorials/incompressible/simpleFoam/motorBike/0/initialConditions b/tutorials/incompressible/simpleFoam/motorBike/0/initialConditions deleted file mode 100644 index a90ff786cc..0000000000 --- a/tutorials/incompressible/simpleFoam/motorBike/0/initialConditions +++ /dev/null @@ -1,15 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.6 | -| \\ / A nd | Web: http://www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ - -flowVelocity (20 0 0); -pressure 0; -turbulentKE 0.24; -turbulentOmega 1.78; -#inputMode merge - -// ************************************************************************* // From 3335aa68f34320f22ea1cb0e2b0f0aed13606d5d Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 28 Aug 2009 12:39:37 +0100 Subject: [PATCH 7/7] moved non-IOobject files to subdirectory --- .../simpleFoam/motorBike/0/include/fixedInlet | 15 +++++++++++++++ .../motorBike/0/include/frontBackUpperPatches | 19 +++++++++++++++++++ .../motorBike/0/include/initialConditions | 15 +++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 tutorials/incompressible/simpleFoam/motorBike/0/include/fixedInlet create mode 100644 tutorials/incompressible/simpleFoam/motorBike/0/include/frontBackUpperPatches create mode 100644 tutorials/incompressible/simpleFoam/motorBike/0/include/initialConditions diff --git a/tutorials/incompressible/simpleFoam/motorBike/0/include/fixedInlet b/tutorials/incompressible/simpleFoam/motorBike/0/include/fixedInlet new file mode 100644 index 0000000000..ccf1d6e897 --- /dev/null +++ b/tutorials/incompressible/simpleFoam/motorBike/0/include/fixedInlet @@ -0,0 +1,15 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +inlet +{ + type fixedValue; + value $internalField; +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/simpleFoam/motorBike/0/include/frontBackUpperPatches b/tutorials/incompressible/simpleFoam/motorBike/0/include/frontBackUpperPatches new file mode 100644 index 0000000000..d858932a9d --- /dev/null +++ b/tutorials/incompressible/simpleFoam/motorBike/0/include/frontBackUpperPatches @@ -0,0 +1,19 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +upperWall +{ + type slip; +} + +frontAndBack +{ + type slip; +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/simpleFoam/motorBike/0/include/initialConditions b/tutorials/incompressible/simpleFoam/motorBike/0/include/initialConditions new file mode 100644 index 0000000000..a90ff786cc --- /dev/null +++ b/tutorials/incompressible/simpleFoam/motorBike/0/include/initialConditions @@ -0,0 +1,15 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +flowVelocity (20 0 0); +pressure 0; +turbulentKE 0.24; +turbulentOmega 1.78; +#inputMode merge + +// ************************************************************************* //