From 0be3caec4ae594032873cc60655c1142e4169151 Mon Sep 17 00:00:00 2001 From: sergio Date: Thu, 9 Aug 2018 15:09:56 -0700 Subject: [PATCH] ENH: Improving twoRotorTutorial set up --- .../twoSimpleRotors/0.orig/U | 19 +++------ .../twoSimpleRotors/0.orig/epsilon | 39 +++++++++++++++++++ .../twoSimpleRotors/0.orig/k | 37 ++++++++++++++++++ .../twoSimpleRotors/0.orig/nut | 37 ++++++++++++++++++ .../twoSimpleRotors/0.orig/p | 21 +--------- .../twoSimpleRotors/0.orig/pointDisplacement | 2 +- .../overPimpleDyMFoam/twoSimpleRotors/Allrun | 6 +-- .../constant/turbulenceProperties | 11 +++++- .../twoSimpleRotors/system/blockMeshDict | 10 ++--- .../twoSimpleRotors/system/controlDict | 36 +++++++++++++++-- .../twoSimpleRotors/system/fvSchemes | 20 ++++++---- .../twoSimpleRotors/system/fvSolution | 11 +++--- 12 files changed, 191 insertions(+), 58 deletions(-) create mode 100644 tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/0.orig/epsilon create mode 100644 tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/0.orig/k create mode 100644 tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/0.orig/nut diff --git a/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/0.orig/U b/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/0.orig/U index 85e7687f82..b1d4e2b1b0 100644 --- a/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/0.orig/U +++ b/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/0.orig/U @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: v1806 | +| \\ / O peration | Version: plus | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ @@ -16,7 +16,7 @@ FoamFile dimensions [0 1 -1 0 0 0 0]; -internalField uniform (0.1 0 0); +internalField uniform (0 0 0); boundaryField { @@ -24,7 +24,6 @@ boundaryField walls { - //type slip; type uniformFixedValue; uniformValue (0 0 0); } @@ -37,20 +36,14 @@ boundaryField outlet { - type pressureInletOutletVelocity; - value uniform (0 0 0); + type uniformFixedValue; + uniformValue (0 0 0); } inlet { - type fixedValue; - value $internalField; + type uniformFixedValue; + uniformValue (0 0 0); } -// -// right1 -// { -// type zeroGradient; //calculated; -// value $internalField; -// } overset { diff --git a/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/0.orig/epsilon b/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/0.orig/epsilon new file mode 100644 index 0000000000..96e651d850 --- /dev/null +++ b/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/0.orig/epsilon @@ -0,0 +1,39 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: plus | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object epsilon; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +dimensions [ 0 2 -3 0 0 0 0 ]; + +internalField uniform 0.1; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + overset + { + type overset; + } + + "(walls|hole|inlet|outlet)" + { + type epsilonWallFunction; + value $internalField; + } + +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/0.orig/k b/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/0.orig/k new file mode 100644 index 0000000000..70c5926719 --- /dev/null +++ b/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/0.orig/k @@ -0,0 +1,37 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: plus | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object k; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 0 2 -2 0 0 0 0 ]; + +internalField uniform 0.01; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + overset + { + type overset; + } + + "(walls|hole|inlet|outlet)" + { + type kqRWallFunction; + value $internalField; + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/0.orig/nut b/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/0.orig/nut new file mode 100644 index 0000000000..8254830002 --- /dev/null +++ b/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/0.orig/nut @@ -0,0 +1,37 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: plus | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object nut; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 0 2 -1 0 0 0 0 ]; + +internalField uniform 0; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + overset + { + type overset; + } + + "(walls|hole|inlet|outlet)" + { + type nutkWallFunction; + value $internalField; + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/0.orig/p b/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/0.orig/p index e6b6343726..1818c10f3d 100644 --- a/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/0.orig/p +++ b/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/0.orig/p @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: v1806 | +| \\ / O peration | Version: plus | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ @@ -22,27 +22,10 @@ boundaryField { #includeEtc "caseDicts/setConstraintTypes" - "(walls|hole)" + "(walls|hole|outlet|inlet)" { type zeroGradient; } - - outlet - { - type fixedValue; - value uniform 0; - } - inlet - { - type zeroGradient; - } -// -// right1 -// { -// type fixedValue; //calculated; -// value $internalField; -// } - overset { type overset; diff --git a/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/0.orig/pointDisplacement b/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/0.orig/pointDisplacement index f20520b404..7252992283 100644 --- a/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/0.orig/pointDisplacement +++ b/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/0.orig/pointDisplacement @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: v1806 | +| \\ / O peration | Version: plus | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ diff --git a/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/Allrun b/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/Allrun index 10707b2f2c..cd2da7c142 100755 --- a/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/Allrun +++ b/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/Allrun @@ -5,10 +5,10 @@ cd ${0%/*} || exit 1 # Run from this directory ./Allrun.pre # Serial -#runApplication $(getApplication) +runApplication $(getApplication) # Parallel -runApplication decomposePar -cellDist -runParallel $(getApplication) +#runApplication decomposePar -cellDist +#runParallel $(getApplication) #------------------------------------------------------------------------------ diff --git a/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/constant/turbulenceProperties b/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/constant/turbulenceProperties index 58d6084c08..f1f2794666 100644 --- a/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/constant/turbulenceProperties +++ b/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/constant/turbulenceProperties @@ -14,6 +14,15 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -simulationType laminar; +simulationType RAS; + +RAS +{ + RASModel kEpsilon; + + turbulence on; + + printCoeffs on; +} // ************************************************************************* // diff --git a/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/system/blockMeshDict b/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/system/blockMeshDict index 46a5af9b20..2229b11edf 100644 --- a/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/system/blockMeshDict +++ b/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/system/blockMeshDict @@ -50,11 +50,11 @@ vertices blocks ( - hex (0 1 2 3 4 5 6 7) (73 37 1) simpleGrading (1 1 1) + hex (0 1 2 3 4 5 6 7) (140 70 1) simpleGrading (1 1 1) - hex (8 9 10 11 12 13 14 15) movingZone1 (28 12 1) simpleGrading (1 1 1) + hex (8 9 10 11 12 13 14 15) movingZone1 (60 24 1) simpleGrading (1 1 1) - hex (16 17 18 19 20 21 22 23) movingZone2 (12 28 1) simpleGrading (1 1 1) + hex (16 17 18 19 20 21 22 23) movingZone2 (24 60 1) simpleGrading (1 1 1) ); edges @@ -99,7 +99,7 @@ boundary inlet { - type patch; + type wall; faces ( (0 4 7 3) @@ -108,7 +108,7 @@ boundary outlet { - type patch; + type wall; faces ( (2 6 5 1) diff --git a/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/system/controlDict b/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/system/controlDict index eb4937b6ee..e354785257 100644 --- a/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/system/controlDict +++ b/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/system/controlDict @@ -16,6 +16,12 @@ FoamFile libs ("liboverset.so"); +DebugSwitches +{ + overset 0; + dynamicOversetFvMesh 0; +} + application overPimpleDyMFoam; startFrom startTime; @@ -24,9 +30,9 @@ startTime 0; stopAt endTime; -endTime 0.6; +endTime 0.08; -deltaT 0.00025; +deltaT 2e-5; writeControl adjustableRunTime; @@ -46,7 +52,7 @@ timePrecision 6; runTimeModifiable true; -adjustTimeStep yes; +adjustTimeStep no; maxCo 1; @@ -54,6 +60,30 @@ maxCo 1; functions { // #include "catalyst" + probes + { + type probes; + libs ("libsampling.so"); + + // Name of the directory for probe data + name probes; + + // Write at same frequency as fields + writeControl timeStep; + writeInterval 1; + + // Fields to be probed + fields (p U); + + // Optional: interpolation scheme to use (default is cell) + interpolationScheme cell; + + probeLocations + ( + (0.015 0.005 0.005) // at inlet + ); + + } } diff --git a/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/system/fvSchemes b/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/system/fvSchemes index 1f6946b84c..2c2f214bd9 100644 --- a/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/system/fvSchemes +++ b/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/system/fvSchemes @@ -22,18 +22,16 @@ ddtSchemes gradSchemes { default Gauss linear; - grad(T) Gauss linear; } divSchemes { default none; - div(phi,U) Gauss limitedLinearV 1; - div(phi,k) Gauss limitedLinear 1; - div(phi,epsilon) Gauss limitedLinear 1; - div(phi,R) Gauss limitedLinear 1; - div(R) Gauss linear; - div(phi,nuTilda) Gauss limitedLinear 1; + div(phi,U) Gauss upwind; + + div(phi,epsilon) Gauss upwind; + div(phi,k) Gauss upwind; + div((nuEff*dev2(T(grad(U))))) Gauss linear; } @@ -55,7 +53,7 @@ snGradSchemes oversetInterpolation { - method inverseDistance; + method cellVolumeWeight; } fluxRequired @@ -65,4 +63,10 @@ fluxRequired p ; } +oversetInterpolationSuppressed +{ + grad(p); + surfaceIntegrate(phiHbyA); +} + // ************************************************************************* // diff --git a/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/system/fvSolution b/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/system/fvSolution index 93a7d1ac66..7598109ce8 100644 --- a/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/system/fvSolution +++ b/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/system/fvSolution @@ -30,13 +30,14 @@ solvers { solver PBiCGStab; preconditioner DILU; - tolerance 1e-6; - relTol 0; + tolerance 1e-9; + relTol 0.01; } pFinal { $p; + relTol 0; } pcorr @@ -70,13 +71,13 @@ solvers PIMPLE { - momentumPredictor no; + momentumPredictor true; correctPhi no; nOuterCorrectors 1; - nCorrectors 2; + nCorrectors 5; nNonOrthogonalCorrectors 0; - ddtCorr false; + ddtCorr true; pRefPoint (0.0001 0.0001 0.001); pRefValue 0.0;