diff --git a/tutorials/incompressible/simpleFoam/windAroundBuildings/0/U b/tutorials/incompressible/simpleFoam/windAroundBuildings/0/U new file mode 100644 index 0000000000..8b7d69447a --- /dev/null +++ b/tutorials/incompressible/simpleFoam/windAroundBuildings/0/U @@ -0,0 +1,46 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +Uinlet (10 0 0); + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + inlet + { + type fixedValue; + value uniform $Uinlet; + } + + outlet + { + type pressureInletOutletVelocity; + value uniform (0 0 0); + } + + wall + { + type fixedValue; + value uniform (0 0 0); + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/simpleFoam/windAroundBuildings/0/epsilon b/tutorials/incompressible/simpleFoam/windAroundBuildings/0/epsilon new file mode 100644 index 0000000000..0d85dabb8b --- /dev/null +++ b/tutorials/incompressible/simpleFoam/windAroundBuildings/0/epsilon @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object epsilon; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +epsilonInlet 0.03; // Cmu^0.75 * k^1.5 / L ; L =10 + +dimensions [0 2 -3 0 0 0 0]; + +internalField uniform $epsilonInlet; + +boundaryField +{ + inlet + { + type fixedValue; + value uniform $epsilonInlet; + } + + outlet + { + type inletOutlet; + inletValue uniform $epsilonInlet; + value uniform $epsilonInlet; + } + + wall + { + type epsilonWallFunction; + value uniform $epsilonInlet; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/simpleFoam/windAroundBuildings/0/k b/tutorials/incompressible/simpleFoam/windAroundBuildings/0/k new file mode 100644 index 0000000000..791667e164 --- /dev/null +++ b/tutorials/incompressible/simpleFoam/windAroundBuildings/0/k @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object k; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +kInlet 1.5; // approx k = 1.5*(I*U)^2 ; I = 0.1 + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform $kInlet; + +boundaryField +{ + inlet + { + type fixedValue; + value uniform $kInlet; + } + + outlet + { + type inletOutlet; + inletValue uniform $kInlet; + value uniform $kInlet; + } + + wall + { + type kqRWallFunction; + value uniform $kInlet; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/simpleFoam/windAroundBuildings/0/nut b/tutorials/incompressible/simpleFoam/windAroundBuildings/0/nut new file mode 100644 index 0000000000..54a56f319f --- /dev/null +++ b/tutorials/incompressible/simpleFoam/windAroundBuildings/0/nut @@ -0,0 +1,44 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ 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 + { + type calculated; + value uniform 0; + } + + outlet + { + type calculated; + value uniform 0; + } + + wall + { + type nutkWallFunction; + value uniform 0; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/simpleFoam/windAroundBuildings/0/p b/tutorials/incompressible/simpleFoam/windAroundBuildings/0/p new file mode 100644 index 0000000000..3bca06ea5a --- /dev/null +++ b/tutorials/incompressible/simpleFoam/windAroundBuildings/0/p @@ -0,0 +1,44 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ 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 + { + type zeroGradient; + } + + outlet + { + type totalPressure; + p0 uniform 0; + gamma 1.4; + value uniform 0; + } + + wall + { + type zeroGradient; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/simpleFoam/windAroundBuildings/Allclean b/tutorials/incompressible/simpleFoam/windAroundBuildings/Allclean new file mode 100755 index 0000000000..3427112d73 --- /dev/null +++ b/tutorials/incompressible/simpleFoam/windAroundBuildings/Allclean @@ -0,0 +1,13 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + +# Source tutorial clean functions +. $WM_PROJECT_DIR/bin/tools/CleanFunctions + +cleanCase + +rm -rf constant/extendedFeatureEdgeMesh > /dev/null 2>&1 +rm -f constant/triSurface/buildings.eMesh > /dev/null 2>&1 +rm -f constant/polyMesh/boundary > /dev/null 2>&1 + +# ----------------------------------------------------------------- end-of-file diff --git a/tutorials/incompressible/simpleFoam/windAroundBuildings/Allrun b/tutorials/incompressible/simpleFoam/windAroundBuildings/Allrun new file mode 100755 index 0000000000..1e6e2f7318 --- /dev/null +++ b/tutorials/incompressible/simpleFoam/windAroundBuildings/Allrun @@ -0,0 +1,14 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +runApplication surfaceFeatureExtract + +runApplication blockMesh +runApplication snappyHexMesh -overwrite + +runApplication $(getApplication) + +# ----------------------------------------------------------------- end-of-file diff --git a/tutorials/incompressible/simpleFoam/windAroundBuildings/constant/transportProperties b/tutorials/incompressible/simpleFoam/windAroundBuildings/constant/transportProperties new file mode 100644 index 0000000000..5911012330 --- /dev/null +++ b/tutorials/incompressible/simpleFoam/windAroundBuildings/constant/transportProperties @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object transportProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +transportModel Newtonian; + +nu nu [ 0 2 -1 0 0 0 0 ] 1.5e-05; + +// ************************************************************************* // diff --git a/tutorials/incompressible/simpleFoam/windAroundBuildings/constant/triSurface/buildings.obj.gz b/tutorials/incompressible/simpleFoam/windAroundBuildings/constant/triSurface/buildings.obj.gz new file mode 100644 index 0000000000..5a83ee5faf Binary files /dev/null and b/tutorials/incompressible/simpleFoam/windAroundBuildings/constant/triSurface/buildings.obj.gz differ diff --git a/tutorials/incompressible/simpleFoam/windAroundBuildings/constant/turbulenceProperties b/tutorials/incompressible/simpleFoam/windAroundBuildings/constant/turbulenceProperties new file mode 100644 index 0000000000..c4d5b2e351 --- /dev/null +++ b/tutorials/incompressible/simpleFoam/windAroundBuildings/constant/turbulenceProperties @@ -0,0 +1,28 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object RASProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RAS; + +RAS +{ + RASModel kEpsilon; + + turbulence on; + + printCoeffs on; +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/simpleFoam/windAroundBuildings/system/blockMeshDict b/tutorials/incompressible/simpleFoam/windAroundBuildings/system/blockMeshDict new file mode 100644 index 0000000000..91ae59260b --- /dev/null +++ b/tutorials/incompressible/simpleFoam/windAroundBuildings/system/blockMeshDict @@ -0,0 +1,106 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +backgroundMesh +{ + xMin -20; // L = 350 + xMax 330; + yMin -50; // L = 280 + yMax 230; + zMin 0; + zMax 140; + xCells 25; + yCells 20; + zCells 10; +} + +convertToMeters 1; + +vertices +( + ($:backgroundMesh.xMin $:backgroundMesh.yMin $:backgroundMesh.zMin) + ($:backgroundMesh.xMax $:backgroundMesh.yMin $:backgroundMesh.zMin) + ($:backgroundMesh.xMax $:backgroundMesh.yMax $:backgroundMesh.zMin) + ($:backgroundMesh.xMin $:backgroundMesh.yMax $:backgroundMesh.zMin) + + ($:backgroundMesh.xMin $:backgroundMesh.yMin $:backgroundMesh.zMax) + ($:backgroundMesh.xMax $:backgroundMesh.yMin $:backgroundMesh.zMax) + ($:backgroundMesh.xMax $:backgroundMesh.yMax $:backgroundMesh.zMax) + ($:backgroundMesh.xMin $:backgroundMesh.yMax $:backgroundMesh.zMax) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) + ( + $:backgroundMesh.xCells + $:backgroundMesh.yCells + $:backgroundMesh.zCells + ) + simpleGrading (1 1 1) +); + +edges +( +); + +boundary +( + inlet + { + type patch; + faces + ( + (0 3 7 4) + ); + } + + outlet + { + type patch; + faces + ( + (1 5 6 2) + ); + } + + ground + { + type wall; + faces + ( + (0 1 2 3) + ); + } + + frontAndBack + { + type symmetry; + faces + ( + (0 4 5 1) + (3 2 6 7) + (4 7 6 5) + ); + } + +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/incompressible/simpleFoam/windAroundBuildings/system/controlDict b/tutorials/incompressible/simpleFoam/windAroundBuildings/system/controlDict new file mode 100644 index 0000000000..e34ff9f922 --- /dev/null +++ b/tutorials/incompressible/simpleFoam/windAroundBuildings/system/controlDict @@ -0,0 +1,55 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application simpleFoam; + +startFrom latestTime; + +startTime 0; + +stopAt endTime; + +endTime 400; + +deltaT 1; + +writeControl timeStep; + +writeInterval 50; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable true; + +// adjustTimeStep yes; + +// maxCo 1; + +functions +{ +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/simpleFoam/windAroundBuildings/system/fvSchemes b/tutorials/incompressible/simpleFoam/windAroundBuildings/system/fvSchemes new file mode 100644 index 0000000000..3a3dd154a4 --- /dev/null +++ b/tutorials/incompressible/simpleFoam/windAroundBuildings/system/fvSchemes @@ -0,0 +1,71 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default steadyState; +} + +gradSchemes +{ + default Gauss linear; + + limited cellLimited Gauss linear 1; + grad(U) $limited; + grad(k) $limited; + grad(epsilon) $limited; +} + +divSchemes +{ + default none; + + div(phi,U) bounded Gauss linearUpwind limited; + + turbulence bounded Gauss limitedLinear 1; + div(phi,k) $turbulence; + div(phi,epsilon) $turbulence; + + div((nuEff*dev2(T(grad(U))))) Gauss linear; +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + +fluxRequired +{ + default no; + p ; +} + +wallDist +{ + method meshWave; +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/simpleFoam/windAroundBuildings/system/fvSolution b/tutorials/incompressible/simpleFoam/windAroundBuildings/system/fvSolution new file mode 100644 index 0000000000..bdb34dd0f4 --- /dev/null +++ b/tutorials/incompressible/simpleFoam/windAroundBuildings/system/fvSolution @@ -0,0 +1,72 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + p + { + solver GAMG; + smoother GaussSeidel; + cacheAgglomeration on; + agglomerator faceAreaPair; + nCellsInCoarsestLevel 10; + mergeLevels 1; + tolerance 1e-6; + relTol 0.1; + } + + "(U|k|omega|epsilon)" + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-6; + relTol 0.1; + } +} + +SIMPLE +{ + residualControl + { + p 1e-4; + U 1e-4; + "(k|omega|epsilon)" 1e-4; + } + nNonOrthogonalCorrectors 0; + pRefCell 0; + pRefValue 0; + +} + +potentialFlow +{ + nNonOrthogonalCorrectors 10; +} + +relaxationFactors +{ + fields + { + p 0.3; + } + equations + { + U 0.7; + "(k|omega|epsilon).*" 0.7; + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/simpleFoam/windAroundBuildings/system/meshQualityDict b/tutorials/incompressible/simpleFoam/windAroundBuildings/system/meshQualityDict new file mode 100644 index 0000000000..c38396d710 --- /dev/null +++ b/tutorials/incompressible/simpleFoam/windAroundBuildings/system/meshQualityDict @@ -0,0 +1,22 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object meshQualityDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#includeEtc "caseDicts/mesh/generation/meshQualityDict.cfg" + +//- minFaceWeight (0 -> 0.5) +//minFaceWeight 0.02; + +// ************************************************************************* // diff --git a/tutorials/incompressible/simpleFoam/windAroundBuildings/system/snappyHexMeshDict b/tutorials/incompressible/simpleFoam/windAroundBuildings/system/snappyHexMeshDict new file mode 100644 index 0000000000..fed73f13c1 --- /dev/null +++ b/tutorials/incompressible/simpleFoam/windAroundBuildings/system/snappyHexMeshDict @@ -0,0 +1,102 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object snappyHexMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#includeEtc "caseDicts/mesh/generation/snappyHexMeshDict.cfg" + +castellatedMesh on; +snap on; +addLayers off; + +geometry +{ + buildings.obj + { + type triSurfaceMesh; + name buildings; + } + + refinementBox + { + type searchableBox; + min ( 0 0 0); + max (250 180 90); + } +}; + +castellatedMeshControls +{ + features + ( + { file "buildings.eMesh"; level 1; } + ); + + refinementSurfaces + { + buildings + { + level (3 3); + patchInfo { type wall; } + } + } + + refinementRegions + { + refinementBox + { + mode inside; + levels ((1E15 2)); + } + } + + locationInMesh (1 1 1); +} + +snapControls +{ + explicitFeatureSnap true; + implicitFeatureSnap false; +} + +addLayersControls +{ + layers + { + "CAD.*" + { + nSurfaceLayers 2; + } + } + + relativeSizes true; + expansionRatio 1.2; + finalLayerThickness 0.5; + minThickness 1e-3; +} + +meshQualityControls +{ +} + +writeFlags +( + scalarLevels + layerSets + layerFields +); + +mergeTolerance 1e-6; + +// ************************************************************************* // diff --git a/tutorials/incompressible/simpleFoam/windAroundBuildings/system/surfaceFeatureExtractDict b/tutorials/incompressible/simpleFoam/windAroundBuildings/system/surfaceFeatureExtractDict new file mode 100644 index 0000000000..10a7645af2 --- /dev/null +++ b/tutorials/incompressible/simpleFoam/windAroundBuildings/system/surfaceFeatureExtractDict @@ -0,0 +1,22 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object surfaceFeatureExtractDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +buildings.obj +{ + #includeEtc "caseDicts/surface/surfaceFeatureExtractDict.cfg" +} + +// ************************************************************************* //