From 123de44f513db3597b9c2aea14ae119921cd294c Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 10 Dec 2010 16:04:13 +0000 Subject: [PATCH] ENH: windSimpleFoam tutorial update --- .../simpleFoam/windTurbineTerrain/0/U | 6 +- .../simpleFoam/windTurbineTerrain/0/epsilon | 2 +- .../simpleFoam/windTurbineTerrain/0/k | 5 +- .../simpleFoam/windTurbineTerrain/0/p | 5 +- .../simpleFoam/windTurbineTerrain/Allrun | 25 ++- .../simpleFoam/windTurbineTerrain/makeZones | 4 +- .../system/changeDictionaryDict | 201 ++++++++++++++++++ .../system/decomposeParDict | 28 +-- .../windTurbineTerrain/system/fvSolution | 60 +++--- 9 files changed, 270 insertions(+), 66 deletions(-) create mode 100644 tutorials/incompressible/simpleFoam/windTurbineTerrain/system/changeDictionaryDict diff --git a/tutorials/incompressible/simpleFoam/windTurbineTerrain/0/U b/tutorials/incompressible/simpleFoam/windTurbineTerrain/0/U index f23d0ce783..601a696b75 100644 --- a/tutorials/incompressible/simpleFoam/windTurbineTerrain/0/U +++ b/tutorials/incompressible/simpleFoam/windTurbineTerrain/0/U @@ -46,13 +46,15 @@ boundaryField "terrain_.*" { - type fixedValue; + type uniformFixedValue; + uniformValue (0 0 0); value uniform (0 0 0); } ground { - type fixedValue; + type uniformFixedValue; + uniformValue (0 0 0); value uniform (0 0 0); } diff --git a/tutorials/incompressible/simpleFoam/windTurbineTerrain/0/epsilon b/tutorials/incompressible/simpleFoam/windTurbineTerrain/0/epsilon index a49793464e..2cbcbd2268 100644 --- a/tutorials/incompressible/simpleFoam/windTurbineTerrain/0/epsilon +++ b/tutorials/incompressible/simpleFoam/windTurbineTerrain/0/epsilon @@ -23,7 +23,7 @@ internalField uniform $turbulentEpsilon; boundaryField { - #include "include/ABLConditions" + #include "include/ABLConditions" "terrain_.*" { diff --git a/tutorials/incompressible/simpleFoam/windTurbineTerrain/0/k b/tutorials/incompressible/simpleFoam/windTurbineTerrain/0/k index b42f64236c..79b7c087e8 100644 --- a/tutorials/incompressible/simpleFoam/windTurbineTerrain/0/k +++ b/tutorials/incompressible/simpleFoam/windTurbineTerrain/0/k @@ -32,8 +32,9 @@ boundaryField } inlet { - type fixedValue; - value uniform $turbulentKE; + type uniformFixedValue; + uniformValue $turbulentKE; + value $turbulentKE; } "terrain_.*" { diff --git a/tutorials/incompressible/simpleFoam/windTurbineTerrain/0/p b/tutorials/incompressible/simpleFoam/windTurbineTerrain/0/p index 1449474a5e..add79aad34 100644 --- a/tutorials/incompressible/simpleFoam/windTurbineTerrain/0/p +++ b/tutorials/incompressible/simpleFoam/windTurbineTerrain/0/p @@ -29,8 +29,9 @@ boundaryField outlet { - type fixedValue; - value $internalField; + type uniformFixedValue; + value uniform $pressure; + uniformValue $pressure; } "terrain_.*" diff --git a/tutorials/incompressible/simpleFoam/windTurbineTerrain/Allrun b/tutorials/incompressible/simpleFoam/windTurbineTerrain/Allrun index 7cd2a91b26..fbbdf2c04a 100755 --- a/tutorials/incompressible/simpleFoam/windTurbineTerrain/Allrun +++ b/tutorials/incompressible/simpleFoam/windTurbineTerrain/Allrun @@ -4,10 +4,27 @@ cd ${0%/*} || exit 1 # run from this directory # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions +compileApplication windSimpleFoam + runApplication blockMesh -runApplication snappyHexMesh -overwrite -runApplication setSet -batch makeZones -runApplication setsToZones -noFlipMap -runApplication windSimpleFoam +runApplication decomposePar + +#runApplication snappyHexMesh -overwrite +#runApplication setSet -batch makeZones +#runApplication setsToZones -noFlipMap +#runApplication windSimpleFoam + +runParallel snappyHexMesh 2 -overwrite + +# Add wildcard entries for meshes patches since not preserved +# by decomposePar. Notice -literalRE option to add wildcard itself +# without evaluation. +runParallel changeDictionary 2 -literalRE + +runParallel setSet 2 -batch makeZones +runParallel windSimpleFoam 2 + +runApplication reconstructParMesh -constant +runApplication reconstructPar # ----------------------------------------------------------------- end-of-file diff --git a/tutorials/incompressible/simpleFoam/windTurbineTerrain/makeZones b/tutorials/incompressible/simpleFoam/windTurbineTerrain/makeZones index dac135f004..e1f6bbc4c9 100644 --- a/tutorials/incompressible/simpleFoam/windTurbineTerrain/makeZones +++ b/tutorials/incompressible/simpleFoam/windTurbineTerrain/makeZones @@ -1,2 +1,4 @@ cellSet actuationDisk1 new boxToCell (581850.5 4785805 1061) (581850.8 4785815 1071) -cellSet actuationDisk2 new boxToCell (581754 4785658 1065) (581754.4 4785668 1075) \ No newline at end of file +cellZoneSet actuationDisk1 new setToCellZone actuationDisk1 +cellSet actuationDisk2 new boxToCell (581754 4785658 1065) (581754.4 4785668 1075) +cellZoneSet actuationDisk2 new setToCellZone actuationDisk2 diff --git a/tutorials/incompressible/simpleFoam/windTurbineTerrain/system/changeDictionaryDict b/tutorials/incompressible/simpleFoam/windTurbineTerrain/system/changeDictionaryDict new file mode 100644 index 0000000000..09a5e24c6a --- /dev/null +++ b/tutorials/incompressible/simpleFoam/windTurbineTerrain/system/changeDictionaryDict @@ -0,0 +1,201 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object changeDictionaryDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +// Use absolute path to make sure it also works in parallel +#include "$FOAM_CASE/0/include/initialConditions" + +dictionaryReplacement +{ + + // Specify + // - all fvPatchFields with potential non-uniform values + // - all fvPatchFields originating from meshing + // - all fvPatchFields originating from mesh-redistribution + + p + { + boundaryField + { + outlet + { + type uniformFixedValue; + value $pressure; + uniformValue $pressure; + } + inlet + { + type zeroGradient; + } + "terrain_.*" + { + type zeroGradient; + } + ground + { + type zeroGradient; + } + #include "$FOAM_CASE/0/include/sideAndTopPatches" + "procBoundary.*" + { + type processor; + } + } + } + + k + { + boundaryField + { + outlet + { + type inletOutlet; + inletValue uniform 0.0; + value uniform $turbulentKE; + } + inlet + { + type uniformFixedValue; + uniformValue $turbulentKE; + } + "terrain_.*" + { + type kqRWallFunction; + value uniform 0.0; + } + ground + { + type zeroGradient; + } + #include "$FOAM_CASE/0/include/sideAndTopPatches" + "procBoundary.*" + { + type processor; + } + } + } + + U + { + boundaryField + { + outlet + { + type inletOutlet; + inletValue uniform (0 0 0); + value uniform $flowVelocity; + } + inlet + { + type atmBoundaryLayerInletVelocity; + Uref 10.0; + Href 20; + n (1 0 0); + z (0 0 1); + z0 0.1; + zGround 935.0; + value uniform $flowVelocity; + } + "terrain_.*" + { + type uniformFixedValue; + uniformValue $flowVelocity; + } + ground + { + type uniformFixedValue; + uniformValue $flowVelocity; + } + #include "$FOAM_CASE/0/include/sideAndTopPatches" + "procBoundary.*" + { + type processor; + } + } + } + + nut + { + boundaryField + { + outlet + { + type calculated; + value uniform 0; + } + inlet + { + type calculated; + value uniform 0; + } + "terrain_.*" + { + type nutkRoughWallFunction; + Ks uniform 0.2; //Ks = 20 Z0 + Cs uniform 0.5; + value uniform 0.0; + } + ground + { + type calculated; + value uniform 0; + } + #include "$FOAM_CASE/0/include/sideAndTopPatches" + "procBoundary.*" + { + type processor; + } + } + } + + epsilon + { + boundaryField + { + outlet + { + type zeroGradient; + } + inlet + { + type atmBoundaryLayerInletEpsilon; + Ustar 0.82; + z (0 0 1); + z0 0.1; + value uniform $turbulentEpsilon; + zGround 935.0; + } + "terrain_.*" + { + type epsilonWallFunction; + Cmu 0.09; + kappa 0.4; + E 9.8; + value uniform $turbulentEpsilon; + } + ground + { + type zeroGradient; + } + #include "$FOAM_CASE/0/include/sideAndTopPatches" + "procBoundary.*" + { + type processor; + } + } + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/simpleFoam/windTurbineTerrain/system/decomposeParDict b/tutorials/incompressible/simpleFoam/windTurbineTerrain/system/decomposeParDict index ede2ec0462..f45f2839e1 100644 --- a/tutorials/incompressible/simpleFoam/windTurbineTerrain/system/decomposeParDict +++ b/tutorials/incompressible/simpleFoam/windTurbineTerrain/system/decomposeParDict @@ -15,35 +15,15 @@ FoamFile // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -numberOfSubdomains 1; +numberOfSubdomains 2; method hierarchical; -// method metis; -// method ptscotch; - -simpleCoeffs -{ - n (4 1 1); - delta 0.001; -} hierarchicalCoeffs { - n (1 1 1); - delta 0.001; - order xyz; + n (2 1 1); + delta 0.001; + order xyz; } -manualCoeffs -{ - dataFile "cellDecomposition"; -} - -metisCoeffs -{ - //n (5 1 1); - //cellWeightsFile "constant/cellWeightsFile"; -} - - // ************************************************************************* // diff --git a/tutorials/incompressible/simpleFoam/windTurbineTerrain/system/fvSolution b/tutorials/incompressible/simpleFoam/windTurbineTerrain/system/fvSolution index 5bcf8d9898..ec738df41a 100644 --- a/tutorials/incompressible/simpleFoam/windTurbineTerrain/system/fvSolution +++ b/tutorials/incompressible/simpleFoam/windTurbineTerrain/system/fvSolution @@ -18,49 +18,49 @@ solvers { p { - solver smoothSolver; - smoother GaussSeidel; - tolerance 1e-6; - relTol 0.01; - maxIter 300; - }; + solver GAMG; + tolerance 1e-7; + relTol 0.1; + smoother GaussSeidel; + nPreSweeps 0; + nPostSweeps 2; + cacheAgglomeration on; + agglomerator faceAreaPair; + nCellsInCoarsestLevel 10; + mergeLevels 1; + } U { - solver smoothSolver; - smoother GaussSeidel; - tolerance 1e-6; - relTol 0.01; - }; + solver smoothSolver; + smoother GaussSeidel; + tolerance 1e-8; + relTol 0.1; + nSweeps 1; + } k { - solver smoothSolver; - smoother GaussSeidel; - tolerance 1e-6; - relTol 0.01; - }; + solver smoothSolver; + smoother GaussSeidel; + tolerance 1e-8; + relTol 0.1; + nSweeps 1; + } epsilon { - solver smoothSolver; - smoother GaussSeidel; - tolerance 1e-6; - relTol 0.01; - }; - - omega - { - solver smoothSolver; - smoother GaussSeidel; - tolerance 1e-6; - relTol 0.1; - }; + solver smoothSolver; + smoother GaussSeidel; + tolerance 1e-8; + relTol 0.1; + nSweeps 1; + } } SIMPLE { - nNonOrthogonalCorrectors 1; + nNonOrthogonalCorrectors 0; convergence 1e-3; }