From 97fc5165631f08cc008b936e376396a93264476d Mon Sep 17 00:00:00 2001 From: Andrew Heather <> Date: Wed, 19 Dec 2018 09:46:26 +0000 Subject: [PATCH] ENH: Added new periodicHill test case --- .../pimpleFoam/LES/periodicHill/Allrun | 7 + .../LES/periodicHill/steadyState/0/U | 34 +++ .../LES/periodicHill/steadyState/0/k | 34 +++ .../LES/periodicHill/steadyState/0/nuTilda | 35 ++++ .../LES/periodicHill/steadyState/0/nut | 35 ++++ .../LES/periodicHill/steadyState/0/p | 34 +++ .../LES/periodicHill/steadyState/Allrun | 15 ++ .../steadyState/constant/transportProperties | 23 +++ .../steadyState/constant/turbulenceProperties | 27 +++ .../steadyState/system/blockMeshDict | 186 +++++++++++++++++ .../steadyState/system/controlDict | 49 +++++ .../steadyState/system/decomposeParDict | 28 +++ .../periodicHill/steadyState/system/fvOptions | 30 +++ .../periodicHill/steadyState/system/fvSchemes | 60 ++++++ .../steadyState/system/fvSolution | 59 ++++++ .../steadyState/system/topoSetDict | 63 ++++++ .../LES/periodicHill/transient/Allclean | 10 + .../LES/periodicHill/transient/Allrun | 9 + .../transient/constant/transportProperties | 23 +++ .../transient/constant/turbulenceProperties | 36 ++++ .../LES/periodicHill/transient/createPlots | 75 +++++++ .../transient/system/blockMeshDict | 187 +++++++++++++++++ .../periodicHill/transient/system/controlDict | 193 ++++++++++++++++++ .../transient/system/cuttingPlane | 47 +++++ .../transient/system/decomposeParDict | 28 +++ .../periodicHill/transient/system/fvOptions | 30 +++ .../periodicHill/transient/system/fvSchemes | 70 +++++++ .../periodicHill/transient/system/fvSolution | 80 ++++++++ 28 files changed, 1507 insertions(+) create mode 100755 tutorials/incompressible/pimpleFoam/LES/periodicHill/Allrun create mode 100644 tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/0/U create mode 100644 tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/0/k create mode 100644 tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/0/nuTilda create mode 100644 tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/0/nut create mode 100644 tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/0/p create mode 100755 tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/Allrun create mode 100644 tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/constant/transportProperties create mode 100644 tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/constant/turbulenceProperties create mode 100644 tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/system/blockMeshDict create mode 100644 tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/system/controlDict create mode 100644 tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/system/decomposeParDict create mode 100644 tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/system/fvOptions create mode 100644 tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/system/fvSchemes create mode 100644 tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/system/fvSolution create mode 100644 tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/system/topoSetDict create mode 100755 tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/Allclean create mode 100755 tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/Allrun create mode 100644 tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/constant/transportProperties create mode 100644 tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/constant/turbulenceProperties create mode 100755 tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/createPlots create mode 100644 tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/system/blockMeshDict create mode 100644 tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/system/controlDict create mode 100644 tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/system/cuttingPlane create mode 100644 tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/system/decomposeParDict create mode 100644 tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/system/fvOptions create mode 100644 tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/system/fvSchemes create mode 100644 tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/system/fvSolution diff --git a/tutorials/incompressible/pimpleFoam/LES/periodicHill/Allrun b/tutorials/incompressible/pimpleFoam/LES/periodicHill/Allrun new file mode 100755 index 00000000000..6b20878d493 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/LES/periodicHill/Allrun @@ -0,0 +1,7 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + +(cd steadyState && ./Allrun) + +(cd transient && ./Allrun) + diff --git a/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/0/U b/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/0/U new file mode 100644 index 00000000000..62470fc439f --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/0/U @@ -0,0 +1,34 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1806 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (1e-3 0 0); + +boundaryField +{ + "(inlet|outlet|front|back)" + { + type cyclic; + } + + "(top|hills)" + { + type noSlip; + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/0/k b/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/0/k new file mode 100644 index 00000000000..27f138b67bc --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/0/k @@ -0,0 +1,34 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1806 | +| \\ / 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; + +boundaryField +{ + "(inlet|outlet|front|back)" + { + type cyclic; + } + + "(top|hills)" + { + type zeroGradient; + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/0/nuTilda b/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/0/nuTilda new file mode 100644 index 00000000000..d9a75822cec --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/0/nuTilda @@ -0,0 +1,35 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1806 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object nuTilda; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 1e-8; + +boundaryField +{ + "(inlet|outlet|front|back)" + { + type cyclic; + } + + "(top|hills)" + { + type fixedValue; + value uniform 0; + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/0/nut b/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/0/nut new file mode 100644 index 00000000000..8778e2c0582 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/0/nut @@ -0,0 +1,35 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1806 | +| \\ / 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 +{ + "(inlet|outlet|front|back)" + { + type cyclic; + } + + "(top|hills)" + { + type nutUSpaldingWallFunction; + value $internalField; + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/0/p b/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/0/p new file mode 100644 index 00000000000..7c95f6c5fed --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/0/p @@ -0,0 +1,34 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1806 | +| \\ / 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 +{ + "(inlet|outlet|front|back)" + { + type cyclic; + } + + "(top|hills)" + { + type zeroGradient; + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/Allrun b/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/Allrun new file mode 100755 index 00000000000..c4486609352 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/Allrun @@ -0,0 +1,15 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +runApplication blockMesh + +runApplication topoSet + +runApplication decomposePar + +runParallel simpleFoam + + diff --git a/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/constant/transportProperties b/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/constant/transportProperties new file mode 100644 index 00000000000..bba396ea0aa --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/constant/transportProperties @@ -0,0 +1,23 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1806 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object transportProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +transportModel Newtonian; + +nu 2.643e-6; + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/constant/turbulenceProperties b/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/constant/turbulenceProperties new file mode 100644 index 00000000000..1a90efe7e7b --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/constant/turbulenceProperties @@ -0,0 +1,27 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1806 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RAS; + +RAS +{ + RASModel SpalartAllmaras; + printCoeffs no; + turbulence yes; +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/system/blockMeshDict b/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/system/blockMeshDict new file mode 100644 index 00000000000..064ca7294c8 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/system/blockMeshDict @@ -0,0 +1,186 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1806 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +scale 0.001; + +vertices +( + ( 0 28 0) // 0 + (252 28 0) // 1 + (252 85 0) // 2 + ( 0 85 0) // 3 + + ( 0 28 126) // 4 + (252 28 126) // 5 + (252 85 126) // 6 + ( 0 85 126) // 7 +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (200 160 80) simpleGrading (1 ((0.5 0.5 100)(0.5 0.5 0.01)) 1) +); + + + +edges #codeStream +{ + codeInclude + #{ + #include "pointField.H" + #include "mathematicalConstants.H" + #}; + + code + #{ + const scalar xMin = 0; + const scalar xMax = 252; + const label nPoints = 1000; + const scalar dx = (xMax - xMin)/scalar(nPoints - 1); + + os << "(" << nl << "spline 0 1" << nl; + pointField profile(nPoints, Zero); + + for (label i = 0; i < nPoints; ++i) + { + scalar x = xMin + i*dx; + profile[i].x() = x; + if (x > 198) x = 252 - x; + + if (x >= 0 && x < 9) + { + profile[i].y() = + 28 + + 6.775070969851E-03*x*x + - 2.124527775800E-03*x*x*x; + } + else if (x >= 9 && x < 14) + { + profile[i].y() = + 25.07355893131 + + 0.9754803562315*x + - 1.016116352781E-01*x*x + + 1.889794677828E-03*x*x*x; + } + else if (x >= 14 && x < 20) + { + profile[i].y() = + 2.579601052357E+01 + + 8.206693007457E-01*x + - 9.055370274339E-02*x*x + + 1.626510569859E-03*x*x*x; + } + else if (x >= 20 && x < 30) + { + profile[i].y() = + 4.046435022819E+01 + - 1.379581654948E+00*x + + 1.945884504128E-02*x*x + - 2.070318932190E-04*x*x*x; + } + else if (x >= 30 && x < 40) + { + profile[i].y() = + 1.792461334664E+01 + + 8.743920332081E-01*x + - 5.567361123058E-02*x*x + + 6.277731764683E-04*x*x*x; + } + else if (x >= 40 && x < 54) + { + profile[i].y() = + max + ( + 0, + 5.639011190988E+01 + - 2.010520359035E+00*x + + 1.644919857549E-02*x*x + + 2.674976141766E-05*x*x*x + ); + } + profile[i].z() = 0; + } + os << profile << nl; + + os << "spline 4 5" << nl; + profile.replace(2, 126); + os << profile << nl; + + os << ");" << nl; + #}; +}; + +boundary +( + inlet + { + type cyclic; + neighbourPatch outlet; + faces + ( + (0 4 7 3) + ); + } + outlet + { + type cyclic; + neighbourPatch inlet; + faces + ( + (1 2 6 5) + ); + } + top + { + type wall; + faces + ( + (3 7 6 2) + ); + } + hills + { + type wall; + faces + ( + (1 5 4 0) + ); + } + front + { + type cyclic; + neighbourPatch back; + faces + ( + (0 3 2 1) + ); + } + back + { + type cyclic; + neighbourPatch front; + faces + ( + (4 5 6 7) + ); + } +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/system/controlDict b/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/system/controlDict new file mode 100644 index 00000000000..64fa0fb02c4 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/system/controlDict @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1806 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application simpleFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 1500; + +deltaT 1; + +writeControl timeStep; + +writeInterval 100; + +purgeWrite 3; + +writeFormat binary; + +writePrecision 6; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable true; + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/system/decomposeParDict b/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/system/decomposeParDict new file mode 100644 index 00000000000..c52a1417394 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/system/decomposeParDict @@ -0,0 +1,28 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1806 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + note "mesh decomposition control dictionary"; + object decomposeParDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 16; + +method simple; + +simpleCoeffs +{ + n (4 2 2); +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/system/fvOptions b/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/system/fvOptions new file mode 100644 index 00000000000..90d770e0953 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/system/fvOptions @@ -0,0 +1,30 @@ +/*--------------------------------*- 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 dictionary; + location "constant"; + object fvOptions; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +momentumSource +{ + type meanVelocityForce; + + selectionMode cellZone; + cellZone inletCellZone; + + fields (U); + Ubar (1 0 0); +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/system/fvSchemes b/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/system/fvSchemes new file mode 100644 index 00000000000..9f7b28b3715 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/system/fvSchemes @@ -0,0 +1,60 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1806 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default steadyState; +} + +gradSchemes +{ + default Gauss linear; + grad(p) Gauss linear; +} + +divSchemes +{ + default none; + div(phi,U) Gauss upwind; + div(phi,k) Gauss limitedLinear 1; + div(phi,nuTilda) Gauss limitedLinear 1; + div((nuEff*dev2(T(grad(U))))) Gauss linear; +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + +wallDist +{ + method meshWave; + nRequired yes; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/system/fvSolution b/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/system/fvSolution new file mode 100644 index 00000000000..94fe9d41cea --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/system/fvSolution @@ -0,0 +1,59 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1806 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "controlDict" + +solvers +{ + p + { + solver GAMG; + smoother DICGaussSeidel; + tolerance 1e-06; + relTol 0.05; + } + + + "(U|k|nuTilda)" + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-05; + relTol 0.1; + } +} + + +SIMPLE +{ + nNonOrthogonalCorrectors 0; + consistent yes; + pRefCell 0; + pRefValue 0; +} + +relaxationFactors +{ + equations + { + U 0.9; + nuTilda 0.7; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/system/topoSetDict b/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/system/topoSetDict new file mode 100644 index 00000000000..11047e9832d --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/LES/periodicHill/steadyState/system/topoSetDict @@ -0,0 +1,63 @@ +/*--------------------------------*- 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 dictionary; + object topoSetDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +actions +( + { + name inletFaceSet; + type faceSet; + action new; + source patchToFace; + sourceInfo + { + name inlet; + } + } + { + name inletCellSet; + type cellSet; + action new; + source faceToCell; + sourceInfo + { + set inletFaceSet; + option any; + } + } + { + name inletCellSet; + type cellSet; + action subset; + source boxToCell; + sourceInfo + { + box (-100 -100 -100)(0.1 100 100); + } + } + { + name inletCellZone; + type cellZoneSet; + action new; + source setToCellZone; + sourceInfo + { + set inletCellSet; + } + } +); + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/Allclean b/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/Allclean new file mode 100755 index 00000000000..282a9d3da2f --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/Allclean @@ -0,0 +1,10 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + + +# Source tutorial clean functions +. $WM_PROJECT_DIR/bin/tools/CleanFunctions + +cleanCase + +rm -rf processor* diff --git a/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/Allrun b/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/Allrun new file mode 100755 index 00000000000..4ae78b09746 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/Allrun @@ -0,0 +1,9 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +ln -s $(echo ../steadyState/processor*) . + +runParallel pimpleFoam diff --git a/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/constant/transportProperties b/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/constant/transportProperties new file mode 100644 index 00000000000..bba396ea0aa --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/constant/transportProperties @@ -0,0 +1,23 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1806 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object transportProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +transportModel Newtonian; + +nu 2.643e-6; + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/constant/turbulenceProperties b/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/constant/turbulenceProperties new file mode 100644 index 00000000000..a0f9d315088 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/constant/turbulenceProperties @@ -0,0 +1,36 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1806 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType LES; + +LES +{ + LESModel SpalartAllmarasIDDES; + printCoeffs no; + turbulence yes; + delta IDDESDelta; + + IDDESDeltaCoeffs + { + hmax maxDeltaxyzCubeRoot; + maxDeltaxyzCubeRootCoeffs + { + } + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/createPlots b/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/createPlots new file mode 100755 index 00000000000..399b42b5df5 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/createPlots @@ -0,0 +1,75 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + +time=$(foamListTimes -latestTime -processor) + +echo "Creating plots for time $time" + +resultsDir="postProcessing/sample/$time" + +# Mapping between OpenFOAM and experimental datasets +declare -A of_vs_exp +of_vs_exp[0.05]="001" +of_vs_exp[0.5]="002" +of_vs_exp[1]="003" +of_vs_exp[2]="004" +of_vs_exp[3]="005" +of_vs_exp[4]="006" +of_vs_exp[5]="007" +of_vs_exp[6]="008" +of_vs_exp[7]="009" +of_vs_exp[8]="010" + + +plotStr() { + pos=$1 + exp=$2 + +cat<<EOF + set terminal pngcairo enhanced font "arial,16" size 600,600 + set ylabel "y/H" + set yrange [-0.1:3.1] + set grid + Ub=1 + h=0.028 + + set key left top + set xlabel "U_x/U_b" + set xrange [-0.4:1.2] + set output "U_at_x_by_h${pos}.png" + plot \ + "$resultsDir/xbyh${pos}_U_columnAverage:columnAverage(UMean).xy" \ + u (\$5/Ub):(\$1/h) w lines lc "black" lw 2 t "OpenFOAM" + set key right top + set xlabel "<u'u'>/{U_b}^2" + set xrange [0:0.1] + set output "uu_at_x_by_h${pos}.png" + plot \ + "$resultsDir/xbyh${pos}_columnAverage:columnAverage(UPrime2Mean).xy" \ + u (\$2/Ub/Ub):(\$1/h) w lines lc "black" lw 2 t "OpenFOAM" + + set key right top + set xlabel "<v'v'>/{U_b}^2" + set xrange [0:0.06] + set output "vv_at_x_by_h${pos}.png" + plot \ + "$resultsDir/xbyh${pos}_columnAverage:columnAverage(UPrime2Mean).xy" \ + u (\$5/Ub/Ub):(\$1/h) w lines lc "black" lw 2 t "OpenFOAM" + + set key left top + set xlabel "<u'v'>/{U_b}^2" + set xrange [-0.06:0.02] + set output "uv_at_x_by_h${pos}.png" + plot \ + "$resultsDir/xbyh${pos}_columnAverage:columnAverage(UPrime2Mean).xy" \ + u (\$3/Ub/Ub):(\$1/h) w lines lc "black" lw 2 t "OpenFOAM" +EOF +} + + +for i in "${!of_vs_exp[@]}" +do + exp=${of_vs_exp[$i]} + gnuplot<<<$(plotStr $i $exp) +done + diff --git a/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/system/blockMeshDict b/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/system/blockMeshDict new file mode 100644 index 00000000000..15353904ef7 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/system/blockMeshDict @@ -0,0 +1,187 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1806 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +scale 0.001; + +vertices +( + ( 0 28 0) // 0 + (252 28 0) // 1 + (252 85 0) // 2 + ( 0 85 0) // 3 + + ( 0 28 126) // 4 + (252 28 126) // 5 + (252 85 126) // 6 + ( 0 85 126) // 7 +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (200 160 80) simpleGrading (1 ((0.5 0.5 100)(0.5 0.5 0.01)) 1) +); + + + +edges #codeStream +{ + codeInclude + #{ + #include "pointField.H" + #include "mathematicalConstants.H" + #}; + + code + #{ + const scalar xMin = 0; + const scalar xMax = 252; + const label nPoints = 1000; + const scalar dx = (xMax - xMin)/scalar(nPoints - 1); + + os << "(" << nl << "spline 0 1" << nl; + pointField profile(nPoints); + + for (label i = 0; i < nPoints; ++i) + { + scalar x = xMin + i*dx; + profile[i].x() = x; + if (x > 198) x = 252 - x; + + if (x >= 0 && x < 9) + { + profile[i].y() = + 28 + + 6.775070969851E-03*x*x + - 2.124527775800E-03*x*x*x; + } + else if (x >= 9 && x < 14) + { + profile[i].y() = + 25.07355893131 + + 0.9754803562315*x + - 1.016116352781E-01*x*x + + 1.889794677828E-03*x*x*x; + } + else if (x >= 14 && x < 20) + { + profile[i].y() = + 2.579601052357E+01 + + 8.206693007457E-01*x + - 9.055370274339E-02*x*x + + 1.626510569859E-03*x*x*x; + } + else if (x >= 20 && x < 30) + { + profile[i].y() = + 4.046435022819E+01 + - 1.379581654948E+00*x + + 1.945884504128E-02*x*x + - 2.070318932190E-04*x*x*x; + } + else if (x >= 30 && x < 40) + { + profile[i].y() = + 1.792461334664E+01 + + 8.743920332081E-01*x + - 5.567361123058E-02*x*x + + 6.277731764683E-04*x*x*x; + } + else if (x >= 40 && x < 54) + { + profile[i].y() = + max + ( + 0, + 5.639011190988E+01 + - 2.010520359035E+00*x + + 1.644919857549E-02*x*x + + 2.674976141766E-05*x*x*x + ); + } + profile[i].z() = 0; + } + os << profile << nl; + + os << "spline 4 5" << nl; + profile.replace(2, 126); + os << profile << nl; + + os << ");" << nl; + #}; +}; + +boundary +( + inlet + { + type cyclic; + neighbourPatch outlet; + faces + ( + (0 4 7 3) + ); + } + outlet + { + type cyclic; + neighbourPatch inlet; + faces + ( + (1 2 6 5) + ); + } + top + { + type wall; + faces + ( + (3 7 6 2) + ); + } + hills + { + type wall; + faces + ( + (1 5 4 0) + ); + } + front + { + type cyclic; + neighbourPatch back; + faces + ( + (0 3 2 1) + ); + } + + back + { + type cyclic; + neighbourPatch front; + faces + ( + (4 5 6 7) + ); + } +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/system/controlDict b/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/system/controlDict new file mode 100644 index 00000000000..e9370a09c0b --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/system/controlDict @@ -0,0 +1,193 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1806 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +libs ("libturbulenceModelSchemes.so"); + +application pimpleFoam; + +startFrom startTime; + +startTime 1500; + +stopAt endTime; + +endTime 1510; + +deltaT 1e-4; + +writeControl timeStep; + +writeInterval 500; + +purgeWrite 5; + +writeFormat binary; + +writePrecision 8; + +writeCompression off; + +timeFormat general; + +timePrecision 10; + +runTimeModifiable true; + +adjustTimeStep no; + +functions +{ + fieldAverage1 + { + type fieldAverage; + libs ("libfieldFunctionObjects.so"); + writeControl writeTime; + timeStart 1500.5; // approx 2x flow-throughs + fields + ( + U + { + mean on; + prime2Mean on; + base time; + } + + p + { + mean on; + prime2Mean on; + base time; + } + ); + } + + columnAverage + { + type columnAverage; + libs ("libfieldFunctionObjects.so"); + + evaluateControl writeTime; + writeControl none; + timeStart 1500.5; // approx 2x flow-throughs + + // Note: include processorCyclics! + patches (front "proc.*throughfront"); + fields + ( + p + U + UMean + UPrime2Mean + ); + } + + sample + { + type sets; + libs ("libsampling.so"); + writeControl writeTime; + timeStart 1500.5; // approx 2x flow-throughs + + interpolationScheme cellPoint; + + setFormat raw; + + sets + ( + xbyh0.05 + { + type face; + axis y; + start (0.0014 0 0.063); + end (0.0014 1 0.063); + } + xbyh0.5 + { + type face; + axis y; + start (0.014 0 0.063); + end (0.014 1 0.063); + } + xbyh1 + { + type face; + axis y; + start (0.028 0 0.063); + end (0.028 1 0.063); + } + xbyh2 + { + type face; + axis y; + start (0.056 0 0.063); + end (0.056 1 0.063); + } + xbyh3 + { + type face; + axis y; + start (0.084 0 0.063); + end (0.084 1 0.063); + } + xbyh4 + { + type face; + axis y; + start (0.112 0 0.063); + end (0.112 1 0.063); + } + xbyh5 + { + type face; + axis y; + start (0.140 0 0.063); + end (0.140 1 0.063); + } + xbyh6 + { + type face; + axis y; + start (0.168 0 0.063); + end (0.168 1 0.063); + } + xbyh7 + { + type face; + axis y; + start (0.196 0 0.063); + end (0.196 1 0.063); + } + xbyh8 + { + type face; + axis y; + start (0.224 0 0.063); + end (0.224 1 0.063); + } + ); + + + fields + ( + U + columnAverage:columnAverage(UMean) + columnAverage:columnAverage(UPrime2Mean) + ); + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/system/cuttingPlane b/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/system/cuttingPlane new file mode 100644 index 00000000000..eb1d89273b5 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/system/cuttingPlane @@ -0,0 +1,47 @@ +/*--------------------------------*- 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 dictionary; + location "system"; + object cuttingPlane; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +functions +{ +cuttingPlane +{ + type surfaces; + libs ("libsampling.so"); + writeControl writeTime; + + surfaceFormat vtk; + fields ( p U ); + + interpolationScheme cellPoint; + + surfaces + ( + yNormal + { + type cuttingPlane; + planeType pointAndNormal; + pointAndNormalDict + { + point (0 0 0.063); + normal (0 0 1); + } + interpolate true; + } + ); +} +} + diff --git a/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/system/decomposeParDict b/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/system/decomposeParDict new file mode 100644 index 00000000000..d4e6e0822a3 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/system/decomposeParDict @@ -0,0 +1,28 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1806 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + note "mesh decomposition control dictionary"; + object decomposeParDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 8; + +method simple; + +simpleCoeffs +{ + n (2 2 2); +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/system/fvOptions b/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/system/fvOptions new file mode 100644 index 00000000000..90d770e0953 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/system/fvOptions @@ -0,0 +1,30 @@ +/*--------------------------------*- 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 dictionary; + location "constant"; + object fvOptions; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +momentumSource +{ + type meanVelocityForce; + + selectionMode cellZone; + cellZone inletCellZone; + + fields (U); + Ubar (1 0 0); +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/system/fvSchemes b/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/system/fvSchemes new file mode 100644 index 00000000000..1111519a49b --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/system/fvSchemes @@ -0,0 +1,70 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1806 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default backward; +} + +gradSchemes +{ + default Gauss linear; + grad(p) Gauss linear; +} + +divSchemes +{ + default none; + div(phi,U) Gauss DEShybrid + linear // scheme 1 + linearUpwind grad(U) // scheme 2 + hmax + 0.65 // DES coefficient, typically = 0.65 + 1 // Reference velocity scale + 0.028 // Reference length scale + 0 // Minimum sigma limit (0-1) + 1 // Maximum sigma limit (0-1) + 1; // 1.0e-03; // Limiter of B function, typically 1e-03 +// div(phi,U) Gauss linear; + div(phi,k) Gauss limitedLinear 1; + div(phi,nuTilda) Gauss limitedLinear 1; + div((nuEff*dev2(T(grad(U))))) Gauss linear; +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + +wallDist +{ + method meshWave; + nRequired yes; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/system/fvSolution b/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/system/fvSolution new file mode 100644 index 00000000000..26917405b1b --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/system/fvSolution @@ -0,0 +1,80 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1806 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "controlDict" + +solvers +{ + p + { + solver GAMG; + smoother DICGaussSeidel; + tolerance 1e-06; + relTol 0.05; + } + + pFinal + { + $p; + relTol 0; + } + + "(U|k|nuTilda)" + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-05; + relTol 0.1; + } + + "(U|k|nuTilda)Final" + { + $U; + relTol 0; + } +} + + +SIMPLE +{ + nNonOrthogonalCorrectors 0; + pRefCell 0; + pRefValue 0; +} + +PIMPLE +{ + nOuterCorrectors 1; + nCorrectors 3; + nNonOrthogonalCorrectors 1; + pRefCell 0; + pRefValue 0; +} + +relaxationFactors +{ + fields + { + } + equations + { + ".*" 1; + } +} + + +// ************************************************************************* // -- GitLab