diff --git a/applications/utilities/preProcessing/createBoxTurb/createFields.H b/applications/utilities/preProcessing/createBoxTurb/createFields.H index 2b0fb5e643a2b602d14a960425bfa45913049666..a0f6c4ca0fa038ceb5ddb5b2e7fa949d1dabb037 100644 --- a/applications/utilities/preProcessing/createBoxTurb/createFields.H +++ b/applications/utilities/preProcessing/createBoxTurb/createFields.H @@ -16,7 +16,7 @@ const vector L(dict.get<vector>("L")); const Vector<label> N(dict.get<Vector<label>>("N")); // Wave number vs energy profile -autoPtr<Function1<scalar>> Ek(Function1<scalar>::New("E", dict)); +autoPtr<Function1<scalar>> Ek(Function1<scalar>::New("Ek", dict)); // Number of modes const label nModes = dict.get<label>("nModes"); diff --git a/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/0.orig/nut b/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/0.orig/nut new file mode 100644 index 0000000000000000000000000000000000000000..dd331473ffa8bcab46fb0330bb76774d1ab7212c --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/0.orig/nut @@ -0,0 +1,31 @@ +/*--------------------------------*- 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; + location "0"; + object nut; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + ".*" + { + type cyclic; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/0.orig/p b/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/0.orig/p new file mode 100644 index 0000000000000000000000000000000000000000..3eb2549010fab5e59562711c9c96409caec9d5fb --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/0.orig/p @@ -0,0 +1,31 @@ +/*--------------------------------*- 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; + location "0"; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + ".*" + { + type cyclic; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/Allclean b/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/Allclean new file mode 100755 index 0000000000000000000000000000000000000000..f302b7891a417508af9b4804b1e06258bac31f7d --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/Allclean @@ -0,0 +1,5 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory +. $WM_PROJECT_DIR/bin/tools/CleanFunctions # Tutorial clean functions + +cleanCase0 diff --git a/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/Allrun b/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/Allrun new file mode 100755 index 0000000000000000000000000000000000000000..fa83764ff90ebb5b229c5e6afa79cc2144b5ae97 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/Allrun @@ -0,0 +1,13 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory +. $WM_PROJECT_DIR/bin/tools/RunFunctions # Tutorial run functions + +restore0Dir + +runApplication -s createBlockMesh createBoxTurb -createBlockMesh + +runApplication decomposePar + +runParallel createBoxTurb + +runParallel pimpleFoam diff --git a/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/README b/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/README new file mode 100644 index 0000000000000000000000000000000000000000..81fcc2d22d68a3286e13f50e0154f8c8554d1a0e --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/README @@ -0,0 +1,16 @@ +Decay of homogenious incompressible isotropic turbulence + +This case is based on the set-up of Comte-Bellot and S. Corrsin [1] + +The mesh comprises a block-structured cube divided into 64x64x64 cells, with +a box length of 9*pi cm. + +Turbulence is initialised using the target energy spectrum supplied in [1] (see +table 3). + +For more information, see: + + https://www.openfoam.com/documentation/cpp-guide/html/verification-validation-turbulent-decay-homogeneous-isotropic-turbulence.html + +[1] G. Comte-Bellot and S. Corrsin, "The use of a contraction to improve the + isotropy of grid-generated turbulence," J. Fluid Mech. 25, 657 (1966). diff --git a/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/constant/createBoxTurbDict b/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/constant/createBoxTurbDict new file mode 100644 index 0000000000000000000000000000000000000000..0457469e9e5fc58008e863b832e52940c9b1b344 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/constant/createBoxTurbDict @@ -0,0 +1,54 @@ +/*--------------------------------*- 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 createBoxTurbDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +N (64 64 64); +//N (128 128 128); +//N (256 256 256); + +// Suggested box size of 9*2*pi [cm] +L (0.56548667765 0.56548667765 0.56548667765); + +nModes 5000; + +// Energy as a function of wave number +// Here using Comte-Bellot and Corrsin data at t.U_0/M = 42 (see Ref. table 3) +Ek table +( + (15 0) + (20 0.000129) + (25 0.00023) + (30 0.000322) + (40 0.000435) + (50 0.000457) + (70 0.00038) + (100 0.00027) + (150 0.000168) + (200 0.00012) + (250 8.9e-05) + (300 7.03e-05) + (400 4.7e-05) + (600 2.47e-05) + (800 1.26e-05) + (1000 7.42e-06) + (1250 3.96e-06) + (1500 2.33e-06) + (1750 1.34e-06) + (2000 8e-07) +); + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/constant/include/turbulenceModels b/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/constant/include/turbulenceModels new file mode 100644 index 0000000000000000000000000000000000000000..264a45358b9bcc05dfcfe8483f87a88d2f03eaeb --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/constant/include/turbulenceModels @@ -0,0 +1,38 @@ +WALE +{ + delta cubeRootVol; + + cubeRootVolCoeffs + { + deltaCoeff 1; + } +} + +kEqn +{ + delta cubeRootVol; + kEqnCoeffs + { + Ck 0.094; + Ce 1.048; + } +} + +dynamicKEqn +{ + delta cubeRootVol; + dynamicKEqnCoeffs + { + filter simple; + } +} + +Smagorinsky +{ + delta cubeRootVol; + SmagorinskyCoeffs + { + Ck 0.094; + Ce 1.048; + } +} diff --git a/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/constant/transportProperties b/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/constant/transportProperties new file mode 100644 index 0000000000000000000000000000000000000000..1a283199e0ae854061dba46babf98721bc2001c4 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/constant/transportProperties @@ -0,0 +1,22 @@ +/*--------------------------------*- 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 1e-05; + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/constant/turbulenceProperties b/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/constant/turbulenceProperties new file mode 100644 index 0000000000000000000000000000000000000000..ce83a8191fb36b79819d8acb874c7d805a119b0a --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/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; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "include/turbulenceModels" + +simulationType LES; + + +LES +{ + turbulence on; + + printCoeffs on; + + LESModel kEqn; + + ${:$LESModel} +} + + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/system/blockMeshDict b/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/system/blockMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..9c0fa82f46bf231671b63e1987021cdcd2b84a88 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/system/blockMeshDict @@ -0,0 +1,115 @@ +/*--------------------------------*- 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 1; + +vertices +( + (0 0 0) + (4 0 0) + (0 1 0) + (4 1 0) + (0 2 0) + (4 2 0) + (0 0 2) + (4 0 2) + (0 1 2) + (4 1 2) + (0 2 2) + (4 2 2) +); + +blocks +( + hex (0 1 3 2 6 7 9 8) (40 25 30) simpleGrading (1 10.7028 1) + hex (2 3 5 4 8 9 11 10) (40 25 30) simpleGrading (1 0.0934 1) +); + +edges +( +); + +boundary +( + bottomWall + { + type wall; + faces ((0 1 7 6)); + } + topWall + { + type wall; + faces ((4 10 11 5)); + } + + sides1_half0 + { + type cyclic; + neighbourPatch sides1_half1; + faces ((0 2 3 1)); + } + sides1_half1 + { + type cyclic; + neighbourPatch sides1_half0; + faces ((6 7 9 8)); + } + + sides2_half0 + { + type cyclic; + neighbourPatch sides2_half1; + faces ((2 4 5 3)); + } + sides2_half1 + { + type cyclic; + neighbourPatch sides2_half0; + faces ((8 9 11 10)); + } + + inout1_half0 + { + type cyclic; + neighbourPatch inout1_half1; + faces ((1 3 9 7)); + } + inout1_half1 + { + type cyclic; + neighbourPatch inout1_half0; + faces ((0 6 8 2)); + } + + inout2_half0 + { + type cyclic; + neighbourPatch inout2_half1; + faces ((3 5 11 9)); + } + inout2_half1 + { + type cyclic; + neighbourPatch inout2_half0; + faces ((2 8 10 4)); + } +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/system/controlDict b/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/system/controlDict new file mode 100644 index 0000000000000000000000000000000000000000..bfb898fe6af1b3d02ef1ae7ff5e811e0dd633ddd --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/system/controlDict @@ -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 controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application pimpleFoam; + +startFrom startTime; + +startTime 0; +//startTime 0.28; +//startTime 0.66; + +stopAt endTime; + +endTime 1; + +deltaT 0.001; + +writeControl timeStep; + +writeInterval 10; + +purgeWrite 0; + +writeFormat binary; + +writePrecision 6; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable true; + +functions +{ + energySpectrum1 + { + type energySpectrum; + libs ("librandomProcessesFunctionObjects.so"); + writeControl writeTime; + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/system/decomposeParDict b/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/system/decomposeParDict new file mode 100644 index 0000000000000000000000000000000000000000..d4e6e0822a38cf10e0d53dbf76026991f825abaa --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/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/decayIsoTurb/system/fvSchemes b/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/system/fvSchemes new file mode 100644 index 0000000000000000000000000000000000000000..fa0b24fc414a15d68811b9bc4219c32ddf81ebee --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/system/fvSchemes @@ -0,0 +1,61 @@ +/*--------------------------------*- 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; +} + +divSchemes +{ + default none; + div(phi,U) Gauss linear; + div(phi,k) Gauss limitedLinear 1; + div(phi,B) Gauss limitedLinear 1; + div(B) Gauss linear; + div(U) Gauss linear; + 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; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/system/fvSolution b/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/system/fvSolution new file mode 100644 index 0000000000000000000000000000000000000000..cd4d4f956c36915478a18c2c641390277757f670 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/LES/decayIsoTurb/system/fvSolution @@ -0,0 +1,63 @@ +/*--------------------------------*- 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; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + p + { + solver GAMG; + tolerance 0; + relTol 0.1; + smoother GaussSeidel; + } + + pFinal + { + $p; + smoother DICGaussSeidel; + tolerance 1e-06; + relTol 0; + } + + "(U|k|nuTilda)" + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-05; + relTol 0.1; + minIter 1; + } + + "(U|k|nuTilda)Final" + { + $U; + tolerance 1e-05; + relTol 0; + } +} + +PIMPLE +{ + nOuterCorrectors 1; + nCorrectors 2; + nNonOrthogonalCorrectors 0; + pRefCell 0; + pRefValue 0; +} + + +// ************************************************************************* //