diff --git a/tests/cfd/README.md b/tests/cfd/README.md index a3b452bb..c139a4a3 100644 --- a/tests/cfd/README.md +++ b/tests/cfd/README.md @@ -1,9 +1,17 @@ -# OpenFOAM testcase - -- Lid driven cavity -- openfoam.com, OpenFOAM2312 +# OpenFOAM testcases +Testcases are related to +- openfoam.com +- tested with openFOAM2312 +## Lid driven cavity Commands: - blockMesh -- icoFoam \ No newline at end of file +- icoFoam + +## Motorbike +Commands: +- Allrun + + + diff --git a/tests/cfd/0/U b/tests/cfd/example_cavity/0/U similarity index 100% rename from tests/cfd/0/U rename to tests/cfd/example_cavity/0/U diff --git a/tests/cfd/0/p b/tests/cfd/example_cavity/0/p similarity index 100% rename from tests/cfd/0/p rename to tests/cfd/example_cavity/0/p diff --git a/tests/cfd/example_cavity/README.md b/tests/cfd/example_cavity/README.md new file mode 100644 index 00000000..f1cc8c2f --- /dev/null +++ b/tests/cfd/example_cavity/README.md @@ -0,0 +1,9 @@ +# OpenFOAM testcase + +- Lid driven cavity +- openfoam.com, tested with openFOAM2312 + + +Commands: +- blockMesh +- icoFoam \ No newline at end of file diff --git a/tests/cfd/constant/transportProperties b/tests/cfd/example_cavity/constant/transportProperties similarity index 100% rename from tests/cfd/constant/transportProperties rename to tests/cfd/example_cavity/constant/transportProperties diff --git a/tests/cfd/system/PDRblockMeshDict b/tests/cfd/example_cavity/system/PDRblockMeshDict similarity index 100% rename from tests/cfd/system/PDRblockMeshDict rename to tests/cfd/example_cavity/system/PDRblockMeshDict diff --git a/tests/cfd/system/blockMeshDict b/tests/cfd/example_cavity/system/blockMeshDict similarity index 100% rename from tests/cfd/system/blockMeshDict rename to tests/cfd/example_cavity/system/blockMeshDict diff --git a/tests/cfd/system/controlDict b/tests/cfd/example_cavity/system/controlDict similarity index 100% rename from tests/cfd/system/controlDict rename to tests/cfd/example_cavity/system/controlDict diff --git a/tests/cfd/system/decomposeParDict b/tests/cfd/example_cavity/system/decomposeParDict similarity index 100% rename from tests/cfd/system/decomposeParDict rename to tests/cfd/example_cavity/system/decomposeParDict diff --git a/tests/cfd/system/fvSchemes b/tests/cfd/example_cavity/system/fvSchemes similarity index 100% rename from tests/cfd/system/fvSchemes rename to tests/cfd/example_cavity/system/fvSchemes diff --git a/tests/cfd/system/fvSolution b/tests/cfd/example_cavity/system/fvSolution similarity index 100% rename from tests/cfd/system/fvSolution rename to tests/cfd/example_cavity/system/fvSolution diff --git a/tests/cfd/example_motorbike/0.orig/U b/tests/cfd/example_motorbike/0.orig/U new file mode 100644 index 00000000..18723231 --- /dev/null +++ b/tests/cfd/example_motorbike/0.orig/U @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2312 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "include/initialConditions" + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform $flowVelocity; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + #include "include/fixedInlet" + + outlet + { + type inletOutlet; + inletValue uniform (0 0 0); + value $internalField; + } + + lowerWall + { + type fixedValue; + value $internalField; + } + + motorBikeGroup + { + type noSlip; + } + + #include "include/frontBackUpperPatches" +} + + +// ************************************************************************* // diff --git a/tests/cfd/example_motorbike/0.orig/include/fixedInlet b/tests/cfd/example_motorbike/0.orig/include/fixedInlet new file mode 100644 index 00000000..4c91f75f --- /dev/null +++ b/tests/cfd/example_motorbike/0.orig/include/fixedInlet @@ -0,0 +1,15 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2312 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +inlet +{ + type fixedValue; + value $internalField; +} + +// ************************************************************************* // diff --git a/tests/cfd/example_motorbike/0.orig/include/frontBackUpperPatches b/tests/cfd/example_motorbike/0.orig/include/frontBackUpperPatches new file mode 100644 index 00000000..19b3e235 --- /dev/null +++ b/tests/cfd/example_motorbike/0.orig/include/frontBackUpperPatches @@ -0,0 +1,19 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2312 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +upperWall +{ + type slip; +} + +frontAndBack +{ + type slip; +} + +// ************************************************************************* // diff --git a/tests/cfd/example_motorbike/0.orig/include/initialConditions b/tests/cfd/example_motorbike/0.orig/include/initialConditions new file mode 100644 index 00000000..1688de8b --- /dev/null +++ b/tests/cfd/example_motorbike/0.orig/include/initialConditions @@ -0,0 +1,14 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2312 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +flowVelocity (20 0 0); +pressure 0; +turbulentKE 0.24; +turbulentOmega 1.78; + +// ************************************************************************* // diff --git a/tests/cfd/example_motorbike/0.orig/k b/tests/cfd/example_motorbike/0.orig/k new file mode 100644 index 00000000..214d6603 --- /dev/null +++ b/tests/cfd/example_motorbike/0.orig/k @@ -0,0 +1,53 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2312 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object k; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "include/initialConditions" + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform $turbulentKE; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + //- Define inlet conditions + #include "include/fixedInlet" + + outlet + { + type inletOutlet; + inletValue $internalField; + value $internalField; + } + + lowerWall + { + type kqRWallFunction; + value $internalField; + } + + motorBikeGroup + { + type kqRWallFunction; + value $internalField; + } + + #include "include/frontBackUpperPatches" +} + + +// ************************************************************************* // diff --git a/tests/cfd/example_motorbike/0.orig/nut b/tests/cfd/example_motorbike/0.orig/nut new file mode 100644 index 00000000..e9516bd5 --- /dev/null +++ b/tests/cfd/example_motorbike/0.orig/nut @@ -0,0 +1,63 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2312 | +| \\ / A nd | Website: 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" + + frontAndBack + { + type calculated; + value uniform 0; + } + + inlet + { + type calculated; + value uniform 0; + } + + outlet + { + type calculated; + value uniform 0; + } + + lowerWall + { + type nutkWallFunction; + value uniform 0; + } + + upperWall + { + type calculated; + value uniform 0; + } + + motorBikeGroup + { + type nutkWallFunction; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tests/cfd/example_motorbike/0.orig/omega b/tests/cfd/example_motorbike/0.orig/omega new file mode 100644 index 00000000..135a6bd2 --- /dev/null +++ b/tests/cfd/example_motorbike/0.orig/omega @@ -0,0 +1,52 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2312 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object omega; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "include/initialConditions" + +dimensions [0 0 -1 0 0 0 0]; + +internalField uniform $turbulentOmega; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + #include "include/fixedInlet" + + outlet + { + type inletOutlet; + inletValue $internalField; + value $internalField; + } + + lowerWall + { + type omegaWallFunction; + value $internalField; + } + + motorBikeGroup + { + type omegaWallFunction; + value $internalField; + } + + #include "include/frontBackUpperPatches" +} + + +// ************************************************************************* // diff --git a/tests/cfd/example_motorbike/0.orig/p b/tests/cfd/example_motorbike/0.orig/p new file mode 100644 index 00000000..fdf95910 --- /dev/null +++ b/tests/cfd/example_motorbike/0.orig/p @@ -0,0 +1,52 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2312 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "include/initialConditions" + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform $pressure; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + inlet + { + type zeroGradient; + } + + outlet + { + type fixedValue; + value $internalField; + } + + lowerWall + { + type zeroGradient; + } + + motorBikeGroup + { + type zeroGradient; + } + + #include "include/frontBackUpperPatches" +} + + +// ************************************************************************* // diff --git a/tests/cfd/example_motorbike/Allclean b/tests/cfd/example_motorbike/Allclean new file mode 100644 index 00000000..21a3ef14 --- /dev/null +++ b/tests/cfd/example_motorbike/Allclean @@ -0,0 +1,12 @@ +#!/bin/sh +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions +#------------------------------------------------------------------------------ + +cleanCase0 + +# Remove surface and features +rm -rf constant/triSurface +rm -rf constant/extendedFeatureEdgeMesh + +#------------------------------------------------------------------------------ diff --git a/tests/cfd/example_motorbike/Allrun b/tests/cfd/example_motorbike/Allrun new file mode 100644 index 00000000..c958df49 --- /dev/null +++ b/tests/cfd/example_motorbike/Allrun @@ -0,0 +1,54 @@ +#!/bin/sh +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions +#------------------------------------------------------------------------------ + +# Alternative decomposeParDict name: +decompDict="-decomposeParDict system/decomposeParDict.6" +## Standard decomposeParDict name: +# unset decompDict + +# copy motorbike surface from resources directory +mkdir -p constant/triSurface + +cp -f \ + "$FOAM_TUTORIALS"/resources/geometry/motorBike.obj.gz \ + constant/triSurface/ + +runApplication surfaceFeatureExtract + +runApplication blockMesh + +runApplication $decompDict decomposePar + +# Using distributedTriSurfaceMesh? +if foamDictionary -entry geometry -value system/snappyHexMeshDict | \ + grep -q distributedTriSurfaceMesh +then + echo "surfaceRedistributePar does not need to be run anymore" + echo " - distributedTriSurfaceMesh will do on-the-fly redistribution" +fi + +runParallel $decompDict snappyHexMesh -overwrite + +runParallel $decompDict topoSet + +#- For non-parallel running: - set the initial fields +# restore0Dir + +#- For parallel running: set the initial fields +restore0Dir -processor + +runParallel $decompDict patchSummary + +runParallel $decompDict potentialFoam -writephi + +runParallel $decompDict checkMesh -writeFields '(nonOrthoAngle)' -constant + +runParallel $decompDict $(getApplication) + +runApplication reconstructParMesh -constant + +runApplication reconstructPar -latestTime + +#------------------------------------------------------------------------------ diff --git a/tests/cfd/example_motorbike/README.md b/tests/cfd/example_motorbike/README.md new file mode 100644 index 00000000..900cf474 --- /dev/null +++ b/tests/cfd/example_motorbike/README.md @@ -0,0 +1,13 @@ +# OpenFOAM testcase Motorbike + +## Source +https://develop.openfoam.com/Development/openfoam/-/tree/master/tutorials/incompressible/simpleFoam/motorBike + +## OpenFOAM distribution and version: +- openfoam.com +- tested with openFOAM2312 + + +## Commands: +- blockMesh +- icoFoam \ No newline at end of file diff --git a/tests/cfd/example_motorbike/constant/transportProperties b/tests/cfd/example_motorbike/constant/transportProperties new file mode 100644 index 00000000..2f49eea5 --- /dev/null +++ b/tests/cfd/example_motorbike/constant/transportProperties @@ -0,0 +1,22 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2312 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object transportProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +transportModel Newtonian; + +nu 1.5e-05; + + +// ************************************************************************* // diff --git a/tests/cfd/example_motorbike/constant/turbulenceProperties b/tests/cfd/example_motorbike/constant/turbulenceProperties new file mode 100644 index 00000000..e5d396e2 --- /dev/null +++ b/tests/cfd/example_motorbike/constant/turbulenceProperties @@ -0,0 +1,29 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2312 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RAS; + +RAS +{ + RASModel kOmegaSST; + + turbulence on; + + printCoeffs on; +} + + +// ************************************************************************* // diff --git a/tests/cfd/example_motorbike/openfoam-master-tutorials-incompressible-simpleFoam-motorBike.zip b/tests/cfd/example_motorbike/openfoam-master-tutorials-incompressible-simpleFoam-motorBike.zip new file mode 100644 index 00000000..bfaf46e7 Binary files /dev/null and b/tests/cfd/example_motorbike/openfoam-master-tutorials-incompressible-simpleFoam-motorBike.zip differ diff --git a/tests/cfd/example_motorbike/system/blockMeshDict b/tests/cfd/example_motorbike/system/blockMeshDict new file mode 100644 index 00000000..f9ac7e9e --- /dev/null +++ b/tests/cfd/example_motorbike/system/blockMeshDict @@ -0,0 +1,86 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2312 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +scale 1; + +vertices +( + (-5 -4 0) + (15 -4 0) + (15 4 0) + (-5 4 0) + (-5 -4 8) + (15 -4 8) + (15 4 8) + (-5 4 8) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (20 8 8) simpleGrading (1 1 1) +); + +edges +( +); + +boundary +( + frontAndBack + { + type patch; + faces + ( + (3 7 6 2) + (1 5 4 0) + ); + } + inlet + { + type patch; + faces + ( + (0 4 7 3) + ); + } + outlet + { + type patch; + faces + ( + (2 6 5 1) + ); + } + lowerWall + { + type wall; + faces + ( + (0 3 2 1) + ); + } + upperWall + { + type patch; + faces + ( + (4 5 6 7) + ); + } +); + + +// ************************************************************************* // diff --git a/tests/cfd/example_motorbike/system/controlDict b/tests/cfd/example_motorbike/system/controlDict new file mode 100644 index 00000000..becc0bc0 --- /dev/null +++ b/tests/cfd/example_motorbike/system/controlDict @@ -0,0 +1,57 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2312 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application simpleFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 500; + +deltaT 1; + +writeControl timeStep; + +writeInterval 100; + +purgeWrite 0; + +writeFormat binary; + +writePrecision 6; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable true; + +functions +{ + #include "streamLines" + #include "wallBoundedStreamLines" + #include "cuttingPlane" + #include "forceCoeffs" + #include "ensightWrite" +} + + +// ************************************************************************* // diff --git a/tests/cfd/example_motorbike/system/cuttingPlane b/tests/cfd/example_motorbike/system/cuttingPlane new file mode 100644 index 00000000..4cc6f0ca --- /dev/null +++ b/tests/cfd/example_motorbike/system/cuttingPlane @@ -0,0 +1,33 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2312 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +cuttingPlane +{ + type surfaces; + libs (sampling); + writeControl writeTime; + + surfaceFormat vtk; + fields ( p U ); + + interpolationScheme cellPoint; + + surfaces + { + yNormal + { + type cuttingPlane; + point (0 0 0); + normal (0 1 0); + interpolate true; + } + } +} + + +// ************************************************************************* // diff --git a/tests/cfd/example_motorbike/system/decomposeParDict-random b/tests/cfd/example_motorbike/system/decomposeParDict-random new file mode 100644 index 00000000..47b9de2e --- /dev/null +++ b/tests/cfd/example_motorbike/system/decomposeParDict-random @@ -0,0 +1,22 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2312 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object decomposeParDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 3; + +method random; + + +// ************************************************************************* // diff --git a/tests/cfd/example_motorbike/system/decomposeParDict.6 b/tests/cfd/example_motorbike/system/decomposeParDict.6 new file mode 100644 index 00000000..dbee1d4f --- /dev/null +++ b/tests/cfd/example_motorbike/system/decomposeParDict.6 @@ -0,0 +1,27 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2312 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object decomposeParDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 6; + +method hierarchical; + +coeffs +{ + n (3 2 1); +} + + +// ************************************************************************* // diff --git a/tests/cfd/example_motorbike/system/ensightWrite b/tests/cfd/example_motorbike/system/ensightWrite new file mode 100644 index 00000000..0842906f --- /dev/null +++ b/tests/cfd/example_motorbike/system/ensightWrite @@ -0,0 +1,23 @@ +// -*- C++ -*- +// Minimal example of using the ensight write function object. +// Many more options possible +ensightWrite +{ + type ensightWrite; + libs (utilityFunctionObjects); + log true; + + // Fields to output (words or regex) + fields (U p "(k|epsilon|omega)"); + + writeControl writeTime; + writeInterval 1; + + //patches ( "motorBike.*" ); + + //- These patches are uninteresting + excludePatches ( inlet outlet frontAndBack ".*[Ww]all" ); +} + + +// ************************************************************************* // diff --git a/tests/cfd/example_motorbike/system/faMeshDefinition b/tests/cfd/example_motorbike/system/faMeshDefinition new file mode 100644 index 00000000..c2014342 --- /dev/null +++ b/tests/cfd/example_motorbike/system/faMeshDefinition @@ -0,0 +1,30 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2312 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object faMeshDefinition; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +polyMeshPatches (motorBikeGroup); + +boundary +{ + bottom + { + type patch; + // ownerPolyPatch motorBikeGroup; + neighbourPolyPatch lowerWall; + } +} + + +// ************************************************************************** // diff --git a/tests/cfd/example_motorbike/system/faSchemes b/tests/cfd/example_motorbike/system/faSchemes new file mode 100644 index 00000000..9f139ad9 --- /dev/null +++ b/tests/cfd/example_motorbike/system/faSchemes @@ -0,0 +1,32 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2312 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object faSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes {} + +gradSchemes {} + +divSchemes {} + +laplacianSchemes {} + +interpolationSchemes {} + +lnGradSchemes {} + +fluxRequired {} + + +// ************************************************************************* // diff --git a/tests/cfd/example_motorbike/system/faSolution b/tests/cfd/example_motorbike/system/faSolution new file mode 100644 index 00000000..cccd624c --- /dev/null +++ b/tests/cfd/example_motorbike/system/faSolution @@ -0,0 +1,19 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2312 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object faSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers {} + +// ************************************************************************* // diff --git a/tests/cfd/example_motorbike/system/forceCoeffs b/tests/cfd/example_motorbike/system/forceCoeffs new file mode 100644 index 00000000..0dc666a1 --- /dev/null +++ b/tests/cfd/example_motorbike/system/forceCoeffs @@ -0,0 +1,54 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2312 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +forceCoeffs1 +{ + type forceCoeffs; + + libs (forces); + + writeControl timeStep; + timeInterval 1; + + log yes; + + patches (motorBikeGroup); + rho rhoInf; // Indicates incompressible + rhoInf 1; // Required when rho = rhoInf + liftDir (0 0 1); + dragDir (1 0 0); + CofR (0.72 0 0); // Axle midpoint on ground + pitchAxis (0 1 0); + magUInf 20; + lRef 1.42; // Wheelbase length + Aref 0.75; // Estimated +} + +/* +binField1 +{ + type binField; + libs (fieldFunctionObjects); + binModel singleDirectionUniformBin; + fields (forceCoeff); + patches (motorBikeGroup); + decomposePatchValues true; + CofR ${../forceCoeffs1/CofR}; + + binData + { + nBin 20; // output data into 20 bins + direction (1 0 0); // bin direction + cumulative yes; + } + writeControl timeStep; +} +*/ + + +// ************************************************************************* // diff --git a/tests/cfd/example_motorbike/system/fvSchemes b/tests/cfd/example_motorbike/system/fvSchemes new file mode 100644 index 00000000..00ddba31 --- /dev/null +++ b/tests/cfd/example_motorbike/system/fvSchemes @@ -0,0 +1,62 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2312 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default steadyState; +} + +gradSchemes +{ + default Gauss linear; + grad(U) cellLimited Gauss linear 1; +} + +divSchemes +{ + default none; + + div(phi,U) bounded Gauss linearUpwindV grad(U); + + turbulence bounded Gauss upwind; + div(phi,k) $turbulence; + div(phi,omega) $turbulence; + + 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/tests/cfd/example_motorbike/system/fvSolution b/tests/cfd/example_motorbike/system/fvSolution new file mode 100644 index 00000000..7b4f8358 --- /dev/null +++ b/tests/cfd/example_motorbike/system/fvSolution @@ -0,0 +1,87 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2312 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + p + { + solver GAMG; + smoother GaussSeidel; + tolerance 1e-7; + relTol 0.01; + } + + Phi + { + $p; + } + + U + { + solver smoothSolver; + smoother GaussSeidel; + tolerance 1e-8; + relTol 0.1; + nSweeps 1; + } + + k + { + solver smoothSolver; + smoother GaussSeidel; + tolerance 1e-8; + relTol 0.1; + nSweeps 1; + } + + omega + { + solver smoothSolver; + smoother GaussSeidel; + tolerance 1e-8; + relTol 0.1; + nSweeps 1; + } +} + +SIMPLE +{ + nNonOrthogonalCorrectors 0; + consistent yes; +} + +potentialFlow +{ + nNonOrthogonalCorrectors 10; +} + +relaxationFactors +{ + equations + { + U 0.9; + k 0.7; + omega 0.7; + } +} + +cache +{ + grad(U); +} + + +// ************************************************************************* // diff --git a/tests/cfd/example_motorbike/system/meshQualityDict b/tests/cfd/example_motorbike/system/meshQualityDict new file mode 100644 index 00000000..e35092c9 --- /dev/null +++ b/tests/cfd/example_motorbike/system/meshQualityDict @@ -0,0 +1,24 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2312 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object meshQualityDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +// Include defaults parameters from master dictionary +#includeEtc "caseDicts/meshQualityDict" + +//- minFaceWeight (0 -> 0.5) +minFaceWeight 0.02; + + +// ************************************************************************* // diff --git a/tests/cfd/example_motorbike/system/profiling b/tests/cfd/example_motorbike/system/profiling new file mode 100644 index 00000000..b762c1cd --- /dev/null +++ b/tests/cfd/example_motorbike/system/profiling @@ -0,0 +1,9 @@ +// -*- C++ -*- + +profiling +{ + #includeEtc "caseDicts/profiling/parallel.cfg" + detail 1; +} + +// ************************************************************************* // diff --git a/tests/cfd/example_motorbike/system/snappyHexMeshDict b/tests/cfd/example_motorbike/system/snappyHexMeshDict new file mode 100644 index 00000000..89ccaf08 --- /dev/null +++ b/tests/cfd/example_motorbike/system/snappyHexMeshDict @@ -0,0 +1,326 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2312 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object snappyHexMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +// Which of the steps to run +castellatedMesh true; +snap true; +addLayers true; + + +// Geometry. Definition of all surfaces. All surfaces are of class +// searchableSurface. +// Surfaces are used +// - to specify refinement for any mesh cell intersecting it +// - to specify refinement for any mesh cell inside/outside/near +// - to 'snap' the mesh boundary to the surface +geometry +{ + motorBike.obj + { + type triSurfaceMesh; + name motorBike; + } + + refinementBox + { + type box; + min (-1.0 -0.7 0.0); + max ( 8.0 0.7 2.5); + } +} + + +// Settings for the castellatedMesh generation. +castellatedMeshControls +{ + + // Refinement parameters + // ~~~~~~~~~~~~~~~~~~~~~ + + // If local number of cells is >= maxLocalCells on any processor + // switches from from refinement followed by balancing + // (current method) to (weighted) balancing before refinement. + maxLocalCells 100000; + + // Overall cell limit (approximately). Refinement will stop immediately + // upon reaching this number so a refinement level might not complete. + // Note that this is the number of cells before removing the part which + // is not 'visible' from the keepPoint. The final number of cells might + // actually be a lot less. + maxGlobalCells 2000000; + + // The surface refinement loop might spend lots of iterations refining just a + // few cells. This setting will cause refinement to stop if <= minimumRefine + // are selected for refinement. Note: it will at least do one iteration + // (unless the number of cells to refine is 0) + minRefinementCells 10; + + // Allow a certain level of imbalance during refining + // (since balancing is quite expensive) + // Expressed as fraction of perfect balance (= overall number of cells / + // nProcs). 0=balance always. + maxLoadUnbalance 0.10; + + + // Number of buffer layers between different levels. + // 1 means normal 2:1 refinement restriction, larger means slower + // refinement. + nCellsBetweenLevels 3; + + + + // Explicit feature edge refinement + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + // Specifies a level for any cell intersected by its edges. + // This is a featureEdgeMesh, read from constant/triSurface for now. + features + ( + { + file "motorBike.eMesh"; + level 6; + } + ); + + + + // Surface based refinement + // ~~~~~~~~~~~~~~~~~~~~~~~~ + + // Specifies two levels for every surface. The first is the minimum level, + // every cell intersecting a surface gets refined up to the minimum level. + // The second level is the maximum level. Cells that 'see' multiple + // intersections where the intersections make an + // angle > resolveFeatureAngle get refined up to the maximum level. + + refinementSurfaces + { + motorBike + { + // Surface-wise min and max refinement level + level (5 6); + + // Optional specification of patch type (default is wall). No + // constraint types (cyclic, symmetry) etc. are allowed. + patchInfo + { + type wall; + inGroups (motorBikeGroup); + } + } + } + + // Resolve sharp angles + resolveFeatureAngle 30; + + + // Region-wise refinement + // ~~~~~~~~~~~~~~~~~~~~~~ + + // Specifies refinement level for cells in relation to a surface. One of + // three modes + // - distance. 'levels' specifies per distance to the surface the + // wanted refinement level. The distances need to be specified in + // descending order. + // - inside. 'levels' is only one entry and only the level is used. All + // cells inside the surface get refined up to the level. The surface + // needs to be closed for this to be possible. + // - outside. Same but cells outside. + + refinementRegions + { + refinementBox + { + mode inside; + levels ((1E15 4)); + } + } + + + // Mesh selection + // ~~~~~~~~~~~~~~ + + // After refinement patches get added for all refinementSurfaces and + // all cells intersecting the surfaces get put into these patches. The + // section reachable from the locationInMesh is kept. + // NOTE: This point should never be on a face, always inside a cell, even + // after refinement. + locationInMesh (3.0001 3.0001 0.43); + + + // Whether any faceZones (as specified in the refinementSurfaces) + // are only on the boundary of corresponding cellZones or also allow + // free-standing zone faces. Not used if there are no faceZones. + allowFreeStandingZoneFaces true; +} + + + +// Settings for the snapping. +snapControls +{ + //- Number of patch smoothing iterations before finding correspondence + // to surface + nSmoothPatch 3; + + //- Relative distance for points to be attracted by surface feature point + // or edge. True distance is this factor times local + // maximum edge length. + tolerance 2.0; + + //- Number of mesh displacement relaxation iterations. + nSolveIter 30; + + //- Maximum number of snapping relaxation iterations. Should stop + // before upon reaching a correct mesh. + nRelaxIter 5; + + // Feature snapping + + //- Number of feature edge snapping iterations. + // Leave out altogether to disable. + nFeatureSnapIter 10; + + //- Detect (geometric only) features by sampling the surface + // (default=false). + implicitFeatureSnap false; + + //- Use castellatedMeshControls::features (default = true) + explicitFeatureSnap true; + + //- Detect points on multiple surfaces (only for explicitFeatureSnap) + multiRegionFeatureSnap false; +} + + + +// Settings for the layer addition. +addLayersControls +{ + // Are the thickness parameters below relative to the undistorted + // size of the refined cell outside layer (true) or absolute sizes (false). + relativeSizes true; + + // Per final patch (so not geometry!) the layer information + layers + { + "(lowerWall|motorBike).*" + { + nSurfaceLayers 1; + } + } + + // Expansion factor for layer mesh + expansionRatio 1.0; + + // Wanted thickness of final added cell layer. If multiple layers + // is the thickness of the layer furthest away from the wall. + // Relative to undistorted size of cell outside layer. + // See relativeSizes parameter. + finalLayerThickness 0.3; + + // Minimum thickness of cell layer. If for any reason layer + // cannot be above minThickness do not add layer. + // Relative to undistorted size of cell outside layer. + minThickness 0.1; + + // If points get not extruded do nGrow layers of connected faces that are + // also not grown. This helps convergence of the layer addition process + // close to features. + // Note: changed(corrected) w.r.t 1.7.x! (didn't do anything in 1.7.x) + nGrow 0; + + // Advanced settings + + // When not to extrude surface. 0 is flat surface, 90 is when two faces + // are perpendicular + featureAngle 60; + + // At non-patched sides allow mesh to slip if extrusion direction makes + // angle larger than slipFeatureAngle. + slipFeatureAngle 30; + + // Maximum number of snapping relaxation iterations. Should stop + // before upon reaching a correct mesh. + nRelaxIter 3; + + // Number of smoothing iterations of surface normals + nSmoothSurfaceNormals 1; + + // Number of smoothing iterations of interior mesh movement direction + nSmoothNormals 3; + + // Smooth layer thickness over surface patches + nSmoothThickness 10; + + // Stop layer growth on highly warped cells + maxFaceThicknessRatio 0.5; + + // Reduce layer growth where ratio thickness to medial + // distance is large + maxThicknessToMedialRatio 0.3; + + // Angle used to pick up medial axis points + // Note: changed(corrected) w.r.t 1.7.x! 90 degrees corresponds to 130 + // in 1.7.x. + minMedialAxisAngle 90; + + + // Create buffer region for new layer terminations + nBufferCellsNoExtrude 0; + + + // Overall max number of layer addition iterations. The mesher will exit + // if it reaches this number of iterations; possibly with an illegal + // mesh. + nLayerIter 50; +} + + + +// Generic mesh quality settings. At any undoable phase these determine +// where to undo. +meshQualityControls +{ + #include "meshQualityDict" + + + // Advanced + + //- Number of error distribution iterations + nSmoothScale 4; + //- Amount to scale back displacement at error points + errorReduction 0.75; +} + + +// Advanced + +// Write flags +writeFlags +( + scalarLevels + layerSets + layerFields // write volScalarField for layer coverage +); + + +// Merge tolerance. Is fraction of overall bounding box of initial mesh. +// Note: the write tolerance needs to be higher than this. +mergeTolerance 1e-6; + + +// ************************************************************************* // diff --git a/tests/cfd/example_motorbike/system/streamLines b/tests/cfd/example_motorbike/system/streamLines new file mode 100644 index 00000000..13fd49f1 --- /dev/null +++ b/tests/cfd/example_motorbike/system/streamLines @@ -0,0 +1,55 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2312 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +streamLines +{ + type streamLine; + libs (fieldFunctionObjects); + + // Output every + writeControl writeTime; + // writeInterval 10; + + setFormat vtk; + + // Tracking direction (forward | backward | bidirectional) + direction forward; + + // Fields to sample + fields (p U k); + + // Steps particles can travel before being removed + lifeTime 10000; + + //- Specify either absolute length of steps (trackLength) or a number + // of subcycling steps per cell (nSubCycle) + + // Size of single track segment [m] + //trackLength 1e-3; + + // Number of steps per cell (estimate). Set to 1 to disable subcycling. + nSubCycle 5; + + // Cloud name to use + cloud particleTracks; + + // Seeding method. + seedSampleSet + { + type uniform; + axis x; //distance; + + // Note: tracks slightly offset so as not to be on a face + start (-1.001 -0.05 0.0011); + end (-1.001 -0.05 1.0011); + nPoints 20; + } +} + + +// ************************************************************************* // diff --git a/tests/cfd/example_motorbike/system/surfaceFeatureExtractDict b/tests/cfd/example_motorbike/system/surfaceFeatureExtractDict new file mode 100644 index 00000000..b6841c0d --- /dev/null +++ b/tests/cfd/example_motorbike/system/surfaceFeatureExtractDict @@ -0,0 +1,45 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2312 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object surfaceFeatureExtractDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +motorBike.obj +{ + // How to obtain raw features (extractFromFile || extractFromSurface) + extractionMethod extractFromSurface; + + // Mark edges whose adjacent surface normals are at an angle less + // than includedAngle as features + // - 0 : selects no edges + // - 180: selects all edges + includedAngle 150; + + subsetFeatures + { + // Keep nonManifold edges (edges with >2 connected faces) + nonManifoldEdges no; + + // Keep open edges (edges with 1 connected face) + openEdges yes; + } + + + // Write options + + // Write features to obj format for postprocessing + writeObj yes; +} + + +// ************************************************************************* // diff --git a/tests/cfd/example_motorbike/system/topoSetDict b/tests/cfd/example_motorbike/system/topoSetDict new file mode 100644 index 00000000..e4f4c4f8 --- /dev/null +++ b/tests/cfd/example_motorbike/system/topoSetDict @@ -0,0 +1,31 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2312 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object topoSetDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +actions +( + // For easier post-processing, and data-conversion tests + { + name inner; + type cellZoneSet; + action new; + source boxToCell; + min (-1 -0.5 0); + max ( 6 0.5 2); + } +); + + +// ************************************************************************* // diff --git a/tests/cfd/example_motorbike/system/wallBoundedStreamLines b/tests/cfd/example_motorbike/system/wallBoundedStreamLines new file mode 100644 index 00000000..99f69864 --- /dev/null +++ b/tests/cfd/example_motorbike/system/wallBoundedStreamLines @@ -0,0 +1,95 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2312 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +// Interpolate U to create near-wall UNear +near +{ + type nearWallFields; + libs (fieldFunctionObjects); + + // Output every + writeControl writeTime; + + // Calculate every + executeControl writeTime; + + // Fields to be sampled. Per field original name and mapped field to + // create. + // Note: fields only get updated when writing! + fields + ( + (U UNear) + ); + + // Patches/groups to sample (regular expressions) + patches (motorBikeGroup); + + // Distance to sample + distance 0.001; +} + + +// Use UNear to track along wall +wallBoundedStreamLines +{ + type wallBoundedStreamLine; + libs (fieldFunctionObjects); + + U UNear; // Velocity field for tracking + fields (p U k UNear); // Fields to sample + setFormat vtk; + direction forward; + lifeTime 100; // Steps particles can travel before being removed + cloud wallBoundedParticleTracks; + + seedSampleSet + { + type patchSeed; + + uniformCoeffs + { + axis x; //distance; + start (0.0035 0.0999 0.0001); + end (0.0035 0.0999 0.0099); + nPoints 20; + } + + cloudCoeffs + { + axis x; //distance; + points ((0.351516548679288 -0.0116085375585099 1.24)); + } + + patchSeedCoeffs + { + patches (motorBikeGroup); + axis x; //distance; + maxPoints 20000; + } + } + + // Optional entries + // bounds (0.2 -10 -10)(0.22 10 10); + // trackLength 1e-3; + // nSubCycle 1; + interpolationScheme cellPoint; + + // Optional (inherited) entries + region region0; + enabled true; + log true; + timeStart 0; + timeEnd 1000; + executeControl timeStep; + executeInterval 1; + writeControl writeTime; + writeInterval -1; +} + + +// ************************************************************************* //