From dc6d2963724f23732ce50888a80416af93ae6502 Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 22 Jun 2011 14:29:39 +0100 Subject: [PATCH 01/19] BUG: matchPoints: use 2* match tolerance as tolerance in magSqr comparison --- src/OpenFOAM/meshes/meshTools/matchPoints.C | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/OpenFOAM/meshes/meshTools/matchPoints.C b/src/OpenFOAM/meshes/meshTools/matchPoints.C index 931a152aa5..2a2a9ea80b 100644 --- a/src/OpenFOAM/meshes/meshTools/matchPoints.C +++ b/src/OpenFOAM/meshes/meshTools/matchPoints.C @@ -66,7 +66,7 @@ bool Foam::matchPoints scalar matchDist = matchDistances[face0I]; - label startI = findLower(pts1MagSqr, 0.99999*dist0 - matchDist); + label startI = findLower(pts1MagSqr, 0.99999*dist0 - 2*matchDist); if (startI == -1) { @@ -83,7 +83,7 @@ bool Foam::matchPoints label j = startI; ( (j < pts1MagSqr.size()) - && (pts1MagSqr[j] < 1.00001*dist0 + matchDist) + && (pts1MagSqr[j] < 1.00001*dist0 + 2*matchDist) ); j++ ) @@ -117,7 +117,7 @@ bool Foam::matchPoints label j = startI; ( (j < pts1MagSqr.size()) - && (pts1MagSqr[j] < 1.00001*dist0 + matchDist) + && (pts1MagSqr[j] < 1.00001*dist0 + 2*matchDist) ); j++ ) From de200baf7d94418a210a6a766695e0276984139c Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 22 Jun 2011 14:30:03 +0100 Subject: [PATCH 02/19] BUG: orientedSurface: multiple parts of surfaces not visited --- .../orientedSurface/orientedSurface.C | 32 ++++++++++++++++--- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/src/meshTools/triSurface/orientedSurface/orientedSurface.C b/src/meshTools/triSurface/orientedSurface/orientedSurface.C index 9cc473f3a3..7026f01ec1 100644 --- a/src/meshTools/triSurface/orientedSurface/orientedSurface.C +++ b/src/meshTools/triSurface/orientedSurface/orientedSurface.C @@ -102,7 +102,7 @@ Foam::labelList Foam::orientedSurface::edgeToFace { if (flip[face1] == UNVISITED) { - FatalErrorIn("orientedSurface::edgeToFace") << "Problem" + FatalErrorIn("orientedSurface::edgeToFace(..)") << "Problem" << abort(FatalError); } else @@ -283,8 +283,10 @@ bool Foam::orientedSurface::flipSurface } } // Recalculate normals - s.clearOut(); - + if (hasFlipped) + { + s.clearOut(); + } return hasFlipped; } @@ -352,8 +354,28 @@ bool Foam::orientedSurface::orient // FLIP: need to flip labelList flipState(s.size(), UNVISITED); - flipState[0] = NOFLIP; - walkSurface(s, 0, flipState); + label faceI = 0; + while (true) + { + label startFaceI = -1; + while (faceI < s.size()) + { + if (flipState[faceI] == UNVISITED) + { + startFaceI = faceI; + break; + } + faceI++; + } + + if (startFaceI == -1) + { + break; + } + + flipState[startFaceI] = NOFLIP; + walkSurface(s, startFaceI, flipState); + } anyFlipped = flipSurface(s, flipState); } From 02b62243900cf2708db599a8b29cdb9c75125f1d Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 22 Jun 2011 15:07:32 +0100 Subject: [PATCH 03/19] BUG: paraFoam: add locale specification --- bin/paraFoam | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/paraFoam b/bin/paraFoam index 48eab6ebe0..fe11bcb6e8 100755 --- a/bin/paraFoam +++ b/bin/paraFoam @@ -62,6 +62,11 @@ unset FOAM_ABORT unset regionName optTouch +# Hack: change all locale to 'C' i.e. using '.' for decimal point. This is +# only needed temporarily until paraview is locale aware. (git version is +# already 2010-07) +export LC_ALL=C + # reader extension extension=OpenFOAM From 64f586966d595c4a57617800d0e4503ca5d43cf3 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 23 Jun 2011 12:24:01 +0100 Subject: [PATCH 04/19] ENH: surfaceOrient: orient using intersections --- .../surface/surfaceOrient/surfaceOrient.C | 43 ++++-- .../orientedSurface/orientedSurface.C | 145 ++++++++++++++++-- .../orientedSurface/orientedSurface.H | 30 +++- .../triSurfaceSearch/triSurfaceSearch.C | 82 ++++++++++ .../triSurfaceSearch/triSurfaceSearch.H | 11 +- 5 files changed, 282 insertions(+), 29 deletions(-) diff --git a/applications/utilities/surface/surfaceOrient/surfaceOrient.C b/applications/utilities/surface/surfaceOrient/surfaceOrient.C index 084d658155..76ee9c7ab9 100644 --- a/applications/utilities/surface/surfaceOrient/surfaceOrient.C +++ b/applications/utilities/surface/surfaceOrient/surfaceOrient.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,13 +28,13 @@ Description \*---------------------------------------------------------------------------*/ #include "argList.H" +#include "triSurfaceSearch.H" #include "orientedSurface.H" using namespace Foam; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - // Main program: int main(int argc, char *argv[]) @@ -53,6 +53,11 @@ int main(int argc, char *argv[]) "inside", "treat provided point as being inside" ); + argList::addBoolOption + ( + "usePierceTest", + "determine orientation by counting number of intersections" + ); argList args(argc, argv); @@ -61,9 +66,9 @@ int main(int argc, char *argv[]) const fileName outFileName = args[3]; const bool orientInside = args.optionFound("inside"); + const bool usePierceTest = args.optionFound("usePierceTest"); Info<< "Reading surface from " << surfFileName << nl - << "Visible point " << visiblePoint << nl << "Orienting surface such that visiblePoint " << visiblePoint << " is "; @@ -76,19 +81,35 @@ int main(int argc, char *argv[]) Info<< "outside" << endl; } - Info<< "Writing surface to " << outFileName << endl; // Load surface triSurface surf(surfFileName); - //orientedSurface normalSurf(surf, visiblePoint, !orientInside); - bool anyFlipped = orientedSurface::orient - ( - surf, - visiblePoint, - !orientInside - ); + + bool anyFlipped = false; + + if (usePierceTest) + { + triSurfaceSearch surfSearches(surf); + + anyFlipped = orientedSurface::orient + ( + surf, + surfSearches, + visiblePoint, + !orientInside + ); + } + else + { + anyFlipped = orientedSurface::orient + ( + surf, + visiblePoint, + !orientInside + ); + } if (anyFlipped) { diff --git a/src/meshTools/triSurface/orientedSurface/orientedSurface.C b/src/meshTools/triSurface/orientedSurface/orientedSurface.C index 7026f01ec1..2b32604972 100644 --- a/src/meshTools/triSurface/orientedSurface/orientedSurface.C +++ b/src/meshTools/triSurface/orientedSurface/orientedSurface.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,6 +25,7 @@ License #include "orientedSurface.H" #include "triSurfaceTools.H" +#include "triSurfaceSearch.H" #include "treeBoundBox.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -165,13 +166,6 @@ void Foam::orientedSurface::walkSurface { changedEdges = faceToEdge(s, changedFaces); - if (debug) - { - Pout<< "From changedFaces:" << changedFaces.size() - << " to changedEdges:" << changedEdges.size() - << endl; - } - if (changedEdges.empty()) { break; @@ -179,13 +173,6 @@ void Foam::orientedSurface::walkSurface changedFaces = edgeToFace(s, changedEdges, flipState); - if (debug) - { - Pout<< "From changedEdges:" << changedEdges.size() - << " to changedFaces:" << changedFaces.size() - << endl; - } - if (changedFaces.empty()) { break; @@ -251,6 +238,82 @@ void Foam::orientedSurface::propagateOrientation } +// Find side for zoneI only by counting the number of intersections. Determines +// if face is oriented consistent with outwards pointing normals. +void Foam::orientedSurface::findZoneSide +( + const triSurfaceSearch& surfSearches, + const labelList& faceZone, + const label zoneI, + const point& outsidePoint, + label& zoneFaceI, + bool& isOutside +) +{ + const triSurface& s = surfSearches.surface(); + + zoneFaceI = -1; + isOutside = false; + + + List hits; + + forAll(faceZone, faceI) + { + if (faceZone[faceI] == zoneI) + { + const point& fc = s.faceCentres()[faceI]; + const vector& n = s.faceNormals()[faceI]; + + const vector d = fc - outsidePoint; + const scalar magD = mag(d); + + // Check if normal different enough to decide upon + if (magD > SMALL && (mag(n & d/magD) > 1e-6)) + { + point end = fc + d; + + //Info<< "Zone " << zoneI << " : Shooting ray" + // << " from " << outsidePoint + // << " to " << end + // << " to pierce triangle " << faceI + // << " with centre " << fc << endl; + + surfSearches.findLineAll(outsidePoint, end, hits); + + label zoneIndex = -1; + forAll(hits, i) + { + if (hits[i].index() == faceI) + { + zoneIndex = i; + break; + } + } + + if (zoneIndex != -1) + { + zoneFaceI = faceI; + + if ((zoneIndex%2) == 0) + { + // Odd number of intersections. Check if normal points + // in direction of ray + isOutside = ((n & d) < 0); + } + else + { + isOutside = ((n & d) > 0); + } + + break; + } + } + } + } +} + + bool Foam::orientedSurface::flipSurface ( triSurface& s, @@ -438,4 +501,56 @@ bool Foam::orientedSurface::orient } +bool Foam::orientedSurface::orient +( + triSurface& s, + const triSurfaceSearch& querySurf, + const point& samplePoint, + const bool orientOutside +) +{ + // Determine disconnected parts of surface + boolList borderEdge(s.nEdges(), false); + forAll(s.edgeFaces(), edgeI) + { + if (s.edgeFaces()[edgeI].size() != 2) + { + borderEdge[edgeI] = true; + } + } + labelList faceZone; + label nZones = s.markZones(borderEdge, faceZone); + + // Check intersection with one face per zone. + + labelList flipState(s.size(), UNVISITED); + for (label zoneI = 0; zoneI < nZones; zoneI++) + { + label zoneFaceI = -1; + bool isOutside; + findZoneSide + ( + querySurf, + faceZone, + zoneI, + samplePoint, + + zoneFaceI, + isOutside + ); + + if (isOutside == orientOutside) + { + flipState[zoneFaceI] = NOFLIP; + } + else + { + flipState[zoneFaceI] = FLIP; + } + walkSurface(s, zoneFaceI, flipState); + } + return flipSurface(s, flipState); +} + + // ************************************************************************* // diff --git a/src/meshTools/triSurface/orientedSurface/orientedSurface.H b/src/meshTools/triSurface/orientedSurface/orientedSurface.H index 327b44197b..209673a187 100644 --- a/src/meshTools/triSurface/orientedSurface/orientedSurface.H +++ b/src/meshTools/triSurface/orientedSurface/orientedSurface.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -44,6 +44,7 @@ namespace Foam { // Forward declaration of classes +class triSurfaceSearch; /*---------------------------------------------------------------------------*\ Class orientedSurface Declaration @@ -111,6 +112,18 @@ class orientedSurface labelList& flipState ); + //- Find a face on zoneI and count number of intersections to determine + // orientation + static void findZoneSide + ( + const triSurfaceSearch& surfSearches, + const labelList& faceZone, + const label zoneI, + const point& visiblePoint, + label& zoneFaceI, + bool& isOutside + ); + //- Given flipState reverse triangles of *this. Return true if // anything flipped. static bool flipSurface(triSurface& s, const labelList& flipState); @@ -127,7 +140,7 @@ public: //- Construct from triSurface and sample point which is either // outside (orientOutside = true) or inside (orientOutside = false). - // Uses linear search to find nearest. + // Uses orient. orientedSurface ( const triSurface&, @@ -145,8 +158,21 @@ public: //- Flip faces such that normals are consistent with point: // orientOutside=true : point outside surface // orientOutside=false : point inside surface + // Bases orientation on normal on nearest point (linear search) and + // walks to rest. Surface needs to be manifold. static bool orient(triSurface&, const point&, const bool orientOutside); + //- Flip faces such that normals are consistent with point: + // orientOutside=true : point outside surface + // orientOutside=false : point inside surface + // Uses intersection count to orient. Handles open surfaces. + static bool orient + ( + triSurface& s, + const triSurfaceSearch& querySurf, + const point& samplePoint, + const bool orientOutside + ); }; diff --git a/src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.C b/src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.C index 92d8f8ad6d..b24c482b25 100644 --- a/src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.C +++ b/src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.C @@ -188,4 +188,86 @@ const } +void Foam::triSurfaceSearch::findLineAll +( + const point& start, + const point& end, + List& hits +) +const +{ + // See if any intersection between pt and end + pointIndexHit inter = tree().findLine(start, end); + + if (inter.hit()) + { + label sz = hits.size(); + hits.setSize(sz+1); + hits[sz] = inter; + + const vector dirVec(end-start); + const scalar magSqrDirVec(magSqr(dirVec)); + const vector smallVec + ( + indexedOctree::perturbTol()*dirVec + + vector(ROOTVSMALL,ROOTVSMALL,ROOTVSMALL) + ); + + + // Initial perturbation amount + vector perturbVec(smallVec); + + while (true) + { + // Start tracking from last hit. + point pt = hits.last().hitPoint() + perturbVec; + + if (((pt-start)&dirVec) > magSqrDirVec) + { + return; + } + + // See if any intersection between pt and end + pointIndexHit inter = tree().findLine(pt, end); + + if (!inter.hit()) + { + return; + } + + // Check if already found this intersection + bool duplicateHit = false; + forAllReverse(hits, i) + { + if (hits[i].index() == inter.index()) + { + duplicateHit = true; + break; + } + } + + + if (duplicateHit) + { + // Hit same triangle again. Increase perturbVec and try again. + perturbVec *= 2; + } + else + { + // Proper hit + label sz = hits.size(); + hits.setSize(sz+1); + hits[sz] = inter; + // Restore perturbVec + perturbVec = smallVec; + } + } + } + else + { + hits.clear(); + } +} + + // ************************************************************************* // diff --git a/src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.H b/src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.H index dfea9a5f30..3d2537d245 100644 --- a/src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.H +++ b/src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -128,6 +128,15 @@ public: // - hitPoint() : coordinate of nearest point // - index() : surface triangle label pointIndexHit nearest(const point&, const vector& span) const; + + //- Calculate all intersections from start to end + void findLineAll + ( + const point& start, + const point& end, + List& + ) const; + }; From 9da17e04eed1a3c635ad764a65ad1861b629275d Mon Sep 17 00:00:00 2001 From: Henry Date: Fri, 24 Jun 2011 13:40:20 +0100 Subject: [PATCH 05/19] SRFPimpleFoam: upgraded from OpenFOAM-1.7.x for OpenFOAM-dev --- .../incompressible/pimpleFoam/Allwmake | 1 + .../pimpleFoam/SRFPimpleFoam/Make/files | 3 + .../pimpleFoam/SRFPimpleFoam/Make/options | 13 + .../pimpleFoam/SRFPimpleFoam/SRFPimpleFoam.C | 105 +++ .../pimpleFoam/SRFPimpleFoam/UrelEqn.H | 12 + .../pimpleFoam/SRFPimpleFoam/createFields.H | 72 ++ .../pimpleFoam/SRFPimpleFoam/pEqn.H | 42 + src/finiteVolume/Make/files | 1 + .../SRFFreestreamVelocityFvPatchVectorField.C | 146 ++++ .../SRFFreestreamVelocityFvPatchVectorField.H | 164 ++++ .../SRFPimpleFoam/rotor2D/0/Urel | 47 + .../SRFPimpleFoam/rotor2D/0/epsilon | 49 ++ .../incompressible/SRFPimpleFoam/rotor2D/0/k | 48 + .../SRFPimpleFoam/rotor2D/0/nut | 48 + .../incompressible/SRFPimpleFoam/rotor2D/0/p | 44 + .../SRFPimpleFoam/rotor2D/Allrun | 12 + .../rotor2D/constant/RASProperties | 25 + .../rotor2D/constant/SRFProperties | 28 + .../constant/polyMesh/blockMeshDict.m4 | 818 ++++++++++++++++++ .../rotor2D/constant/polyMesh/boundary | 46 + .../rotor2D/constant/transportProperties | 39 + .../rotor2D/constant/turbulenceProperties | 20 + .../SRFPimpleFoam/rotor2D/makeMesh | 9 + .../SRFPimpleFoam/rotor2D/system/controlDict | 52 ++ .../SRFPimpleFoam/rotor2D/system/fvSchemes | 63 ++ .../SRFPimpleFoam/rotor2D/system/fvSolution | 83 ++ 26 files changed, 1990 insertions(+) create mode 100644 applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/Make/files create mode 100644 applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/Make/options create mode 100644 applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/SRFPimpleFoam.C create mode 100644 applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/UrelEqn.H create mode 100644 applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/createFields.H create mode 100644 applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/pEqn.H create mode 100644 src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFFreestreamVelocityFvPatchVectorField/SRFFreestreamVelocityFvPatchVectorField.C create mode 100644 src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFFreestreamVelocityFvPatchVectorField/SRFFreestreamVelocityFvPatchVectorField.H create mode 100644 tutorials/incompressible/SRFPimpleFoam/rotor2D/0/Urel create mode 100644 tutorials/incompressible/SRFPimpleFoam/rotor2D/0/epsilon create mode 100644 tutorials/incompressible/SRFPimpleFoam/rotor2D/0/k create mode 100644 tutorials/incompressible/SRFPimpleFoam/rotor2D/0/nut create mode 100644 tutorials/incompressible/SRFPimpleFoam/rotor2D/0/p create mode 100755 tutorials/incompressible/SRFPimpleFoam/rotor2D/Allrun create mode 100644 tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/RASProperties create mode 100644 tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/SRFProperties create mode 100644 tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/polyMesh/blockMeshDict.m4 create mode 100644 tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/polyMesh/boundary create mode 100644 tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/transportProperties create mode 100644 tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/turbulenceProperties create mode 100755 tutorials/incompressible/SRFPimpleFoam/rotor2D/makeMesh create mode 100644 tutorials/incompressible/SRFPimpleFoam/rotor2D/system/controlDict create mode 100644 tutorials/incompressible/SRFPimpleFoam/rotor2D/system/fvSchemes create mode 100644 tutorials/incompressible/SRFPimpleFoam/rotor2D/system/fvSolution diff --git a/applications/solvers/incompressible/pimpleFoam/Allwmake b/applications/solvers/incompressible/pimpleFoam/Allwmake index 71517c7319..8727bdb2de 100755 --- a/applications/solvers/incompressible/pimpleFoam/Allwmake +++ b/applications/solvers/incompressible/pimpleFoam/Allwmake @@ -3,6 +3,7 @@ cd ${0%/*} || exit 1 # run from this directory set -x wmake +wmake SRFPimpleFoam wmake pimpleDyMFoam # ----------------------------------------------------------------- end-of-file diff --git a/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/Make/files b/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/Make/files new file mode 100644 index 0000000000..a15ee9be6a --- /dev/null +++ b/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/Make/files @@ -0,0 +1,3 @@ +SRFPimpleFoam.C + +EXE = $(FOAM_APPBIN)/SRFPimpleFoam diff --git a/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/Make/options b/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/Make/options new file mode 100644 index 0000000000..47d95d97ce --- /dev/null +++ b/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/Make/options @@ -0,0 +1,13 @@ +EXE_INC = \ + -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \ + -I$(LIB_SRC)/transportModels \ + -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \ + -I$(LIB_SRC)/finiteVolume/lnInclude + +EXE_LIBS = \ + -lincompressibleTransportModels \ + -lincompressibleTurbulenceModel \ + -lincompressibleRASModels \ + -lincompressibleLESModels \ + -lfiniteVolume \ + -lmeshTools diff --git a/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/SRFPimpleFoam.C b/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/SRFPimpleFoam.C new file mode 100644 index 0000000000..3f1ef54157 --- /dev/null +++ b/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/SRFPimpleFoam.C @@ -0,0 +1,105 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2011 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 + SRFPimpleFoam + +Description + Large time-step transient solver for incompressible, flow in a single + rotating frame using the PIMPLE (merged PISO-SIMPLE) algorithm. + + Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected. + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "singlePhaseTransportModel.H" +#include "turbulenceModel.H" +#include "pimpleControl.H" +#include "SRFModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + #include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + #include "createFields.H" + #include "initContinuityErrs.H" + + pimpleControl pimple(mesh); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + Info<< "\nStarting time loop\n" << endl; + + while (runTime.run()) + { + #include "readTimeControls.H" + #include "CourantNo.H" + #include "setDeltaT.H" + + runTime++; + + Info<< "Time = " << runTime.timeName() << nl << endl; + + // --- Pressure-velocity PIMPLE corrector loop + for (pimple.start(); pimple.loop(); pimple++) + { + if (pimple.nOuterCorr() != 1) + { + p.storePrevIter(); + } + + #include "UrelEqn.H" + + // --- PISO loop + for (int corr=0; corrU(); + + if (pimple.turbCorr()) + { + turbulence->correct(); + } + } + + runTime.write(); + + Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" + << " ClockTime = " << runTime.elapsedClockTime() << " s" + << nl << endl; + } + + Info<< "End\n" << endl; + + return 0; +} + + +// ************************************************************************* // diff --git a/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/UrelEqn.H b/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/UrelEqn.H new file mode 100644 index 0000000000..a86b142276 --- /dev/null +++ b/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/UrelEqn.H @@ -0,0 +1,12 @@ + // Relative momentum predictor + tmp UrelEqn + ( + fvm::ddt(Urel) + + fvm::div(phi, Urel) + + turbulence->divDevReff(Urel) + + SRF->Su() + ); + + UrelEqn().relax(); + + solve(UrelEqn() == -fvc::grad(p)); diff --git a/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/createFields.H b/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/createFields.H new file mode 100644 index 0000000000..a6cff20e14 --- /dev/null +++ b/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/createFields.H @@ -0,0 +1,72 @@ +Info<< "Reading field p\n" << endl; +volScalarField p +( + IOobject + ( + "p", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh +); + +Info<< "Reading field Urel\n" << endl; +volVectorField Urel +( + IOobject + ( + "Urel", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh +); + +Info<< "Reading/calculating face flux field phi\n" << endl; +surfaceScalarField phi +( + IOobject + ( + "phi", + runTime.timeName(), + mesh, + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + linearInterpolate(Urel) & mesh.Sf() +); + +label pRefCell = 0; +scalar pRefValue = 0.0; +setRefCell(p, mesh.solutionDict().subDict("PIMPLE"), pRefCell, pRefValue); + +singlePhaseTransportModel laminarTransport(Urel, phi); + +autoPtr turbulence +( + incompressible::turbulenceModel::New(Urel, phi, laminarTransport) +); + +Info<< "Creating SRF model\n" << endl; +autoPtr SRF +( + SRF::SRFModel::New(Urel) +); + +// Create the absolute velocity +volVectorField U +( + IOobject + ( + "U", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + Urel + SRF->U() +); diff --git a/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/pEqn.H b/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/pEqn.H new file mode 100644 index 0000000000..a8c430061d --- /dev/null +++ b/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/pEqn.H @@ -0,0 +1,42 @@ +volScalarField rAUrel = 1.0/UrelEqn().A(); +Urel = rAUrel*UrelEqn().H(); + +if (pimple.nCorr() <= 1) +{ + UrelEqn.clear(); +} + +phi = (fvc::interpolate(Urel) & mesh.Sf()) + + fvc::ddtPhiCorr(rAUrel, Urel, phi); + +adjustPhi(phi, Urel, p); + +// Non-orthogonal pressure corrector loop +for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++) +{ + // Pressure corrector + fvScalarMatrix pEqn + ( + fvm::laplacian(rAUrel, p) == fvc::div(phi) + ); + + pEqn.setReference(pRefCell, pRefValue); + + pEqn.solve + ( + mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth))) + ); + + if (nonOrth == pimple.nNonOrthCorr()) + { + phi -= pEqn.flux(); + } +} + +#include "continuityErrs.H" + +p.relax(); + +// Momentum corrector +Urel -= rAUrel*fvc::grad(p); +Urel.correctBoundaryConditions(); diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index 0409816fa5..783518dfe5 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -369,6 +369,7 @@ $(SRF)/SRFModel/SRFModel/SRFModel.C $(SRF)/SRFModel/SRFModel/SRFModelNew.C $(SRF)/SRFModel/rpm/rpm.C $(SRF)/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.C +$(SRF)/derivedFvPatchFields/SRFFreestreamVelocityFvPatchVectorField/SRFFreestreamVelocityFvPatchVectorField.C fieldSources = $(general)/fieldSources $(fieldSources)/pressureGradientExplicitSource/pressureGradientExplicitSource.C diff --git a/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFFreestreamVelocityFvPatchVectorField/SRFFreestreamVelocityFvPatchVectorField.C b/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFFreestreamVelocityFvPatchVectorField/SRFFreestreamVelocityFvPatchVectorField.C new file mode 100644 index 0000000000..e41b43eeda --- /dev/null +++ b/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFFreestreamVelocityFvPatchVectorField/SRFFreestreamVelocityFvPatchVectorField.C @@ -0,0 +1,146 @@ +/*---------------------------------------------------------------------------* \ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2011 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 . + +\*---------------------------------------------------------------------------*/ + +#include "SRFFreestreamVelocityFvPatchVectorField.H" +#include "addToRunTimeSelectionTable.H" +#include "volFields.H" +#include "surfaceFields.H" + +#include "SRFModel.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::SRFFreestreamVelocityFvPatchVectorField:: +SRFFreestreamVelocityFvPatchVectorField +( + const fvPatch& p, + const DimensionedField& iF +) +: + inletOutletFvPatchVectorField(p, iF), + UInf_(vector::zero) +{} + + +Foam::SRFFreestreamVelocityFvPatchVectorField:: +SRFFreestreamVelocityFvPatchVectorField +( + const SRFFreestreamVelocityFvPatchVectorField& ptf, + const fvPatch& p, + const DimensionedField& iF, + const fvPatchFieldMapper& mapper +) +: + inletOutletFvPatchVectorField(ptf, p, iF, mapper), + UInf_(ptf.UInf_) +{} + + +Foam::SRFFreestreamVelocityFvPatchVectorField:: +SRFFreestreamVelocityFvPatchVectorField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + inletOutletFvPatchVectorField(p, iF), + UInf_(dict.lookup("UInf")) +{ + fvPatchVectorField::operator=(vectorField("value", dict, p.size())); +} + + +Foam::SRFFreestreamVelocityFvPatchVectorField:: +SRFFreestreamVelocityFvPatchVectorField +( + const SRFFreestreamVelocityFvPatchVectorField& srfvpvf +) +: + inletOutletFvPatchVectorField(srfvpvf), + UInf_(srfvpvf.UInf_) +{} + + +Foam::SRFFreestreamVelocityFvPatchVectorField:: +SRFFreestreamVelocityFvPatchVectorField +( + const SRFFreestreamVelocityFvPatchVectorField& srfvpvf, + const DimensionedField& iF +) +: + inletOutletFvPatchVectorField(srfvpvf, iF), + UInf_(srfvpvf.UInf_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::SRFFreestreamVelocityFvPatchVectorField::updateCoeffs() +{ + if (updated()) + { + return; + } + + // Get reference to the SRF model + const SRF::SRFModel& srf = + db().lookupObject("SRFProperties"); + + scalar time = this->db().time().value(); + scalar theta = time*mag(srf.omega().value()); + + refValue() = + cos(theta)*UInf_ + sin(theta)*(srf.axis() ^ UInf_) + - srf.velocity(patch().Cf()); + + // Set the inlet-outlet choice based on the direction of the freestream + valueFraction() = 1.0 - pos(refValue() & patch().Sf()); + + mixedFvPatchField::updateCoeffs(); +} + + +void Foam::SRFFreestreamVelocityFvPatchVectorField::write(Ostream& os) const +{ + fvPatchVectorField::write(os); + os.writeKeyword("UInf") << UInf_ << token::END_STATEMENT << nl; + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + makePatchTypeField + ( + fvPatchVectorField, + SRFFreestreamVelocityFvPatchVectorField + ); +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFFreestreamVelocityFvPatchVectorField/SRFFreestreamVelocityFvPatchVectorField.H b/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFFreestreamVelocityFvPatchVectorField/SRFFreestreamVelocityFvPatchVectorField.H new file mode 100644 index 0000000000..176c7d9479 --- /dev/null +++ b/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFFreestreamVelocityFvPatchVectorField/SRFFreestreamVelocityFvPatchVectorField.H @@ -0,0 +1,164 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2011 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 . + +Class + Foam::SRFVelocityFvPatchVectorField + +Description + Freestream velocity patch to be used with SRF model + to apply the appropriate rotation transformation in time and space. + +SourceFiles + SRFVelocityFvPatchVectorField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef SRFFreestreamVelocityFvPatchVectorField_H +#define SRFFreestreamVelocityFvPatchVectorField_H + +#include "inletOutletFvPatchFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class SRFFreestreamVelocityFvPatchVectorField Declaration +\*---------------------------------------------------------------------------*/ + +class SRFFreestreamVelocityFvPatchVectorField +: + public inletOutletFvPatchVectorField +{ + // Private data + + //- Velocity of the free stream in the absolute frame + vector UInf_; + + +public: + + //- Runtime type information + TypeName("SRFFreestreamVelocity"); + + + // Constructors + + //- Construct from patch and internal field + SRFFreestreamVelocityFvPatchVectorField + ( + const fvPatch&, + const DimensionedField& + ); + + //- Construct from patch, internal field and dictionary + SRFFreestreamVelocityFvPatchVectorField + ( + const fvPatch&, + const DimensionedField&, + const dictionary& + ); + + //- Construct by mapping given SRFFreestreamVelocityFvPatchVectorField + // onto a new patch + SRFFreestreamVelocityFvPatchVectorField + ( + const SRFFreestreamVelocityFvPatchVectorField&, + const fvPatch&, + const DimensionedField&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + SRFFreestreamVelocityFvPatchVectorField + ( + const SRFFreestreamVelocityFvPatchVectorField& + ); + + //- Construct and return a clone + virtual tmp clone() const + { + return tmp + ( + new SRFFreestreamVelocityFvPatchVectorField(*this) + ); + } + + //- Construct as copy setting internal field reference + SRFFreestreamVelocityFvPatchVectorField + ( + const SRFFreestreamVelocityFvPatchVectorField&, + const DimensionedField& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp clone + ( + const DimensionedField& iF + ) const + { + return tmp + ( + new SRFFreestreamVelocityFvPatchVectorField(*this, iF) + ); + } + + + // Member functions + + // Access + + //- Return the velocity at infinity + const vector& UInf() const + { + return UInf_; + } + + //- Return reference to the velocity at infinity to allow adjustment + vector& UInf() + { + return UInf_; + } + + + // Evaluation functions + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/tutorials/incompressible/SRFPimpleFoam/rotor2D/0/Urel b/tutorials/incompressible/SRFPimpleFoam/rotor2D/0/Urel new file mode 100644 index 0000000000..253e92bd33 --- /dev/null +++ b/tutorials/incompressible/SRFPimpleFoam/rotor2D/0/Urel @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 2.0.0 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + object Urel; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + rotor + { + type fixedValue; + value uniform (0 0 0); + } + + freestream + { + type SRFFreestreamVelocity; + UInf (1 0 0); + value uniform (0 0 0); + } + + front + { + type empty; + } + + back + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/SRFPimpleFoam/rotor2D/0/epsilon b/tutorials/incompressible/SRFPimpleFoam/rotor2D/0/epsilon new file mode 100644 index 0000000000..67d33de516 --- /dev/null +++ b/tutorials/incompressible/SRFPimpleFoam/rotor2D/0/epsilon @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 2.0.0 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object epsilon; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 0 2 -3 0 0 0 0 ]; + +internalField uniform 3.75e-4; + +boundaryField +{ + rotor + { + type epsilonWallFunction; + U Urel; + value uniform 3.75e-4; + } + + freestream + { + type inletOutlet; + inletValue uniform 3.75e-4; + } + + front + { + type empty; + } + + back + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/SRFPimpleFoam/rotor2D/0/k b/tutorials/incompressible/SRFPimpleFoam/rotor2D/0/k new file mode 100644 index 0000000000..fbf0a78e94 --- /dev/null +++ b/tutorials/incompressible/SRFPimpleFoam/rotor2D/0/k @@ -0,0 +1,48 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 2.0.0 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object k; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 0 2 -2 0 0 0 0 ]; + +internalField uniform 3.75e-3; + +boundaryField +{ + rotor + { + type kqRWallFunction; + value uniform 3.75e-3; + } + + freestream + { + type inletOutlet; + inletValue uniform 3.75e-3; + } + + front + { + type empty; + } + + back + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/SRFPimpleFoam/rotor2D/0/nut b/tutorials/incompressible/SRFPimpleFoam/rotor2D/0/nut new file mode 100644 index 0000000000..2d320999d6 --- /dev/null +++ b/tutorials/incompressible/SRFPimpleFoam/rotor2D/0/nut @@ -0,0 +1,48 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 2.0.0 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object nut; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 0 2 -1 0 0 0 0 ]; + +internalField uniform 0; + +boundaryField +{ + rotor + { + type nutkWallFunction; + value uniform 0; + } + + freestream + { + type calculated; + value uniform 0; + } + + front + { + type empty; + } + + back + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/SRFPimpleFoam/rotor2D/0/p b/tutorials/incompressible/SRFPimpleFoam/rotor2D/0/p new file mode 100644 index 0000000000..e74c653bf3 --- /dev/null +++ b/tutorials/incompressible/SRFPimpleFoam/rotor2D/0/p @@ -0,0 +1,44 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 2.0.0 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + rotor + { + type zeroGradient; + } + + freestream + { + type zeroGradient; + } + + front + { + type empty; + } + + back + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/SRFPimpleFoam/rotor2D/Allrun b/tutorials/incompressible/SRFPimpleFoam/rotor2D/Allrun new file mode 100755 index 0000000000..caad132d7b --- /dev/null +++ b/tutorials/incompressible/SRFPimpleFoam/rotor2D/Allrun @@ -0,0 +1,12 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +application=`getApplication` + +./makeMesh +runApplication $application + +# ----------------------------------------------------------------- end-of-file diff --git a/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/RASProperties b/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/RASProperties new file mode 100644 index 0000000000..d0fb72da9a --- /dev/null +++ b/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/RASProperties @@ -0,0 +1,25 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 2.0.0 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object RASProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +RASModel kEpsilon; + +turbulence on; + +printCoeffs on; + + +// ************************************************************************* // diff --git a/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/SRFProperties b/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/SRFProperties new file mode 100644 index 0000000000..1c1eefad8e --- /dev/null +++ b/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/SRFProperties @@ -0,0 +1,28 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 2.0.0 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object SRFProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +SRFModel rpm; + +axis (0 0 1); + +rpmCoeffs +{ + rpm 60; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/polyMesh/blockMeshDict.m4 b/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/polyMesh/blockMeshDict.m4 new file mode 100644 index 0000000000..8fc550c912 --- /dev/null +++ b/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/polyMesh/blockMeshDict.m4 @@ -0,0 +1,818 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 2.0.0 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + `format' ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// General macros to create 2D/extruded-2D meshes + +changecom(//)changequote([,]) +define(calc, [esyscmd(perl -e 'print ($1)')]) +define(VCOUNT, 0) +define(vlabel, [[// ]Vertex $1 = VCOUNT define($1, VCOUNT)define([VCOUNT], incr(VCOUNT))]) +define(pi, 3.14159265) + +define(hex2D, hex ($1b $2b $3b $4b $1t $2t $3t $4t)) +define(quad2D, ($1b $2b $2t $1t)) +define(frontQuad, ($1t $2t $3t $4t)) +define(backQuad, ($1b $4b $3b $2b)) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 0.1; + +// Hub radius +define(r, 0.05) + +// Impeller-tip radius +define(rb, 0.2) + +// Baffle-tip radius +define(Rb, 0.7) + +// Tank radius +define(R, 1) + +// MRF region radius +define(ri, calc(0.5*(rb + Rb))) + +// Thickness of 2D slab +define(z, 0.1) + +// Base z +define(Zb, 0) + +// Top z +define(Zt, calc(Zb + z)) + +// Number of cells radially between hub and impeller tip +define(Nr, 6) + +// Number of cells radially in each of the two regions between +// impeller and baffle tips +define(Ni, 8) + +// Number of cells radially between baffle tip and tank +define(NR, 8) + +// Number of cells azimuthally in each of the 8 blocks +define(Na, 12) + +// Number of cells in the thickness of the slab +define(Nz, 1) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +define(vert, (x$1$2 y$1$2 $3)) +define(evert, (ex$1$2 ey$1$2 $3)) + +define(a0, 0) +define(a1, -45) +define(a2, -90) +define(a3, -135) +define(a4, 180) +define(a5, 135) +define(a6, 90) +define(a7, 45) + +define(ea0, -22.5) +define(ea1, -67.5) +define(ea2, -112.5) +define(ea3, -157.5) +define(ea4, 157.5) +define(ea5, 112.5) +define(ea6, 67.5) +define(ea7, 22.5) + +define(ca0, calc(cos((pi/180)*a0))) +define(ca1, calc(cos((pi/180)*a1))) +define(ca2, calc(cos((pi/180)*a2))) +define(ca3, calc(cos((pi/180)*a3))) +define(ca4, calc(cos((pi/180)*a4))) +define(ca5, calc(cos((pi/180)*a5))) +define(ca6, calc(cos((pi/180)*a6))) +define(ca7, calc(cos((pi/180)*a7))) + +define(sa0, calc(sin((pi/180)*a0))) +define(sa1, calc(sin((pi/180)*a1))) +define(sa2, calc(sin((pi/180)*a2))) +define(sa3, calc(sin((pi/180)*a3))) +define(sa4, calc(sin((pi/180)*a4))) +define(sa5, calc(sin((pi/180)*a5))) +define(sa6, calc(sin((pi/180)*a6))) +define(sa7, calc(sin((pi/180)*a7))) + +define(cea0, calc(cos((pi/180)*ea0))) +define(cea1, calc(cos((pi/180)*ea1))) +define(cea2, calc(cos((pi/180)*ea2))) +define(cea3, calc(cos((pi/180)*ea3))) +define(cea4, calc(cos((pi/180)*ea4))) +define(cea5, calc(cos((pi/180)*ea5))) +define(cea6, calc(cos((pi/180)*ea6))) +define(cea7, calc(cos((pi/180)*ea7))) + +define(sea0, calc(sin((pi/180)*ea0))) +define(sea1, calc(sin((pi/180)*ea1))) +define(sea2, calc(sin((pi/180)*ea2))) +define(sea3, calc(sin((pi/180)*ea3))) +define(sea4, calc(sin((pi/180)*ea4))) +define(sea5, calc(sin((pi/180)*ea5))) +define(sea6, calc(sin((pi/180)*ea6))) +define(sea7, calc(sin((pi/180)*ea7))) + +define(x00, calc(r*ca0)) +define(x01, calc(r*ca1)) +define(x02, calc(r*ca2)) +define(x03, calc(r*ca3)) +define(x04, calc(r*ca4)) +define(x05, calc(r*ca5)) +define(x06, calc(r*ca6)) +define(x07, calc(r*ca7)) + +define(x10, calc(rb*ca0)) +define(x11, calc(rb*ca1)) +define(x12, calc(rb*ca2)) +define(x13, calc(rb*ca3)) +define(x14, calc(rb*ca4)) +define(x15, calc(rb*ca5)) +define(x16, calc(rb*ca6)) +define(x17, calc(rb*ca7)) + +define(x20, calc(ri*ca0)) +define(x21, calc(ri*ca1)) +define(x22, calc(ri*ca2)) +define(x23, calc(ri*ca3)) +define(x24, calc(ri*ca4)) +define(x25, calc(ri*ca5)) +define(x26, calc(ri*ca6)) +define(x27, calc(ri*ca7)) + +define(x30, calc(Rb*ca0)) +define(x31, calc(Rb*ca1)) +define(x32, calc(Rb*ca2)) +define(x33, calc(Rb*ca3)) +define(x34, calc(Rb*ca4)) +define(x35, calc(Rb*ca5)) +define(x36, calc(Rb*ca6)) +define(x37, calc(Rb*ca7)) + +define(x40, calc(R*ca0)) +define(x41, calc(R*ca1)) +define(x42, calc(R*ca2)) +define(x43, calc(R*ca3)) +define(x44, calc(R*ca4)) +define(x45, calc(R*ca5)) +define(x46, calc(R*ca6)) +define(x47, calc(R*ca7)) + +define(y00, calc(r*sa0)) +define(y01, calc(r*sa1)) +define(y02, calc(r*sa2)) +define(y03, calc(r*sa3)) +define(y04, calc(r*sa4)) +define(y05, calc(r*sa5)) +define(y06, calc(r*sa6)) +define(y07, calc(r*sa7)) + +define(y10, calc(rb*sa0)) +define(y11, calc(rb*sa1)) +define(y12, calc(rb*sa2)) +define(y13, calc(rb*sa3)) +define(y14, calc(rb*sa4)) +define(y15, calc(rb*sa5)) +define(y16, calc(rb*sa6)) +define(y17, calc(rb*sa7)) + +define(y20, calc(ri*sa0)) +define(y21, calc(ri*sa1)) +define(y22, calc(ri*sa2)) +define(y23, calc(ri*sa3)) +define(y24, calc(ri*sa4)) +define(y25, calc(ri*sa5)) +define(y26, calc(ri*sa6)) +define(y27, calc(ri*sa7)) + +define(y30, calc(Rb*sa0)) +define(y31, calc(Rb*sa1)) +define(y32, calc(Rb*sa2)) +define(y33, calc(Rb*sa3)) +define(y34, calc(Rb*sa4)) +define(y35, calc(Rb*sa5)) +define(y36, calc(Rb*sa6)) +define(y37, calc(Rb*sa7)) + +define(y40, calc(R*sa0)) +define(y41, calc(R*sa1)) +define(y42, calc(R*sa2)) +define(y43, calc(R*sa3)) +define(y44, calc(R*sa4)) +define(y45, calc(R*sa5)) +define(y46, calc(R*sa6)) +define(y47, calc(R*sa7)) + +define(ex00, calc(r*cea0)) +define(ex01, calc(r*cea1)) +define(ex02, calc(r*cea2)) +define(ex03, calc(r*cea3)) +define(ex04, calc(r*cea4)) +define(ex05, calc(r*cea5)) +define(ex06, calc(r*cea6)) +define(ex07, calc(r*cea7)) + +define(ex10, calc(rb*cea0)) +define(ex11, calc(rb*cea1)) +define(ex12, calc(rb*cea2)) +define(ex13, calc(rb*cea3)) +define(ex14, calc(rb*cea4)) +define(ex15, calc(rb*cea5)) +define(ex16, calc(rb*cea6)) +define(ex17, calc(rb*cea7)) + +define(ex20, calc(ri*cea0)) +define(ex21, calc(ri*cea1)) +define(ex22, calc(ri*cea2)) +define(ex23, calc(ri*cea3)) +define(ex24, calc(ri*cea4)) +define(ex25, calc(ri*cea5)) +define(ex26, calc(ri*cea6)) +define(ex27, calc(ri*cea7)) + +define(ex30, calc(Rb*cea0)) +define(ex31, calc(Rb*cea1)) +define(ex32, calc(Rb*cea2)) +define(ex33, calc(Rb*cea3)) +define(ex34, calc(Rb*cea4)) +define(ex35, calc(Rb*cea5)) +define(ex36, calc(Rb*cea6)) +define(ex37, calc(Rb*cea7)) + +define(ex40, calc(R*cea0)) +define(ex41, calc(R*cea1)) +define(ex42, calc(R*cea2)) +define(ex43, calc(R*cea3)) +define(ex44, calc(R*cea4)) +define(ex45, calc(R*cea5)) +define(ex46, calc(R*cea6)) +define(ex47, calc(R*cea7)) + +define(ey00, calc(r*sea0)) +define(ey01, calc(r*sea1)) +define(ey02, calc(r*sea2)) +define(ey03, calc(r*sea3)) +define(ey04, calc(r*sea4)) +define(ey05, calc(r*sea5)) +define(ey06, calc(r*sea6)) +define(ey07, calc(r*sea7)) + +define(ey10, calc(rb*sea0)) +define(ey11, calc(rb*sea1)) +define(ey12, calc(rb*sea2)) +define(ey13, calc(rb*sea3)) +define(ey14, calc(rb*sea4)) +define(ey15, calc(rb*sea5)) +define(ey16, calc(rb*sea6)) +define(ey17, calc(rb*sea7)) + +define(ey20, calc(ri*sea0)) +define(ey21, calc(ri*sea1)) +define(ey22, calc(ri*sea2)) +define(ey23, calc(ri*sea3)) +define(ey24, calc(ri*sea4)) +define(ey25, calc(ri*sea5)) +define(ey26, calc(ri*sea6)) +define(ey27, calc(ri*sea7)) + +define(ey30, calc(Rb*sea0)) +define(ey31, calc(Rb*sea1)) +define(ey32, calc(Rb*sea2)) +define(ey33, calc(Rb*sea3)) +define(ey34, calc(Rb*sea4)) +define(ey35, calc(Rb*sea5)) +define(ey36, calc(Rb*sea6)) +define(ey37, calc(Rb*sea7)) + +define(ey40, calc(R*sea0)) +define(ey41, calc(R*sea1)) +define(ey42, calc(R*sea2)) +define(ey43, calc(R*sea3)) +define(ey44, calc(R*sea4)) +define(ey45, calc(R*sea5)) +define(ey46, calc(R*sea6)) +define(ey47, calc(R*sea7)) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +vertices +( + vert(0, 0, Zb) vlabel(r0b) + vert(0, 0, Zb) vlabel(r0sb) + vert(0, 1, Zb) vlabel(r1b) + vert(0, 2, Zb) vlabel(r2b) + vert(0, 2, Zb) vlabel(r2sb) + vert(0, 3, Zb) vlabel(r3b) + vert(0, 4, Zb) vlabel(r4b) + vert(0, 4, Zb) vlabel(r4sb) + vert(0, 5, Zb) vlabel(r5b) + vert(0, 6, Zb) vlabel(r6b) + vert(0, 6, Zb) vlabel(r6sb) + vert(0, 7, Zb) vlabel(r7b) + + vert(1, 0, Zb) vlabel(rb0b) + vert(1, 1, Zb) vlabel(rb1b) + vert(1, 2, Zb) vlabel(rb2b) + vert(1, 3, Zb) vlabel(rb3b) + vert(1, 4, Zb) vlabel(rb4b) + vert(1, 5, Zb) vlabel(rb5b) + vert(1, 6, Zb) vlabel(rb6b) + vert(1, 7, Zb) vlabel(rb7b) + + vert(2, 0, Zb) vlabel(ri0b) + vert(2, 1, Zb) vlabel(ri1b) + vert(2, 2, Zb) vlabel(ri2b) + vert(2, 3, Zb) vlabel(ri3b) + vert(2, 4, Zb) vlabel(ri4b) + vert(2, 5, Zb) vlabel(ri5b) + vert(2, 6, Zb) vlabel(ri6b) + vert(2, 7, Zb) vlabel(ri7b) + + vert(3, 0, Zb) vlabel(Rb0b) + vert(3, 1, Zb) vlabel(Rb1b) + vert(3, 2, Zb) vlabel(Rb2b) + vert(3, 3, Zb) vlabel(Rb3b) + vert(3, 4, Zb) vlabel(Rb4b) + vert(3, 5, Zb) vlabel(Rb5b) + vert(3, 6, Zb) vlabel(Rb6b) + vert(3, 7, Zb) vlabel(Rb7b) + + vert(4, 0, Zb) vlabel(R0b) + vert(4, 1, Zb) vlabel(R1b) + vert(4, 1, Zb) vlabel(R1b) + vert(4, 2, Zb) vlabel(R2b) + vert(4, 3, Zb) vlabel(R3b) + vert(4, 3, Zb) vlabel(R3b) + vert(4, 4, Zb) vlabel(R4b) + vert(4, 5, Zb) vlabel(R5b) + vert(4, 5, Zb) vlabel(R5b) + vert(4, 6, Zb) vlabel(R6b) + vert(4, 7, Zb) vlabel(R7b) + vert(4, 7, Zb) vlabel(R7b) + + vert(0, 0, Zt) vlabel(r0t) + vert(0, 0, Zt) vlabel(r0st) + vert(0, 1, Zt) vlabel(r1t) + vert(0, 2, Zt) vlabel(r2t) + vert(0, 2, Zt) vlabel(r2st) + vert(0, 3, Zt) vlabel(r3t) + vert(0, 4, Zt) vlabel(r4t) + vert(0, 4, Zt) vlabel(r4st) + vert(0, 5, Zt) vlabel(r5t) + vert(0, 6, Zt) vlabel(r6t) + vert(0, 6, Zt) vlabel(r6st) + vert(0, 7, Zt) vlabel(r7t) + + vert(1, 0, Zt) vlabel(rb0t) + vert(1, 1, Zt) vlabel(rb1t) + vert(1, 2, Zt) vlabel(rb2t) + vert(1, 3, Zt) vlabel(rb3t) + vert(1, 4, Zt) vlabel(rb4t) + vert(1, 5, Zt) vlabel(rb5t) + vert(1, 6, Zt) vlabel(rb6t) + vert(1, 7, Zt) vlabel(rb7t) + + vert(2, 0, Zt) vlabel(ri0t) + vert(2, 1, Zt) vlabel(ri1t) + vert(2, 2, Zt) vlabel(ri2t) + vert(2, 3, Zt) vlabel(ri3t) + vert(2, 4, Zt) vlabel(ri4t) + vert(2, 5, Zt) vlabel(ri5t) + vert(2, 6, Zt) vlabel(ri6t) + vert(2, 7, Zt) vlabel(ri7t) + + vert(3, 0, Zt) vlabel(Rb0t) + vert(3, 1, Zt) vlabel(Rb1t) + vert(3, 2, Zt) vlabel(Rb2t) + vert(3, 3, Zt) vlabel(Rb3t) + vert(3, 4, Zt) vlabel(Rb4t) + vert(3, 5, Zt) vlabel(Rb5t) + vert(3, 6, Zt) vlabel(Rb6t) + vert(3, 7, Zt) vlabel(Rb7t) + + vert(4, 0, Zt) vlabel(R0t) + vert(4, 1, Zt) vlabel(R1t) + vert(4, 1, Zt) vlabel(R1t) + vert(4, 2, Zt) vlabel(R2t) + vert(4, 3, Zt) vlabel(R3t) + vert(4, 3, Zt) vlabel(R3t) + vert(4, 4, Zt) vlabel(R4t) + vert(4, 5, Zt) vlabel(R5t) + vert(4, 5, Zt) vlabel(R5t) + vert(4, 6, Zt) vlabel(R6t) + vert(4, 7, Zt) vlabel(R7t) + vert(4, 7, Zt) vlabel(R7t) +); + +blocks +( + // block0 + hex2D(r0, r1, rb1, rb0) + rotor + (Na Nr Nz) + simpleGrading (1 1 1) + + // block1 + hex2D(r1, r2s, rb2, rb1) + rotor + (Na Nr Nz) + simpleGrading (1 1 1) + + // block2 + hex2D(r2, r3, rb3, rb2) + rotor + (Na Nr Nz) + simpleGrading (1 1 1) + + // block3 + hex2D(r3, r4s, rb4, rb3) + rotor + (Na Nr Nz) + simpleGrading (1 1 1) + + // block4 + hex2D(r4, r5, rb5, rb4) + rotor + (Na Nr Nz) + simpleGrading (1 1 1) + + // block5 + hex2D(r5, r6s, rb6, rb5) + rotor + (Na Nr Nz) + simpleGrading (1 1 1) + + // block6 + hex2D(r6, r7, rb7, rb6) + rotor + (Na Nr Nz) + simpleGrading (1 1 1) + + // block7 + hex2D(r7, r0s, rb0, rb7) + rotor + (Na Nr Nz) + simpleGrading (1 1 1) + + // block0 + hex2D(rb0, rb1, ri1, ri0) + rotor + (Na Ni Nz) + simpleGrading (1 1 1) + + // block1 + hex2D(rb1, rb2, ri2, ri1) + rotor + (Na Ni Nz) + simpleGrading (1 1 1) + + // block2 + hex2D(rb2, rb3, ri3, ri2) + rotor + (Na Ni Nz) + simpleGrading (1 1 1) + + // block3 + hex2D(rb3, rb4, ri4, ri3) + rotor + (Na Ni Nz) + simpleGrading (1 1 1) + + // block4 + hex2D(rb4, rb5, ri5, ri4) + rotor + (Na Ni Nz) + simpleGrading (1 1 1) + + // block5 + hex2D(rb5, rb6, ri6, ri5) + rotor + (Na Ni Nz) + simpleGrading (1 1 1) + + // block6 + hex2D(rb6, rb7, ri7, ri6) + rotor + (Na Ni Nz) + simpleGrading (1 1 1) + + // block7 + hex2D(rb7, rb0, ri0, ri7) + rotor + (Na Ni Nz) + simpleGrading (1 1 1) + + // block0 + hex2D(ri0, ri1, Rb1, Rb0) + (Na Ni Nz) + simpleGrading (1 1 1) + + // block1 + hex2D(ri1, ri2, Rb2, Rb1) + (Na Ni Nz) + simpleGrading (1 1 1) + + // block2 + hex2D(ri2, ri3, Rb3, Rb2) + (Na Ni Nz) + simpleGrading (1 1 1) + + // block3 + hex2D(ri3, ri4, Rb4, Rb3) + (Na Ni Nz) + simpleGrading (1 1 1) + + // block4 + hex2D(ri4, ri5, Rb5, Rb4) + (Na Ni Nz) + simpleGrading (1 1 1) + + // block5 + hex2D(ri5, ri6, Rb6, Rb5) + (Na Ni Nz) + simpleGrading (1 1 1) + + // block6 + hex2D(ri6, ri7, Rb7, Rb6) + (Na Ni Nz) + simpleGrading (1 1 1) + + // block7 + hex2D(ri7, ri0, Rb0, Rb7) + (Na Ni Nz) + simpleGrading (1 1 1) + + // block0 + hex2D(Rb0, Rb1, R1, R0) + (Na NR Nz) + simpleGrading (1 1 1) + + // block1 + hex2D(Rb1, Rb2, R2, R1) + (Na NR Nz) + simpleGrading (1 1 1) + + // block2 + hex2D(Rb2, Rb3, R3, R2) + (Na NR Nz) + simpleGrading (1 1 1) + + // block3 + hex2D(Rb3, Rb4, R4, R3) + (Na NR Nz) + simpleGrading (1 1 1) + + // block4 + hex2D(Rb4, Rb5, R5, R4) + (Na NR Nz) + simpleGrading (1 1 1) + + // block5 + hex2D(Rb5, Rb6, R6, R5) + (Na NR Nz) + simpleGrading (1 1 1) + + // block6 + hex2D(Rb6, Rb7, R7, R6) + (Na NR Nz) + simpleGrading (1 1 1) + + // block7 + hex2D(Rb7, Rb0, R0, R7) + (Na NR Nz) + simpleGrading (1 1 1) +); + +edges +( + arc r0b r1b evert(0, 0, Zb) + arc r1b r2sb evert(0, 1, Zb) + arc r2b r3b evert(0, 2, Zb) + arc r3b r4sb evert(0, 3, Zb) + arc r4b r5b evert(0, 4, Zb) + arc r5b r6sb evert(0, 5, Zb) + arc r6b r7b evert(0, 6, Zb) + arc r7b r0sb evert(0, 7, Zb) + + arc rb0b rb1b evert(1, 0, Zb) + arc rb1b rb2b evert(1, 1, Zb) + arc rb2b rb3b evert(1, 2, Zb) + arc rb3b rb4b evert(1, 3, Zb) + arc rb4b rb5b evert(1, 4, Zb) + arc rb5b rb6b evert(1, 5, Zb) + arc rb6b rb7b evert(1, 6, Zb) + arc rb7b rb0b evert(1, 7, Zb) + + arc ri0b ri1b evert(2, 0, Zb) + arc ri1b ri2b evert(2, 1, Zb) + arc ri2b ri3b evert(2, 2, Zb) + arc ri3b ri4b evert(2, 3, Zb) + arc ri4b ri5b evert(2, 4, Zb) + arc ri5b ri6b evert(2, 5, Zb) + arc ri6b ri7b evert(2, 6, Zb) + arc ri7b ri0b evert(2, 7, Zb) + + arc Rb0b Rb1b evert(3, 0, Zb) + arc Rb1b Rb2b evert(3, 1, Zb) + arc Rb2b Rb3b evert(3, 2, Zb) + arc Rb3b Rb4b evert(3, 3, Zb) + arc Rb4b Rb5b evert(3, 4, Zb) + arc Rb5b Rb6b evert(3, 5, Zb) + arc Rb6b Rb7b evert(3, 6, Zb) + arc Rb7b Rb0b evert(3, 7, Zb) + + arc R0b R1b evert(4, 0, Zb) + arc R1b R2b evert(4, 1, Zb) + arc R2b R3b evert(4, 2, Zb) + arc R3b R4b evert(4, 3, Zb) + arc R4b R5b evert(4, 4, Zb) + arc R5b R6b evert(4, 5, Zb) + arc R6b R7b evert(4, 6, Zb) + arc R7b R0b evert(4, 7, Zb) + + arc r0t r1t evert(0, 0, Zt) + arc r1t r2st evert(0, 1, Zt) + arc r2t r3t evert(0, 2, Zt) + arc r3t r4st evert(0, 3, Zt) + arc r4t r5t evert(0, 4, Zt) + arc r5t r6st evert(0, 5, Zt) + arc r6t r7t evert(0, 6, Zt) + arc r7t r0st evert(0, 7, Zt) + + arc rb0t rb1t evert(1, 0, Zt) + arc rb1t rb2t evert(1, 1, Zt) + arc rb2t rb3t evert(1, 2, Zt) + arc rb3t rb4t evert(1, 3, Zt) + arc rb4t rb5t evert(1, 4, Zt) + arc rb5t rb6t evert(1, 5, Zt) + arc rb6t rb7t evert(1, 6, Zt) + arc rb7t rb0t evert(1, 7, Zt) + + arc ri0t ri1t evert(2, 0, Zt) + arc ri1t ri2t evert(2, 1, Zt) + arc ri2t ri3t evert(2, 2, Zt) + arc ri3t ri4t evert(2, 3, Zt) + arc ri4t ri5t evert(2, 4, Zt) + arc ri5t ri6t evert(2, 5, Zt) + arc ri6t ri7t evert(2, 6, Zt) + arc ri7t ri0t evert(2, 7, Zt) + + arc Rb0t Rb1t evert(3, 0, Zt) + arc Rb1t Rb2t evert(3, 1, Zt) + arc Rb2t Rb3t evert(3, 2, Zt) + arc Rb3t Rb4t evert(3, 3, Zt) + arc Rb4t Rb5t evert(3, 4, Zt) + arc Rb5t Rb6t evert(3, 5, Zt) + arc Rb6t Rb7t evert(3, 6, Zt) + arc Rb7t Rb0t evert(3, 7, Zt) + + arc R0t R1t evert(4, 0, Zt) + arc R1t R2t evert(4, 1, Zt) + arc R2t R3t evert(4, 2, Zt) + arc R3t R4t evert(4, 3, Zt) + arc R4t R5t evert(4, 4, Zt) + arc R5t R6t evert(4, 5, Zt) + arc R6t R7t evert(4, 6, Zt) + arc R7t R0t evert(4, 7, Zt) +); + +patches +( + wall rotor + ( + quad2D(r0, r1) + quad2D(r1, r2s) + quad2D(r2, r3) + quad2D(r3, r4s) + quad2D(r4, r5) + quad2D(r5, r6s) + quad2D(r6, r7) + quad2D(r7, r0s) + + quad2D(r0, rb0) + quad2D(r0s, rb0) + + quad2D(r2, rb2) + quad2D(r2s, rb2) + + quad2D(r4, rb4) + quad2D(r4s, rb4) + + quad2D(r6, rb6) + quad2D(r6s, rb6) + ) + + patch freestream + ( + quad2D(R0, R1) + quad2D(R1, R2) + quad2D(R2, R3) + quad2D(R3, R4) + quad2D(R4, R5) + quad2D(R5, R6) + quad2D(R6, R7) + quad2D(R7, R0) + + //quad2D(R1, Rb1) + //quad2D(R1, Rb1) + + //quad2D(R3, Rb3) + //quad2D(R3, Rb3) + + //quad2D(R5, Rb5) + //quad2D(R5, Rb5) + + //quad2D(R7, Rb7) + //quad2D(R7, Rb7) + ) + + empty front + ( + frontQuad(r0, r1, rb1, rb0) + frontQuad(r1, r2s, rb2, rb1) + frontQuad(r2, r3, rb3, rb2) + frontQuad(r3, r4s, rb4, rb3) + frontQuad(r4, r5, rb5, rb4) + frontQuad(r5, r6s, rb6, rb5) + frontQuad(r6, r7, rb7, rb6) + frontQuad(r7, r0s, rb0, rb7) + frontQuad(rb0, rb1, ri1, ri0) + frontQuad(rb1, rb2, ri2, ri1) + frontQuad(rb2, rb3, ri3, ri2) + frontQuad(rb3, rb4, ri4, ri3) + frontQuad(rb4, rb5, ri5, ri4) + frontQuad(rb5, rb6, ri6, ri5) + frontQuad(rb6, rb7, ri7, ri6) + frontQuad(rb7, rb0, ri0, ri7) + frontQuad(ri0, ri1, Rb1, Rb0) + frontQuad(ri1, ri2, Rb2, Rb1) + frontQuad(ri2, ri3, Rb3, Rb2) + frontQuad(ri3, ri4, Rb4, Rb3) + frontQuad(ri4, ri5, Rb5, Rb4) + frontQuad(ri5, ri6, Rb6, Rb5) + frontQuad(ri6, ri7, Rb7, Rb6) + frontQuad(ri7, ri0, Rb0, Rb7) + frontQuad(Rb0, Rb1, R1, R0) + frontQuad(Rb1, Rb2, R2, R1) + frontQuad(Rb2, Rb3, R3, R2) + frontQuad(Rb3, Rb4, R4, R3) + frontQuad(Rb4, Rb5, R5, R4) + frontQuad(Rb5, Rb6, R6, R5) + frontQuad(Rb6, Rb7, R7, R6) + frontQuad(Rb7, Rb0, R0, R7) + ) + + empty back + ( + backQuad(r0, r1, rb1, rb0) + backQuad(r1, r2s, rb2, rb1) + backQuad(r2, r3, rb3, rb2) + backQuad(r3, r4s, rb4, rb3) + backQuad(r4, r5, rb5, rb4) + backQuad(r5, r6s, rb6, rb5) + backQuad(r6, r7, rb7, rb6) + backQuad(r7, r0s, rb0, rb7) + backQuad(rb0, rb1, ri1, ri0) + backQuad(rb1, rb2, ri2, ri1) + backQuad(rb2, rb3, ri3, ri2) + backQuad(rb3, rb4, ri4, ri3) + backQuad(rb4, rb5, ri5, ri4) + backQuad(rb5, rb6, ri6, ri5) + backQuad(rb6, rb7, ri7, ri6) + backQuad(rb7, rb0, ri0, ri7) + backQuad(ri0, ri1, Rb1, Rb0) + backQuad(ri1, ri2, Rb2, Rb1) + backQuad(ri2, ri3, Rb3, Rb2) + backQuad(ri3, ri4, Rb4, Rb3) + backQuad(ri4, ri5, Rb5, Rb4) + backQuad(ri5, ri6, Rb6, Rb5) + backQuad(ri6, ri7, Rb7, Rb6) + backQuad(ri7, ri0, Rb0, Rb7) + backQuad(Rb0, Rb1, R1, R0) + backQuad(Rb1, Rb2, R2, R1) + backQuad(Rb2, Rb3, R3, R2) + backQuad(Rb3, Rb4, R4, R3) + backQuad(Rb4, Rb5, R5, R4) + backQuad(Rb5, Rb6, R6, R5) + backQuad(Rb6, Rb7, R7, R6) + backQuad(Rb7, Rb0, R0, R7) + ) +); + +// ************************************************************************* // diff --git a/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/polyMesh/boundary b/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/polyMesh/boundary new file mode 100644 index 0000000000..920d35d280 --- /dev/null +++ b/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/polyMesh/boundary @@ -0,0 +1,46 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 2.0.x | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class polyBoundaryMesh; + location "constant/polyMesh"; + object boundary; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +4 +( + rotor + { + type wall; + nFaces 144; + startFace 5640; + } + freestream + { + type patch; + nFaces 96; + startFace 5784; + } + front + { + type empty; + nFaces 2880; + startFace 5880; + } + back + { + type empty; + nFaces 2880; + startFace 8760; + } +) + +// ************************************************************************* // diff --git a/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/transportProperties b/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/transportProperties new file mode 100644 index 0000000000..b996e2bb6d --- /dev/null +++ b/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/transportProperties @@ -0,0 +1,39 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 2.0.0 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object transportProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +transportModel Newtonian; + +nu nu [ 0 2 -1 0 0 0 0 ] 1e-05; + +CrossPowerLawCoeffs +{ + nu0 nu0 [ 0 2 -1 0 0 0 0 ] 1e-06; + nuInf nuInf [ 0 2 -1 0 0 0 0 ] 1e-06; + m m [ 0 0 1 0 0 0 0 ] 1; + n n [ 0 0 0 0 0 0 0 ] 1; +} + +BirdCarreauCoeffs +{ + nu0 nu0 [ 0 2 -1 0 0 0 0 ] 1e-06; + nuInf nuInf [ 0 2 -1 0 0 0 0 ] 1e-06; + k k [ 0 0 1 0 0 0 0 ] 0; + n n [ 0 0 0 0 0 0 0 ] 1; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/turbulenceProperties b/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/turbulenceProperties new file mode 100644 index 0000000000..995cbc3d91 --- /dev/null +++ b/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/turbulenceProperties @@ -0,0 +1,20 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 2.0.0 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RASModel; + +// ************************************************************************* // diff --git a/tutorials/incompressible/SRFPimpleFoam/rotor2D/makeMesh b/tutorials/incompressible/SRFPimpleFoam/rotor2D/makeMesh new file mode 100755 index 0000000000..4d5d65a5e7 --- /dev/null +++ b/tutorials/incompressible/SRFPimpleFoam/rotor2D/makeMesh @@ -0,0 +1,9 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + +set -x + +m4 < constant/polyMesh/blockMeshDict.m4 > constant/polyMesh/blockMeshDict +blockMesh > log.blockMesh 2>&1 + +# ----------------------------------------------------------------- end-of-file diff --git a/tutorials/incompressible/SRFPimpleFoam/rotor2D/system/controlDict b/tutorials/incompressible/SRFPimpleFoam/rotor2D/system/controlDict new file mode 100644 index 0000000000..f59b7aaa5a --- /dev/null +++ b/tutorials/incompressible/SRFPimpleFoam/rotor2D/system/controlDict @@ -0,0 +1,52 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 2.0.0 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application SRFPimpleFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 2; + +deltaT 2e-4; + +writeControl runTime; + +writeInterval 2e-2; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression uncompressed; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +adjustTimeStep no; + +maxCo 0.5; + +// ************************************************************************* // diff --git a/tutorials/incompressible/SRFPimpleFoam/rotor2D/system/fvSchemes b/tutorials/incompressible/SRFPimpleFoam/rotor2D/system/fvSchemes new file mode 100644 index 0000000000..2075e1c8df --- /dev/null +++ b/tutorials/incompressible/SRFPimpleFoam/rotor2D/system/fvSchemes @@ -0,0 +1,63 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 2.0.0 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + default none; + div(phi,Urel) Gauss limitedLinearV 1; + div(phi,k) Gauss limitedLinear 1; + div(phi,epsilon) Gauss limitedLinear 1; + div((nuEff*dev(T(grad(Urel))))) Gauss linear; +} + +laplacianSchemes +{ + default none; + laplacian(nuEff,Urel) Gauss linear corrected; + laplacian((1|A(Urel)),p) Gauss linear corrected; + laplacian(DkEff,k) Gauss linear corrected; + laplacian(DepsilonEff,epsilon) Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + +fluxRequired +{ + default no; + p ; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/SRFPimpleFoam/rotor2D/system/fvSolution b/tutorials/incompressible/SRFPimpleFoam/rotor2D/system/fvSolution new file mode 100644 index 0000000000..50897778eb --- /dev/null +++ b/tutorials/incompressible/SRFPimpleFoam/rotor2D/system/fvSolution @@ -0,0 +1,83 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 2.0.0 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + p + { + solver GAMG; + tolerance 1e-08; + relTol 0.05; + smoother GaussSeidel; + cacheAgglomeration true; + nCellsInCoarsestLevel 20; + agglomerator faceAreaPair; + mergeLevels 1; + } + + pFinal + { + $p; + relTol 0; + } + + "Urel.*" + { + solver smoothSolver; + smoother GaussSeidel; + nSweeps 2; + tolerance 1e-07; + relTol 0.1; + } + + "k.*" + { + solver smoothSolver; + smoother GaussSeidel; + nSweeps 2; + tolerance 1e-07; + relTol 0.1; + } + + "epsilon.*" + { + solver smoothSolver; + smoother GaussSeidel; + nSweeps 2; + tolerance 1e-07; + relTol 0.1; + } +} + +PIMPLE +{ + nOuterCorrectors 1; + nCorrectors 2; + nNonOrthogonalCorrectors 0; + pRefCell 0; + pRefValue 0; +} + +relaxationFactors +{ + "Urel.*" 1; + "k.*" 1; + "epsilon.*" 1; +} + + +// ************************************************************************* // From 0143dd5b341220d8fe63fd4083e6c67f1847cf64 Mon Sep 17 00:00:00 2001 From: Henry Date: Fri, 24 Jun 2011 13:40:39 +0100 Subject: [PATCH 06/19] flex: Updated command-line options to work with flex version 2.5.4 --- wmake/rules/General/flex | 2 +- wmake/rules/General/flex++ | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wmake/rules/General/flex b/wmake/rules/General/flex index 7f726b34c4..853780e1bd 100644 --- a/wmake/rules/General/flex +++ b/wmake/rules/General/flex @@ -1,6 +1,6 @@ .SUFFIXES: .l -ltoo = flex -o $*.c $$SOURCE ; $(cc) $(cFLAGS) -c $*.c -o $@ +ltoo = flex -o$*.c $$SOURCE ; $(cc) $(cFLAGS) -c $*.c -o $@ .l.dep: $(MAKE_DEP) diff --git a/wmake/rules/General/flex++ b/wmake/rules/General/flex++ index 7e7142aa53..cf829e09bc 100644 --- a/wmake/rules/General/flex++ +++ b/wmake/rules/General/flex++ @@ -1,6 +1,6 @@ .SUFFIXES: .L -Ltoo = flex -+ -o $*.C -f $$SOURCE ; $(CC) $(c++FLAGS) -c $*.C -o $@ +Ltoo = flex -+ -o$*.C -f $$SOURCE ; $(CC) $(c++FLAGS) -c $*.C -o $@ .L.dep: $(MAKE_DEP) From ff2bafa33005ee45ecdf07a57da3b728366a181b Mon Sep 17 00:00:00 2001 From: Henry Date: Fri, 24 Jun 2011 13:41:21 +0100 Subject: [PATCH 07/19] interfaceProperties: correct alpha1 gradient following curvature calculation. --- src/transportModels/interfaceProperties/interfaceProperties.C | 1 + 1 file changed, 1 insertion(+) diff --git a/src/transportModels/interfaceProperties/interfaceProperties.C b/src/transportModels/interfaceProperties/interfaceProperties.C index e189680519..1f69ba2c1b 100644 --- a/src/transportModels/interfaceProperties/interfaceProperties.C +++ b/src/transportModels/interfaceProperties/interfaceProperties.C @@ -100,6 +100,7 @@ void Foam::interfaceProperties::correctContactAngle nHatp /= (mag(nHatp) + deltaN_.value()); acap.gradient() = (nf & nHatp)*mag(gradAlphaf[patchi]); + acap.evaluate(); } } } From f225ff9de5a0b0e202ea0893f4742eab23ad288d Mon Sep 17 00:00:00 2001 From: Henry Date: Fri, 24 Jun 2011 13:54:38 +0100 Subject: [PATCH 08/19] SRFPimpleFoam/rotor2D tutorial: corrected headers --- tutorials/incompressible/SRFPimpleFoam/rotor2D/0/Urel | 2 +- tutorials/incompressible/SRFPimpleFoam/rotor2D/0/epsilon | 2 +- tutorials/incompressible/SRFPimpleFoam/rotor2D/0/k | 2 +- tutorials/incompressible/SRFPimpleFoam/rotor2D/0/nut | 2 +- tutorials/incompressible/SRFPimpleFoam/rotor2D/0/p | 2 +- .../incompressible/SRFPimpleFoam/rotor2D/constant/RASProperties | 2 +- .../incompressible/SRFPimpleFoam/rotor2D/constant/SRFProperties | 2 +- .../SRFPimpleFoam/rotor2D/constant/polyMesh/blockMeshDict.m4 | 2 +- .../SRFPimpleFoam/rotor2D/constant/transportProperties | 2 +- .../SRFPimpleFoam/rotor2D/constant/turbulenceProperties | 2 +- .../incompressible/SRFPimpleFoam/rotor2D/system/controlDict | 2 +- tutorials/incompressible/SRFPimpleFoam/rotor2D/system/fvSchemes | 2 +- .../incompressible/SRFPimpleFoam/rotor2D/system/fvSolution | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tutorials/incompressible/SRFPimpleFoam/rotor2D/0/Urel b/tutorials/incompressible/SRFPimpleFoam/rotor2D/0/Urel index 253e92bd33..a3a03bb56a 100644 --- a/tutorials/incompressible/SRFPimpleFoam/rotor2D/0/Urel +++ b/tutorials/incompressible/SRFPimpleFoam/rotor2D/0/Urel @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 2.0.0 | +| \\ / O peration | Version: dev | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ diff --git a/tutorials/incompressible/SRFPimpleFoam/rotor2D/0/epsilon b/tutorials/incompressible/SRFPimpleFoam/rotor2D/0/epsilon index 67d33de516..335a859289 100644 --- a/tutorials/incompressible/SRFPimpleFoam/rotor2D/0/epsilon +++ b/tutorials/incompressible/SRFPimpleFoam/rotor2D/0/epsilon @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 2.0.0 | +| \\ / O peration | Version: dev | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ diff --git a/tutorials/incompressible/SRFPimpleFoam/rotor2D/0/k b/tutorials/incompressible/SRFPimpleFoam/rotor2D/0/k index fbf0a78e94..79d1c18601 100644 --- a/tutorials/incompressible/SRFPimpleFoam/rotor2D/0/k +++ b/tutorials/incompressible/SRFPimpleFoam/rotor2D/0/k @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 2.0.0 | +| \\ / O peration | Version: dev | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ diff --git a/tutorials/incompressible/SRFPimpleFoam/rotor2D/0/nut b/tutorials/incompressible/SRFPimpleFoam/rotor2D/0/nut index 2d320999d6..f5f281d2e5 100644 --- a/tutorials/incompressible/SRFPimpleFoam/rotor2D/0/nut +++ b/tutorials/incompressible/SRFPimpleFoam/rotor2D/0/nut @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 2.0.0 | +| \\ / O peration | Version: dev | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ diff --git a/tutorials/incompressible/SRFPimpleFoam/rotor2D/0/p b/tutorials/incompressible/SRFPimpleFoam/rotor2D/0/p index e74c653bf3..1fb2e924bd 100644 --- a/tutorials/incompressible/SRFPimpleFoam/rotor2D/0/p +++ b/tutorials/incompressible/SRFPimpleFoam/rotor2D/0/p @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 2.0.0 | +| \\ / O peration | Version: dev | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ diff --git a/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/RASProperties b/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/RASProperties index d0fb72da9a..67d4d8212c 100644 --- a/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/RASProperties +++ b/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/RASProperties @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 2.0.0 | +| \\ / O peration | Version: dev | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ diff --git a/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/SRFProperties b/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/SRFProperties index 1c1eefad8e..3df885c0f9 100644 --- a/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/SRFProperties +++ b/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/SRFProperties @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 2.0.0 | +| \\ / O peration | Version: dev | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ diff --git a/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/polyMesh/blockMeshDict.m4 b/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/polyMesh/blockMeshDict.m4 index 8fc550c912..a650675100 100644 --- a/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/polyMesh/blockMeshDict.m4 +++ b/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/polyMesh/blockMeshDict.m4 @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 2.0.0 | +| \\ / O peration | Version: dev | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ diff --git a/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/transportProperties b/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/transportProperties index b996e2bb6d..62cd127719 100644 --- a/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/transportProperties +++ b/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/transportProperties @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 2.0.0 | +| \\ / O peration | Version: dev | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ diff --git a/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/turbulenceProperties b/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/turbulenceProperties index 995cbc3d91..b778d38360 100644 --- a/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/turbulenceProperties +++ b/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/turbulenceProperties @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 2.0.0 | +| \\ / O peration | Version: dev | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ diff --git a/tutorials/incompressible/SRFPimpleFoam/rotor2D/system/controlDict b/tutorials/incompressible/SRFPimpleFoam/rotor2D/system/controlDict index f59b7aaa5a..5a07f3a3e9 100644 --- a/tutorials/incompressible/SRFPimpleFoam/rotor2D/system/controlDict +++ b/tutorials/incompressible/SRFPimpleFoam/rotor2D/system/controlDict @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 2.0.0 | +| \\ / O peration | Version: dev | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ diff --git a/tutorials/incompressible/SRFPimpleFoam/rotor2D/system/fvSchemes b/tutorials/incompressible/SRFPimpleFoam/rotor2D/system/fvSchemes index 2075e1c8df..052992f7da 100644 --- a/tutorials/incompressible/SRFPimpleFoam/rotor2D/system/fvSchemes +++ b/tutorials/incompressible/SRFPimpleFoam/rotor2D/system/fvSchemes @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 2.0.0 | +| \\ / O peration | Version: dev | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ diff --git a/tutorials/incompressible/SRFPimpleFoam/rotor2D/system/fvSolution b/tutorials/incompressible/SRFPimpleFoam/rotor2D/system/fvSolution index 50897778eb..d667b1f874 100644 --- a/tutorials/incompressible/SRFPimpleFoam/rotor2D/system/fvSolution +++ b/tutorials/incompressible/SRFPimpleFoam/rotor2D/system/fvSolution @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 2.0.0 | +| \\ / O peration | Version: dev | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ From 0ce485edaa7b3f709c7ebf98d6bec2df9e02b2cd Mon Sep 17 00:00:00 2001 From: Henry Date: Fri, 24 Jun 2011 13:55:30 +0100 Subject: [PATCH 09/19] SRFPimpleFoam/rotor2D tutorial: corrected headers --- .../SRFPimpleFoam/rotor2D/constant/polyMesh/boundary | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/polyMesh/boundary b/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/polyMesh/boundary index 920d35d280..66480f1b63 100644 --- a/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/polyMesh/boundary +++ b/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/polyMesh/boundary @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 2.0.x | +| \\ / O peration | Version: dev | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ From f68356679c465d1f85cb08c6e2f57e8cf645e8ab Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 24 Jun 2011 17:55:59 +0100 Subject: [PATCH 10/19] ENH: writeCellCentres: added region option --- .../miscellaneous/writeCellCentres/writeCellCentres.C | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/applications/utilities/postProcessing/miscellaneous/writeCellCentres/writeCellCentres.C b/applications/utilities/postProcessing/miscellaneous/writeCellCentres/writeCellCentres.C index 57fcf209b5..1f3a870d10 100644 --- a/applications/utilities/postProcessing/miscellaneous/writeCellCentres/writeCellCentres.C +++ b/applications/utilities/postProcessing/miscellaneous/writeCellCentres/writeCellCentres.C @@ -43,13 +43,14 @@ using namespace Foam; int main(int argc, char *argv[]) { timeSelector::addOptions(); +# include "addRegionOption.H" # include "setRootCase.H" # include "createTime.H" instantList timeDirs = timeSelector::select0(runTime, args); -# include "createMesh.H" +# include "createNamedMesh.H" forAll(timeDirs, timeI) { From d008d22ceae8ae0bc6e8acc4a0c2bfcec199fbb7 Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 24 Jun 2011 17:58:03 +0100 Subject: [PATCH 11/19] STYLE: writeCellCentres: date --- .../miscellaneous/writeCellCentres/writeCellCentres.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/utilities/postProcessing/miscellaneous/writeCellCentres/writeCellCentres.C b/applications/utilities/postProcessing/miscellaneous/writeCellCentres/writeCellCentres.C index 1f3a870d10..6e399126e5 100644 --- a/applications/utilities/postProcessing/miscellaneous/writeCellCentres/writeCellCentres.C +++ b/applications/utilities/postProcessing/miscellaneous/writeCellCentres/writeCellCentres.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License From d1a83758161b616a827068cdc83589bd2ecc2219 Mon Sep 17 00:00:00 2001 From: Henry Date: Mon, 27 Jun 2011 16:58:58 +0100 Subject: [PATCH 12/19] wmake options files: corrected EXE_LIBS -> LIB_LIBS --- .../rhoCentralFoam/BCs/Make/options | 2 +- .../coupledDerivedFvPatchFields/Make/options | 2 +- .../extrude/extrudeModel/Make/options | 2 +- src/dummyThirdParty/MGridGen/Make/options | 3 --- .../molecularDynamics/molecule/Make/options | 2 +- .../foamCalcFunctions/Make/options | 2 +- src/postProcessing/postCalc/Make/options | 2 +- src/regionModels/pyrolysisModels/Make/options | 5 ++-- src/regionModels/regionCoupling/Make/options | 4 +--- src/regionModels/regionModel/Make/options | 2 +- .../surfaceFilmModels/Make/options | 4 ++-- .../thermoBaffleModels/Make/options | 3 +-- .../Make/options | 2 +- wmake/rules/linuxmingw32/X | 3 --- wmake/rules/linuxmingw32/c | 16 ------------- wmake/rules/linuxmingw32/c++ | 23 ------------------- wmake/rules/linuxmingw32/c++Debug | 2 -- wmake/rules/linuxmingw32/c++Opt | 2 -- wmake/rules/linuxmingw32/c++Prof | 2 -- wmake/rules/linuxmingw32/cDebug | 2 -- wmake/rules/linuxmingw32/cOpt | 2 -- wmake/rules/linuxmingw32/cProf | 2 -- wmake/rules/linuxmingw32/general | 16 ------------- 23 files changed, 14 insertions(+), 91 deletions(-) delete mode 100644 wmake/rules/linuxmingw32/X delete mode 100644 wmake/rules/linuxmingw32/c delete mode 100644 wmake/rules/linuxmingw32/c++ delete mode 100644 wmake/rules/linuxmingw32/c++Debug delete mode 100644 wmake/rules/linuxmingw32/c++Opt delete mode 100644 wmake/rules/linuxmingw32/c++Prof delete mode 100644 wmake/rules/linuxmingw32/cDebug delete mode 100644 wmake/rules/linuxmingw32/cOpt delete mode 100644 wmake/rules/linuxmingw32/cProf delete mode 100644 wmake/rules/linuxmingw32/general diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/Make/options b/applications/solvers/compressible/rhoCentralFoam/BCs/Make/options index 87f38a6a03..999e0466cd 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/Make/options +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/Make/options @@ -3,7 +3,7 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude -EXE_LIBS = \ +LIB_LIBS = \ -lfiniteVolume \ -lbasicThermophysicalModels \ -lspecie diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/Make/options b/applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/Make/options index a178c0d55d..1cbced1cd3 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/Make/options +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/Make/options @@ -5,7 +5,7 @@ EXE_INC = \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude -EXE_LIBS = \ +LIB_LIBS = \ -lmeshTools \ -lbasicThermophysicalModels \ -lfiniteVolume \ diff --git a/applications/utilities/mesh/generation/extrude/extrudeModel/Make/options b/applications/utilities/mesh/generation/extrude/extrudeModel/Make/options index 70c838b774..1618ab57ec 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeModel/Make/options +++ b/applications/utilities/mesh/generation/extrude/extrudeModel/Make/options @@ -2,6 +2,6 @@ EXE_INC = \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude -EXE_LIBS = \ +LIB_LIBS = \ -lmeshTools \ -ldynamicMesh diff --git a/src/dummyThirdParty/MGridGen/Make/options b/src/dummyThirdParty/MGridGen/Make/options index 4c3dd783cb..e69de29bb2 100644 --- a/src/dummyThirdParty/MGridGen/Make/options +++ b/src/dummyThirdParty/MGridGen/Make/options @@ -1,3 +0,0 @@ -EXE_INC = - -EXE_LIBS = diff --git a/src/lagrangian/molecularDynamics/molecule/Make/options b/src/lagrangian/molecularDynamics/molecule/Make/options index 1bdb57a0d0..5698f81a65 100644 --- a/src/lagrangian/molecularDynamics/molecule/Make/options +++ b/src/lagrangian/molecularDynamics/molecule/Make/options @@ -5,7 +5,7 @@ EXE_INC = \ -I$(LIB_SRC)/lagrangian/molecularDynamics/potential/lnInclude \ -I$(LIB_SRC)/lagrangian/molecularDynamics/molecularMeasurements/lnInclude -EXE_LIBS = \ +LIB_LIBS = \ -lfiniteVolume \ -lmeshTools \ -llagrangian \ diff --git a/src/postProcessing/foamCalcFunctions/Make/options b/src/postProcessing/foamCalcFunctions/Make/options index fa15f12452..71b7873964 100644 --- a/src/postProcessing/foamCalcFunctions/Make/options +++ b/src/postProcessing/foamCalcFunctions/Make/options @@ -1,5 +1,5 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude -EXE_LIBS = \ +LIB_LIBS = \ -lfiniteVolume diff --git a/src/postProcessing/postCalc/Make/options b/src/postProcessing/postCalc/Make/options index fa15f12452..71b7873964 100644 --- a/src/postProcessing/postCalc/Make/options +++ b/src/postProcessing/postCalc/Make/options @@ -1,5 +1,5 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude -EXE_LIBS = \ +LIB_LIBS = \ -lfiniteVolume diff --git a/src/regionModels/pyrolysisModels/Make/options b/src/regionModels/pyrolysisModels/Make/options index 4b69dbaac2..30a5fa428b 100644 --- a/src/regionModels/pyrolysisModels/Make/options +++ b/src/regionModels/pyrolysisModels/Make/options @@ -1,4 +1,3 @@ - EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ @@ -16,10 +15,10 @@ EXE_INC = \ -I$(LIB_SRC)/regionModels/regionModel/lnInclude -EXE_LIBS = \ +LIB_LIBS = \ -lregionModels \ -lsolidChemistryModel \ - -lsolidThermo \ + -lbasicSolidThermo \ -lfiniteVolume \ -lmeshTools \ -lcompressibleLESModels diff --git a/src/regionModels/regionCoupling/Make/options b/src/regionModels/regionCoupling/Make/options index 2eaffb3b4b..5201314345 100644 --- a/src/regionModels/regionCoupling/Make/options +++ b/src/regionModels/regionCoupling/Make/options @@ -1,4 +1,3 @@ - EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ @@ -18,8 +17,7 @@ EXE_INC = \ -I$(LIB_SRC)/regionModels/pyrolysisModels/lnInclude \ -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \ - -EXE_LIBS = \ +LIB_LIBS = \ -lregionModels \ -lpyrolysisModels \ -lsurfaceFilmModels \ diff --git a/src/regionModels/regionModel/Make/options b/src/regionModels/regionModel/Make/options index d27c95d033..a3ae8da833 100644 --- a/src/regionModels/regionModel/Make/options +++ b/src/regionModels/regionModel/Make/options @@ -2,6 +2,6 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude -EXE_LIBS = \ +LIB_LIBS = \ -lfiniteVolume \ -lmeshTools diff --git a/src/regionModels/surfaceFilmModels/Make/options b/src/regionModels/surfaceFilmModels/Make/options index 34d28d0027..1db0d316db 100644 --- a/src/regionModels/surfaceFilmModels/Make/options +++ b/src/regionModels/surfaceFilmModels/Make/options @@ -15,9 +15,9 @@ EXE_INC = \ -I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \ -I$(LIB_SRC)/regionModels/regionModel/lnInclude -EXE_LIBS = \ +LIB_LIBS = \ -lregionModels \ - -lSLGThermoNew \ + -lSLGThermo \ -lfiniteVolume \ -lmeshTools \ -ldistributionModels \ diff --git a/src/regionModels/thermoBaffleModels/Make/options b/src/regionModels/thermoBaffleModels/Make/options index 7328b5d856..44ab48e425 100644 --- a/src/regionModels/thermoBaffleModels/Make/options +++ b/src/regionModels/thermoBaffleModels/Make/options @@ -8,8 +8,7 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude - -EXE_LIBS = \ +LIB_LIBS = \ -lregionModels \ -lbasicSolidThermo \ -lfiniteVolume \ diff --git a/src/thermophysicalModels/barotropicCompressibilityModel/Make/options b/src/thermophysicalModels/barotropicCompressibilityModel/Make/options index fa15f12452..71b7873964 100644 --- a/src/thermophysicalModels/barotropicCompressibilityModel/Make/options +++ b/src/thermophysicalModels/barotropicCompressibilityModel/Make/options @@ -1,5 +1,5 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude -EXE_LIBS = \ +LIB_LIBS = \ -lfiniteVolume diff --git a/wmake/rules/linuxmingw32/X b/wmake/rules/linuxmingw32/X deleted file mode 100644 index 7848473828..0000000000 --- a/wmake/rules/linuxmingw32/X +++ /dev/null @@ -1,3 +0,0 @@ -XFLAGS = -XINC = -XLIBS = diff --git a/wmake/rules/linuxmingw32/c b/wmake/rules/linuxmingw32/c deleted file mode 100644 index c74ee742ac..0000000000 --- a/wmake/rules/linuxmingw32/c +++ /dev/null @@ -1,16 +0,0 @@ -.SUFFIXES: .c .h - -cWARN = -Wall - -cc = mingw32-gcc -m32 - -include $(RULES)/c$(WM_COMPILE_OPTION) - -cFLAGS = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) - -ctoo = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $$SOURCE -o $@ - -LINK_LIBS = $(cDBUG) - -LINKLIBSO = $(cc) -Wl,--output-def,$(LIB).def,--out-implib,$(LIB).a,--enable-auto-import -shared -LINKEXE = $(cc) -Wl,--enable-auto-import,--force-exe-suffix diff --git a/wmake/rules/linuxmingw32/c++ b/wmake/rules/linuxmingw32/c++ deleted file mode 100644 index 52945c1aa8..0000000000 --- a/wmake/rules/linuxmingw32/c++ +++ /dev/null @@ -1,23 +0,0 @@ -.SUFFIXES: .C .cxx .cc .cpp - -c++WARN = -Wall -Wextra -Wno-unused-parameter - -CC = mingw32-g++ - -include $(RULES)/c++$(WM_COMPILE_OPTION) - -ptFLAGS = -DNoRepository -ftemplate-depth-100 - -c++FLAGS = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) - -Ctoo = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $$SOURCE -o $@ -cxxtoo = $(Ctoo) -cctoo = $(Ctoo) -cpptoo = $(Ctoo) - -LINK_LIBS = $(c++DBUG) - -# Tried using -Wl,-no-undefined,--enable-runtime-pseudo-reloc -# but didnt forgive undefined symbols during linking -LINKLIBSO = $(CC) $(c++FLAGS) -Wl,--output-def,$(LIB).def,--out-implib,$(LIB).a,--enable-auto-import -shared -LINKEXE = $(CC) $(c++FLAGS) -Wl,--enable-auto-import,--force-exe-suffix diff --git a/wmake/rules/linuxmingw32/c++Debug b/wmake/rules/linuxmingw32/c++Debug deleted file mode 100644 index 19bdb9c334..0000000000 --- a/wmake/rules/linuxmingw32/c++Debug +++ /dev/null @@ -1,2 +0,0 @@ -c++DBUG = -ggdb3 -DFULLDEBUG -c++OPT = -O0 -fdefault-inline diff --git a/wmake/rules/linuxmingw32/c++Opt b/wmake/rules/linuxmingw32/c++Opt deleted file mode 100644 index 548bfecef8..0000000000 --- a/wmake/rules/linuxmingw32/c++Opt +++ /dev/null @@ -1,2 +0,0 @@ -c++DBUG = -c++OPT = -O3 -DNDEBUG diff --git a/wmake/rules/linuxmingw32/c++Prof b/wmake/rules/linuxmingw32/c++Prof deleted file mode 100644 index 3bda4dad55..0000000000 --- a/wmake/rules/linuxmingw32/c++Prof +++ /dev/null @@ -1,2 +0,0 @@ -c++DBUG = -pg -c++OPT = -O2 diff --git a/wmake/rules/linuxmingw32/cDebug b/wmake/rules/linuxmingw32/cDebug deleted file mode 100644 index 6c71ed93e8..0000000000 --- a/wmake/rules/linuxmingw32/cDebug +++ /dev/null @@ -1,2 +0,0 @@ -cDBUG = -ggdb -DFULLDEBUG -cOPT = -O1 -finline-functions diff --git a/wmake/rules/linuxmingw32/cOpt b/wmake/rules/linuxmingw32/cOpt deleted file mode 100644 index e4572a0e47..0000000000 --- a/wmake/rules/linuxmingw32/cOpt +++ /dev/null @@ -1,2 +0,0 @@ -cDBUG = -cOPT = -O3 -DNDEBUG diff --git a/wmake/rules/linuxmingw32/cProf b/wmake/rules/linuxmingw32/cProf deleted file mode 100644 index ca3ac9bf5f..0000000000 --- a/wmake/rules/linuxmingw32/cProf +++ /dev/null @@ -1,2 +0,0 @@ -cDBUG = -pg -cOPT = -O2 diff --git a/wmake/rules/linuxmingw32/general b/wmake/rules/linuxmingw32/general deleted file mode 100644 index 26658e0c98..0000000000 --- a/wmake/rules/linuxmingw32/general +++ /dev/null @@ -1,16 +0,0 @@ -LD = mingw32-ld - -PROJECT_LIBS = -l$(WM_PROJECT) - -include $(GENERAL_RULES)/standard - -include $(RULES)/X -include $(RULES)/c -include $(RULES)/c++ - -SO = dll -EXE_EXT = .exe - -# Ensure we know what OS we are compiling for -# during MakefileFiles and MakefileOptions -GFLAGS += -DWIN32 -DLITTLE_ENDIAN From a43a4e1654554c6ef1db2f88eb94b5bd38cb33e8 Mon Sep 17 00:00:00 2001 From: Henry Date: Tue, 28 Jun 2011 11:43:51 +0100 Subject: [PATCH 13/19] Corrected comparison operators to be POSIX-compliant Reduced the required gcc version to 4.3.2 --- bin/foamInstallationTest | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/foamInstallationTest b/bin/foamInstallationTest index 67a7edf6ed..1fdd491e96 100755 --- a/bin/foamInstallationTest +++ b/bin/foamInstallationTest @@ -32,7 +32,7 @@ #------------------------------------------------------------------------------ # Base settings -MIN_VERSION_GCC=4.3.3 +MIN_VERSION_GCC=4.3.2 # General WIDTH=20 @@ -270,7 +270,7 @@ reportExecutable() pass="yes" fi - if [ "$pass" == "" ] && [ "$gccOk" == "" ]; then + if [ "$pass" = "" ] && [ "$gccOk" = "" ]; then if [ $V2 -lt $MINV2 ]; then gccOk="ERROR" elif [ $V2 -gt $MINV2 ]; then @@ -278,7 +278,7 @@ reportExecutable() fi fi - if [ "$pass" == "" ] && [ "$gccOk" == "" ] && [ $V3 != "" ] && [ $MINV3 != "" ]; then + if [ "$pass" = "" ] && [ "$gccOk" = "" ] && [ $V3 != "" ] && [ $MINV3 != "" ]; then if [ $V3 -lt $MINV3 ]; then gccOk="ERROR" fi @@ -291,7 +291,7 @@ reportExecutable() echo "" fatalError=`expr $fatalError + 1` fi - + ;; gtar) From 1ee83d90669fd29d37820d87633d7ffdd68b6e97 Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 29 Jun 2011 09:52:37 +0100 Subject: [PATCH 14/19] STYLE:triSurfaceMesh.C: extraneous expression --- src/meshTools/searchableSurface/triSurfaceMesh.C | 1 - 1 file changed, 1 deletion(-) diff --git a/src/meshTools/searchableSurface/triSurfaceMesh.C b/src/meshTools/searchableSurface/triSurfaceMesh.C index c532ac3d39..aa117c2794 100644 --- a/src/meshTools/searchableSurface/triSurfaceMesh.C +++ b/src/meshTools/searchableSurface/triSurfaceMesh.C @@ -738,7 +738,6 @@ void Foam::triSurfaceMesh::findLineAll // we need something bigger since we're doing calculations) // - if the start-end vector is zero we still progress const vectorField dirVec(end-start); - const scalarField magSqrDirVec(magSqr(dirVec)); const vectorField smallVec ( indexedOctree::perturbTol()*dirVec From 0b18291a9818dc7b12cb7c39e6aa49abd58a0840 Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 29 Jun 2011 09:53:43 +0100 Subject: [PATCH 15/19] BUG: triSurfaceSearch: did not clear hits --- src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.C | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.C b/src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.C index b24c482b25..0f695cb1d8 100644 --- a/src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.C +++ b/src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.C @@ -201,9 +201,8 @@ const if (inter.hit()) { - label sz = hits.size(); - hits.setSize(sz+1); - hits[sz] = inter; + hits.setSize(1); + hits[0] = inter; const vector dirVec(end-start); const scalar magSqrDirVec(magSqr(dirVec)); From ec67450164757302869e7a6f6dcd58d9c16f678d Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 29 Jun 2011 09:54:18 +0100 Subject: [PATCH 16/19] ENH: orientedSurface: added orienting based on intersection test --- .../orientedSurface/orientedSurface.C | 95 +++++++++++-------- .../orientedSurface/orientedSurface.H | 3 + 2 files changed, 59 insertions(+), 39 deletions(-) diff --git a/src/meshTools/triSurface/orientedSurface/orientedSurface.C b/src/meshTools/triSurface/orientedSurface/orientedSurface.C index 2b32604972..d72eba5f92 100644 --- a/src/meshTools/triSurface/orientedSurface/orientedSurface.C +++ b/src/meshTools/triSurface/orientedSurface/orientedSurface.C @@ -255,7 +255,6 @@ void Foam::orientedSurface::findZoneSide zoneFaceI = -1; isOutside = false; - List hits; forAll(faceZone, faceI) @@ -305,7 +304,6 @@ void Foam::orientedSurface::findZoneSide { isOutside = ((n & d) > 0); } - break; } } @@ -354,6 +352,50 @@ bool Foam::orientedSurface::flipSurface } +bool Foam::orientedSurface::orientConsistent(triSurface& s) +{ + bool anyFlipped = false; + + // Do initial flipping to make triangles consistent. Otherwise if the + // nearest is e.g. on an edge inbetween inconsistent triangles it might + // make the wrong decision. + if (s.size() > 0) + { + // Whether face has to be flipped. + // UNVISITED: unvisited + // NOFLIP: no need to flip + // FLIP: need to flip + labelList flipState(s.size(), UNVISITED); + + label faceI = 0; + while (true) + { + label startFaceI = -1; + while (faceI < s.size()) + { + if (flipState[faceI] == UNVISITED) + { + startFaceI = faceI; + break; + } + faceI++; + } + + if (startFaceI == -1) + { + break; + } + + flipState[startFaceI] = NOFLIP; + walkSurface(s, startFaceI, flipState); + } + + anyFlipped = flipSurface(s, flipState); + } + return anyFlipped; +} + + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // Null constructor @@ -404,44 +446,10 @@ bool Foam::orientedSurface::orient const bool orientOutside ) { - bool anyFlipped = false; - // Do initial flipping to make triangles consistent. Otherwise if the // nearest is e.g. on an edge inbetween inconsistent triangles it might // make the wrong decision. - if (s.size() > 0) - { - // Whether face has to be flipped. - // UNVISITED: unvisited - // NOFLIP: no need to flip - // FLIP: need to flip - labelList flipState(s.size(), UNVISITED); - - label faceI = 0; - while (true) - { - label startFaceI = -1; - while (faceI < s.size()) - { - if (flipState[faceI] == UNVISITED) - { - startFaceI = faceI; - break; - } - faceI++; - } - - if (startFaceI == -1) - { - break; - } - - flipState[startFaceI] = NOFLIP; - walkSurface(s, startFaceI, flipState); - } - - anyFlipped = flipSurface(s, flipState); - } + bool topoFlipped = orientConsistent(s); // Whether face has to be flipped. @@ -497,7 +505,7 @@ bool Foam::orientedSurface::orient // Now finally flip triangles according to flipState. bool geomFlipped = flipSurface(s, flipState); - return anyFlipped || geomFlipped; + return topoFlipped || geomFlipped; } @@ -509,6 +517,11 @@ bool Foam::orientedSurface::orient const bool orientOutside ) { + // Do initial flipping to make triangles consistent. Otherwise if the + // nearest is e.g. on an edge inbetween inconsistent triangles it might + // make the wrong decision. + bool topoFlipped = orientConsistent(s); + // Determine disconnected parts of surface boolList borderEdge(s.nEdges(), false); forAll(s.edgeFaces(), edgeI) @@ -549,7 +562,11 @@ bool Foam::orientedSurface::orient } walkSurface(s, zoneFaceI, flipState); } - return flipSurface(s, flipState); + + // Now finally flip triangles according to flipState. + bool geomFlipped = flipSurface(s, flipState); + + return topoFlipped || geomFlipped; } diff --git a/src/meshTools/triSurface/orientedSurface/orientedSurface.H b/src/meshTools/triSurface/orientedSurface/orientedSurface.H index 209673a187..ea69ca1ebb 100644 --- a/src/meshTools/triSurface/orientedSurface/orientedSurface.H +++ b/src/meshTools/triSurface/orientedSurface/orientedSurface.H @@ -128,6 +128,9 @@ class orientedSurface // anything flipped. static bool flipSurface(triSurface& s, const labelList& flipState); + //- Make surface surface has consistent orientation across connected + // triangles. + static bool orientConsistent(triSurface& s); public: ClassName("orientedSurface"); From 9fa370f54a9de845fab0f980bbf4f7bb45d82934 Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 29 Jun 2011 09:56:01 +0100 Subject: [PATCH 17/19] ENH: calcEntry: new functionEntry method --- src/OpenFOAM/Make/files | 1 + .../functionEntries/calcEntry/calcEntry.C | 99 ++++++++++++++++ .../functionEntries/calcEntry/calcEntry.H | 111 ++++++++++++++++++ .../functionEntries/codeStream/codeStream.C | 50 +++++--- .../functionEntries/codeStream/codeStream.H | 16 +++ 5 files changed, 259 insertions(+), 18 deletions(-) create mode 100644 src/OpenFOAM/db/dictionary/functionEntries/calcEntry/calcEntry.C create mode 100644 src/OpenFOAM/db/dictionary/functionEntries/calcEntry/calcEntry.H diff --git a/src/OpenFOAM/Make/files b/src/OpenFOAM/Make/files index 52de21702b..1f1e25341e 100644 --- a/src/OpenFOAM/Make/files +++ b/src/OpenFOAM/Make/files @@ -160,6 +160,7 @@ $(dictionaryEntry)/dictionaryEntry.C $(dictionaryEntry)/dictionaryEntryIO.C functionEntries = $(dictionary)/functionEntries +$(functionEntries)/calcEntry/calcEntry.C $(functionEntries)/codeStream/codeStream.C $(functionEntries)/functionEntry/functionEntry.C $(functionEntries)/includeEntry/includeEntry.C diff --git a/src/OpenFOAM/db/dictionary/functionEntries/calcEntry/calcEntry.C b/src/OpenFOAM/db/dictionary/functionEntries/calcEntry/calcEntry.C new file mode 100644 index 0000000000..fceccc4d35 --- /dev/null +++ b/src/OpenFOAM/db/dictionary/functionEntries/calcEntry/calcEntry.C @@ -0,0 +1,99 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2011 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 . + +\*---------------------------------------------------------------------------*/ + +#include "calcEntry.H" +#include "addToMemberFunctionSelectionTable.H" +#include "dictionary.H" +#include "dynamicCode.H" +#include "codeStream.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace functionEntries +{ + defineTypeNameAndDebug(calcEntry, 0); + + addToMemberFunctionSelectionTable + ( + functionEntry, + calcEntry, + execute, + primitiveEntryIstream + ); + +} +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +bool Foam::functionEntries::calcEntry::execute +( + const dictionary& parentDict, + primitiveEntry& thisEntry, + Istream& is +) +{ + Info<< "Using #calcEntry at line " << is.lineNumber() + << " in file " << parentDict.name() << endl; + + dynamicCode::checkSecurity + ( + "functionEntries::calcEntry::execute(..)", + parentDict + ); + + // Read string + string s(is); + // Make sure we stop this entry + //is.putBack(token(token::END_STATEMENT, is.lineNumber())); + + // Construct codeDict for codeStream + // must reference parent for stringOps::expand to work nicely. + dictionary codeSubDict; + codeSubDict.add("code", "os << (" + s + ");"); + dictionary codeDict(parentDict, codeSubDict); + + codeStream::streamingFunctionType function = codeStream::getFunction + ( + parentDict, + codeDict + ); + + // use function to write stream + OStringStream os(is.format()); + (*function)(os, parentDict); + + // get the entry from this stream + IStringStream resultStream(os.str()); + thisEntry.read(parentDict, resultStream); + + return true; +} + + +// ************************************************************************* // diff --git a/src/OpenFOAM/db/dictionary/functionEntries/calcEntry/calcEntry.H b/src/OpenFOAM/db/dictionary/functionEntries/calcEntry/calcEntry.H new file mode 100644 index 0000000000..235210e798 --- /dev/null +++ b/src/OpenFOAM/db/dictionary/functionEntries/calcEntry/calcEntry.H @@ -0,0 +1,111 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2011 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 . + +Class + Foam::functionEntries::calcEntry + +Description + Uses dynamic compilation to provide calculating functionality + for entering dictionary entries. + + E.g. + + \verbatim + a 1.0; + b 3; + c #calc "$a/$b"; + \endverbatim + + Note the explicit trailing 0 ('1.0') to force a to be read (and written) + as a floating point number. + +Note + Internally this is just a wrapper around codeStream functionality - the + #calc string gets used to construct a dictionary for codeStream. + +SourceFiles + calcEntry.C + +\*---------------------------------------------------------------------------*/ + +#ifndef calcEntry_H +#define calcEntry_H + +#include "functionEntry.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +class dlLibraryTable; + +namespace functionEntries +{ + +/*---------------------------------------------------------------------------*\ + Class calcEntry Declaration +\*---------------------------------------------------------------------------*/ + +class calcEntry +: + public functionEntry +{ + + // Private Member Functions + + //- Disallow default bitwise copy construct + calcEntry(const calcEntry&); + + //- Disallow default bitwise assignment + void operator=(const calcEntry&); + + +public: + + //- Runtime type information + ClassName("calc"); + + + // Member Functions + + //- Execute the functionEntry in a sub-dict context + static bool execute + ( + const dictionary& parentDict, + primitiveEntry&, + Istream& + ); + +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace functionEntries +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.C b/src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.C index 8eefcb86d9..bab7ac3901 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.C +++ b/src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.C @@ -92,28 +92,13 @@ Foam::dlLibraryTable& Foam::functionEntries::codeStream::libs } -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -bool Foam::functionEntries::codeStream::execute +Foam::functionEntries::codeStream::streamingFunctionType +Foam::functionEntries::codeStream::getFunction ( const dictionary& parentDict, - primitiveEntry& entry, - Istream& is + const dictionary& codeDict ) { - Info<< "Using #codeStream at line " << is.lineNumber() - << " in file " << parentDict.name() << endl; - - dynamicCode::checkSecurity - ( - "functionEntries::codeStream::execute(..)", - parentDict - ); - - // get code dictionary - // must reference parent for stringOps::expand to work nicely - dictionary codeDict("#codeStream", parentDict, is); - // get code, codeInclude, codeOptions dynamicCodeContext context(codeDict); @@ -260,6 +245,34 @@ bool Foam::functionEntries::codeStream::execute << " in library " << lib << exit(FatalIOError); } + return function; +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +bool Foam::functionEntries::codeStream::execute +( + const dictionary& parentDict, + primitiveEntry& entry, + Istream& is +) +{ + Info<< "Using #codeStream at line " << is.lineNumber() + << " in file " << parentDict.name() << endl; + + dynamicCode::checkSecurity + ( + "functionEntries::codeStream::execute(..)", + parentDict + ); + + // get code dictionary + // must reference parent for stringOps::expand to work nicely + dictionary codeDict("#codeStream", parentDict, is); + + streamingFunctionType function = getFunction(parentDict, codeDict); + // use function to write stream OStringStream os(is.format()); (*function)(os, parentDict); @@ -268,6 +281,7 @@ bool Foam::functionEntries::codeStream::execute IStringStream resultStream(os.str()); entry.read(parentDict, resultStream); + return true; } diff --git a/src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.H b/src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.H index 4da11839f1..6c93af8690 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.H +++ b/src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.H @@ -103,6 +103,9 @@ class dlLibraryTable; namespace functionEntries { +// Forward declaration of friend classes +class calcEntry; + /*---------------------------------------------------------------------------*\ Class codeStream Declaration \*---------------------------------------------------------------------------*/ @@ -123,6 +126,14 @@ class codeStream //- Helper function: access to dlLibraryTable of Time static dlLibraryTable& libs(const dictionary& dict); + //- Construct, compile, load and return streaming function + static streamingFunctionType getFunction + ( + const dictionary& parentDict, + const dictionary& codeDict + ); + + //- Disallow default bitwise copy construct codeStream(const codeStream&); @@ -137,6 +148,11 @@ public: //- Name of the C code template to be used static const word codeTemplateC; + // Related types + + //- Declare friendship with the calcEntry class + friend class calcEntry; + //- Runtime type information ClassName("codeStream"); From 77077a83e59fcf335ccb345f9f7cc62a7c596449 Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 29 Jun 2011 09:56:51 +0100 Subject: [PATCH 18/19] ENH: stringOps: open OStringStream with fixed precision so floating point numbers get preserved --- src/OpenFOAM/primitives/strings/stringOps/stringOps.C | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/OpenFOAM/primitives/strings/stringOps/stringOps.C b/src/OpenFOAM/primitives/strings/stringOps/stringOps.C index ebbc47ca3b..bd0ae2c334 100644 --- a/src/OpenFOAM/primitives/strings/stringOps/stringOps.C +++ b/src/OpenFOAM/primitives/strings/stringOps/stringOps.C @@ -328,6 +328,10 @@ Foam::string& Foam::stringOps::inplaceExpand if (ePtr) { OStringStream buf; + // Force floating point numbers to be printed with at least + // some decimal digits. + buf << fixed; + buf.precision(IOstream::defaultPrecision()); if (ePtr->isDict()) { ePtr->dict().write(buf, false); From 0e940e379c38c3e2f9db02eaa1a92d859052949c Mon Sep 17 00:00:00 2001 From: sergio Date: Wed, 29 Jun 2011 12:13:16 +0100 Subject: [PATCH 19/19] ENH: Adding references for the SST-SAS model --- .../LES/kOmegaSSTSAS/kOmegaSSTSAS.H | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.H b/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.H index 37d82f4ccb..9fea19fe8e 100644 --- a/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.H +++ b/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.H @@ -25,14 +25,23 @@ Class Foam::incompressible::LESModels::kOmegaSSTSAS Description - kOmegaSSTSAS LES turbulence model for incompressible flows + kOmegaSSTSAS LES turbulence model for incompressible flows + based on: + "Evaluation of the SST-SAS model: channel flow, asymmetric diffuser + and axi-symmetric hill". + European Conference on Computational Fluid Dynamics ECCOMAS CFD 2006. + Lars Davidson + + + The first term of the Qsas expression is corrected following: DESider A European Effort on Hybrid RANS-LES Modelling: Results of the European-Union Funded Project, 2004 - 2007 (Notes on Numerical Fluid Mechanics and Multidisciplinary Design). - Chapter 8 Formulation of the Scale-Adaptive Simulation (SAS) Model during - the DESIDER Project. Published in Springer-Verlag Berlin Heidelberg 2009. + Chapter 2, section 8 Formulation of the Scale-Adaptive Simulation (SAS) + Model during the DESIDER Project. Published in Springer-Verlag Berlin + Heidelberg 2009. F. R. Menter and Y. Egorov. SourceFiles