diff --git a/tutorials/verificationAndValidation/turbulenceModels/planeChannel/Allclean b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/Allclean new file mode 100755 index 0000000000..2206c5fd7d --- /dev/null +++ b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/Allclean @@ -0,0 +1,10 @@ +#!/bin/sh +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions +#------------------------------------------------------------------------------ + +rm -rf setups +rm -rf results +rm -rf plots + +#------------------------------------------------------------------------------ diff --git a/tutorials/verificationAndValidation/turbulenceModels/planeChannel/Allrun b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/Allrun new file mode 100755 index 0000000000..2d86ce6a43 --- /dev/null +++ b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/Allrun @@ -0,0 +1,171 @@ +#!/bin/sh +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions +#------------------------------------------------------------------------------ + +# settings + + # operand setups + setups=" + EBRSM + kOmegaSST + " + + # flag to enable computations + run=true + + # flag to enable computations in parallel mode + parallel=false + + # flag to enable to use a common mesh + common_mesh=true + + # flag to enable to use a common dynamic code + common_dynamic_code=true + + +#------------------------------------------------------------------------------ + +####################################### +# Create the given setup +# Arguments: +# $1 = Path to create the setup +# Outputs: +# Writes info to stdout +####################################### +dry_run_setup() { + + [ $# -eq 0 ] && { echo "Usage error: $0"; exit 1; } + + setup="$1" + dirSetup="setups/$setup" + dirSetupOrig="setups.orig/$setup" + dirOrig="$dirSetupOrig/0.orig" + dirConstant="$dirSetupOrig/constant" + dirSystem="$dirSetupOrig/system" + + printf "\n# Create the setup: %s\n" "$setup" + + if [ ! -d "$dirSetup" ] + then + mkdir -p "$dirSetup" + + cp -aRfL "setups.orig/common/." "$dirSetup" + cp -afL "$dirSetupOrig"/All* "$dirSetup" 2>/dev/null || : + [ -d "$dirOrig" ] && cp -aRfL "$dirOrig/." "$dirSetup/0.orig" + [ -d "$dirConstant" ] && cp -aRfL "$dirConstant/." "$dirSetup/constant" + [ -d "$dirSystem" ] && cp -aRfL "$dirSystem/." "$dirSetup/system" + else + printf "\n # Directory %s already exists\n" "$dirSetup" + printf " # Skipping the creation of a new setup\n" + fi +} + + +####################################### +# Run the given setup +# Arguments: +# $1 = Path to the setup to run +# Outputs: +# Writes info to stdout +####################################### +run_setup() { + + [ $# -eq 0 ] && { echo "Usage error: $0"; exit 1; } + + setup="$1" + dirSetup="setups/$setup" + dirResult="results/$setup" + + dry_run_setup "$setup" + [ -d results ] || mkdir -p results + + printf "\n# Run the setup: %s\n\n" "$setup" + + if [ ! -d "$dirResult" ] + then + cp -Rf "$dirSetup" "$dirResult" + + if [ "$common_mesh" = true ] + then + if [ -d results/mesh ] + then + printf "## Copy the common mesh to the setup: %s\n\n" "$setup" + cp -Rf results/mesh/polyMesh "$dirResult"/constant/. + fi + fi + + if [ "$common_dynamic_code" = true ] + then + if [ -d results/dynamicCode ] + then + printf "## Copy the common dynamic code to the setup: %s\n\n" "$setup" + cp -Rf results/dynamicCode "$dirResult"/. + fi + fi + + + if [ "$parallel" = true ] + then + ( cd "$dirResult" && ./Allrun-parallel ) + else + ( cd "$dirResult" && ./Allrun ) + fi + + + if [ "$common_mesh" = true ] + then + if [ ! -d results/mesh ] + then + printf "\n## Store the mesh of %s as the common mesh\n\n" "$setup" + mkdir -p results/mesh + cp -Rf "$dirResult"/constant/polyMesh results/mesh/. + fi + fi + + if [ "$common_dynamic_code" = true ] + then + if [ ! -d results/dynamicCode ] && [ -d "$dirResult"/dynamicCode ] + then + printf "\n## Store the dynamic code of %s as the common dynamic code\n\n" "$setup" + cp -Rf "$dirResult"/dynamicCode results/. + fi + fi + + + else + printf " # Directory %s already exists\n" "$dirResult" + printf " # Skipping the computation of the given setup\n" + fi +} + + +#------------------------------------------------------------------------------ + +for setup in $setups +do + dirSetupOrig="setups.orig/$setup" + + if [ ! -d "$dirSetupOrig" ] + then + echo "Setup directory: $dirSetupOrig" \ + "could not be found - skipping execution" 1>&2 + continue + fi + + if [ "$run" = true ] + then + run_setup "$setup" + else + dry_run_setup "$setup" + fi +done + + +if notTest "$@" && [ "$run" = true ] +then + ./plot +fi + + +#------------------------------------------------------------------------------ diff --git a/tutorials/verificationAndValidation/turbulenceModels/planeChannel/plot b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/plot new file mode 100755 index 0000000000..022923e9e3 --- /dev/null +++ b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/plot @@ -0,0 +1,707 @@ +#!/bin/bash +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions +#------------------------------------------------------------------------------ + +# settings + + # operand setups + setups=" + EBRSM + kOmegaSST + " + + +#------------------------------------------------------------------------------ + +plot_initial_iteration_residuals() { + + setup="$1" + + echo "## Plots the initial-iteration residuals" + + sampleFile="results/$setup/logs" + image="plots/$setup/initial-iteration-residuals.png" + + gnuplot</dev/null || { + echo "gnuplot not found - skipping graph creation" 1>&2 + exit 1 +} + +# Requires awk +command -v awk >/dev/null || { + echo "awk not found - skipping graph creation" 1>&2 + exit 1 +} + +# Check "results" directory +[ -d "results" ] || { + echo "No results directory found - skipping graph creation" 1>&2 + exit 1 +} + + +#------------------------------------------------------------------------------ + +for setup in $setups +do + + echo "" + echo "# Plots for the setup: $setup" + echo "" + + [ -d "results/$setup" ] || { + echo "No results/$setup directory found - skipping graph creation" 1>&2 + continue + } + + dirPlots="plots/$setup" + [ -d "$dirPlots" ] || mkdir -p "$dirPlots" + + # few manipulations + RASModel=$(foamDictionary results/$setup/constant/turbulenceProperties -entry RAS.RASModel -value) + endTime=$(foamDictionary results/$setup/system/controlDict -entry endTime -value) + nu=$(foamDictionary results/$setup/constant/transportProperties -entry nu | sed 's|^.*\s\(.*\);|\1|g') + tau=$(foamDictionary results/$setup/$endTime/wallShearStress -entry boundaryField.bottom.value -value | sed -n '/(/,/)/p' | sed -e 's/[()]//g;/^\s*$/d' | cut -d' ' -f6) + uTau=$(awk -v tau="$tau" 'BEGIN { printf "%.16f", sqrt(-1*tau) }') + + plot_initial_iteration_residuals "$setup" + + plot_final_iteration_residuals "$setup" + + plot_yPlus_vs_uPlus "$setup" "$endTime" "$nu" "$uTau" + + plot_yPlus_vs_R "$setup" "$endTime" "$nu" "$uTau" + + plot_yPlus_vs_epsilonPlus "$setup" "$endTime" "$nu" "$uTau" + + plot_yPlus_vs_productionRatePlus "$setup" "$endTime" "$nu" "$uTau" + +done + +plot_yPlus_vs_uPlus_all_setups $setups + +plot_yPlus_vs_R_all_setups $setups + +plot_yPlus_vs_epsilonPlus_all_setups $setups + +plot_yPlus_vs_productionRatePlus_all_setups $setups + + +#------------------------------------------------------------------------------ diff --git a/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/EBRSM/0.orig/R b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/EBRSM/0.orig/R new file mode 100644 index 0000000000..cbb1c87589 --- /dev/null +++ b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/EBRSM/0.orig/R @@ -0,0 +1,41 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volSymmTensorField; + object R; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 0 2 -2 0 0 0 0 ]; + +internalField uniform (1.718 0 0 1.718 0 1.718); // 2*k/3 + +boundaryField +{ + "(bottom|top)" + { + type fixedValue; + value uniform (1e-16 1e-16 1e-16 1e-16 1e-16 1e-16); + } + + "(inlet|outlet)" + { + type cyclic; + } + + leftAndRight + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/EBRSM/0.orig/epsilon b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/EBRSM/0.orig/epsilon new file mode 100644 index 0000000000..09a64d3633 --- /dev/null +++ b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/EBRSM/0.orig/epsilon @@ -0,0 +1,42 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object epsilon; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 0 2 -3 0 0 0 0 ]; + +internalField uniform 33.6; // Lardeau14-Coel Eq. 21 + +boundaryField +{ + "(bottom|top)" + { + type epsilonWallFunction; + lowReCorrection true; + value uniform 0; + } + + "(inlet|outlet)" + { + type cyclic; + } + + leftAndRight + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/EBRSM/0.orig/f b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/EBRSM/0.orig/f new file mode 100644 index 0000000000..184b4bfc24 --- /dev/null +++ b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/EBRSM/0.orig/f @@ -0,0 +1,41 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object f; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 0 0 0 0 0 0 0 ]; + +internalField uniform 1; + +boundaryField +{ + "(bottom|top)" + { + type fixedValue; + value uniform 0; + } + + "(inlet|outlet)" + { + type cyclic; + } + + leftAndRight + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/EBRSM/0.orig/k b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/EBRSM/0.orig/k new file mode 100644 index 0000000000..62e72281cf --- /dev/null +++ b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/EBRSM/0.orig/k @@ -0,0 +1,41 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: 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 2.577; // Lardeau14-Coel Eq. 21 + +boundaryField +{ + "(bottom|top)" + { + type fixedValue; + value uniform 1e-10; + } + + "(inlet|outlet)" + { + type cyclic; + } + + leftAndRight + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/EBRSM/constant/turbulenceProperties b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/EBRSM/constant/turbulenceProperties new file mode 100644 index 0000000000..279efb151f --- /dev/null +++ b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/EBRSM/constant/turbulenceProperties @@ -0,0 +1,27 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RAS; + +RAS +{ + RASModel EBRSM; + turbulence on; + printCoeffs on; +} + + +// ************************************************************************* // diff --git a/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/0.orig/U b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/0.orig/U new file mode 100644 index 0000000000..f3065cba45 --- /dev/null +++ b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/0.orig/U @@ -0,0 +1,41 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: 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 (17.54519653746177 0 0); + +boundaryField +{ + "(bottom|top)" + { + type fixedValue; + value uniform (0 0 0); + } + + "(inlet|outlet)" + { + type cyclic; + } + + leftAndRight + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/0.orig/nut b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/0.orig/nut new file mode 100644 index 0000000000..1f42d3c0c5 --- /dev/null +++ b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/0.orig/nut @@ -0,0 +1,41 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / 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 +{ + "(bottom|top)" + { + type nutLowReWallFunction; + value $internalField; + } + + "(inlet|outlet)" + { + type cyclic; + } + + leftAndRight + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/0.orig/p b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/0.orig/p new file mode 100644 index 0000000000..909b89e85a --- /dev/null +++ b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/0.orig/p @@ -0,0 +1,40 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: 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 +{ + "(bottom|top)" + { + type zeroGradient; + } + + "(inlet|outlet)" + { + type cyclic; + } + + leftAndRight + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/Allclean b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/Allclean new file mode 100755 index 0000000000..fb1f384730 --- /dev/null +++ b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/Allclean @@ -0,0 +1,8 @@ +#!/bin/sh +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions +#------------------------------------------------------------------------------ + +cleanCase0 + +#------------------------------------------------------------------------------ diff --git a/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/Allrun b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/Allrun new file mode 100755 index 0000000000..e62aa81413 --- /dev/null +++ b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/Allrun @@ -0,0 +1,27 @@ +#!/bin/sh +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions +#------------------------------------------------------------------------------ + +if [ ! -d constant/polyMesh ] +then + runApplication blockMesh + + runApplication renumberMesh -overwrite -constant + + runApplication checkMesh -allTopology -allGeometry -constant +fi + +restore0Dir + +runApplication $(getApplication) + + +runApplication -s "U" postProcess -func sampleU -latestTime +runApplication -s "k" postProcess -func sampleK -latestTime +runApplication -s "epsilon" postProcess -func sampleEpsilon -latestTime +runApplication -s "R" postProcess -func sampleR -latestTime +runApplication -s "G" postProcess -func sampleG -latestTime +runApplication foamLog log."$(getApplication)" + +#------------------------------------------------------------------------------ diff --git a/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/Allrun-parallel b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/Allrun-parallel new file mode 100755 index 0000000000..7b42731b65 --- /dev/null +++ b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/Allrun-parallel @@ -0,0 +1,31 @@ +#!/bin/sh +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions +#------------------------------------------------------------------------------ + +if [ ! -d constant/polyMesh ] +then + runApplication blockMesh + + runApplication renumberMesh -overwrite -constant + + runApplication checkMesh -allTopology -allGeometry -constant +fi + +restore0Dir + +runApplication decomposePar + +runParallel $(getApplication) + +runApplication reconstructPar + + +runApplication -s "U" postProcess -func sampleU -latestTime +runApplication -s "k" postProcess -func sampleK -latestTime +runApplication -s "epsilon" postProcess -func sampleEpsilon -latestTime +runApplication -s "R" postProcess -func sampleR -latestTime +runApplication -s "G" postProcess -func sampleG -latestTime +runApplication foamLog log."$(getApplication)" + +#------------------------------------------------------------------------------ diff --git a/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/constant/fvOptions b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/constant/fvOptions new file mode 100644 index 0000000000..34e2cde075 --- /dev/null +++ b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/constant/fvOptions @@ -0,0 +1,28 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2112 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvOptions; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +momentumSource +{ + type meanVelocityForce; + + selectionMode all; + + fields (U); + Ubar (17.54519653746177 0 0); +} + + +// ************************************************************************* // diff --git a/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/constant/transportProperties b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/constant/transportProperties new file mode 100644 index 0000000000..5b53305d69 --- /dev/null +++ b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/constant/transportProperties @@ -0,0 +1,22 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object transportProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +transportModel Newtonian; + +nu 0.002531645569620253; + + +// ************************************************************************* // diff --git a/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/system/blockMeshDict b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/system/blockMeshDict new file mode 100644 index 0000000000..5651dfb798 --- /dev/null +++ b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/system/blockMeshDict @@ -0,0 +1,97 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +scale 1; + +nx 10; +ny 100; +nz 1; +xMin 0; +xMax 1; +yMin 0; +yMax 1; +yyMax 2; +zMin 0; +zMax 1; +yExpansion 10.09757454; +yExpansion2 #eval{ -1*$yExpansion }; + +vertices +( + ($xMin $yMin $zMin) + ($xMax $yMin $zMin) + ($xMax $yMax $zMin) + ($xMax $yyMax $zMin) + ($xMin $yyMax $zMin) + ($xMin $yMax $zMin) + + ($xMin $yMin $zMax) + ($xMax $yMin $zMax) + ($xMax $yMax $zMax) + ($xMax $yyMax $zMax) + ($xMin $yyMax $zMax) + ($xMin $yMax $zMax) +); + +blocks +( + hex ( 0 1 2 5 6 7 8 11) ($nx $ny $nz) simpleGrading (1 $yExpansion 1) + hex ( 5 2 3 4 11 8 9 10) ($nx $ny $nz) simpleGrading (1 $yExpansion2 1) +); + +boundary +( + bottom + { + type wall; + faces ((0 6 7 1)); + } + + top + { + type wall; + faces ((4 3 9 10)); + } + + leftAndRight + { + type empty; + faces + ( + (1 2 5 0) + (2 3 4 5) + (6 11 8 7) + (11 10 9 8) + ); + } + + inlet + { + type cyclic; + neighbourPatch outlet; + faces ((0 5 11 6)(5 4 10 11)); + } + + outlet + { + type cyclic; + neighbourPatch inlet; + faces ((1 7 8 2)(2 8 9 3)); + } +); + + +// ************************************************************************* // diff --git a/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/system/controlDict b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/system/controlDict new file mode 100644 index 0000000000..264856463e --- /dev/null +++ b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/system/controlDict @@ -0,0 +1,151 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application simpleFoam; + +startFrom latestTime; + +startTime 0; + +stopAt endTime; + +endTime 100000; + +deltaT 1; + +writeControl timeStep; + +writeInterval 10000; + +purgeWrite 1; + +writeFormat ascii; + +writePrecision 16; + +writeCompression off; + +timeFormat general; + +timePrecision 8; + +runTimeModifiable false; + +functions +{ + fieldMinMax1 + { + type fieldMinMax; + libs (fieldFunctionObjects); + writeToFile no; + log yes; + location yes; + mode magnitude; + fields ( p U k omega epsilon ); + } + + wallShearStress1 + { + type wallShearStress; + libs (fieldFunctionObjects); + patches ( bottom ); + executeControl writeTime; + writeControl writeTime; + } + + yPlus1 + { + type yPlus; + libs (fieldFunctionObjects); + executeControl writeTime; + writeControl writeTime; + } + + writeCellCentres1 + { + type writeCellCentres; + libs (fieldFunctionObjects); + executeControl onEnd; + writeControl onEnd; + } + + turbulenceFields1 + { + type turbulenceFields; + libs (fieldFunctionObjects); + fields ( k epsilon R ); + executeControl writeTime; + writeControl writeTime; + } + + productionRate1 + { + type coded; + libs (utilityFunctionObjects); + name productionRate; + writeControl writeTime; + + codeExecute + #{ + auto* prodPtr = + mesh().getObjectPtr("productionRate"); + + if (!prodPtr) + { + Info<< "Create production rate field" << nl; + prodPtr = new volScalarField + ( + IOobject + ( + "productionRate", + mesh().time().timeName(), + mesh(), + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + mesh(), + sqr(dimLength)/pow3(dimTime) + ); + + regIOobject::store(prodPtr); + } + auto& prod = *prodPtr; + + Info<< "Computing production rate field\n" << endl; + + const auto& U = mesh().lookupObject("U"); + + auto* RPtr = + mesh().getObjectPtr("R"); + + if (!RPtr) + { + const auto& nut = mesh().lookupObject("nut"); + + prod = 2*nut*(symm(fvc::grad(U)) && symm(fvc::grad(U))); + } + else + { + auto& R = *RPtr; + + prod = 0.5*(mag(tr(-twoSymm(R & fvc::grad(U))))); + } + #}; + } +} + + +// ************************************************************************* // diff --git a/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/system/decomposeParDict b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/system/decomposeParDict new file mode 100644 index 0000000000..d6470857ed --- /dev/null +++ b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/system/decomposeParDict @@ -0,0 +1,27 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object decomposeParDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 2; + +method hierarchical; + +coeffs +{ + n (2 1 1); +} + + +// ************************************************************************* // diff --git a/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/system/fvSchemes b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/system/fvSchemes new file mode 100644 index 0000000000..46494e982c --- /dev/null +++ b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/system/fvSchemes @@ -0,0 +1,68 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / 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; +} + +divSchemes +{ + default none; + div(phi,U) bounded Gauss linearUpwind grad(U); + + turbulence bounded Gauss limitedLinear 1; + + div(phi,k) $turbulence; + div(phi,omega) $turbulence; + div(phi,nuTilda) $turbulence; + div(phi,epsilon) $turbulence; + div(phi,phit) $turbulence; + div(phi,f) $turbulence; + div(phi,R) $turbulence; + + div((nuEff*dev2(T(grad(U))))) Gauss linear; + div((nu*dev2(T(grad(U))))) Gauss linear; + div(R) Gauss linear; +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + +wallDist +{ + method meshWave; +} + + +// ************************************************************************* // diff --git a/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/system/fvSolution b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/system/fvSolution new file mode 100644 index 0000000000..95353b23f5 --- /dev/null +++ b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/system/fvSolution @@ -0,0 +1,97 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + p + { + solver GAMG; + smoother DICGaussSeidel; + tolerance 1e-12; + relTol 0; + minIter 3; + } + + U + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-12; + relTol 0; + minIter 3; + } + + "(k|omega|nuTilda)" + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-12; + relTol 0; + minIter 3; + } + + "(epsilon|phit)" + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-12; + relTol 0; + minIter 3; + } + + f + { + solver PBiCGStab; + preconditioner DIC; + tolerance 1e-12; + relTol 0; + minIter 3; + } + + R + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-12; + relTol 0; + minIter 3; + } +} + +SIMPLE +{ + nNonOrthogonalCorrectors 0; + consistent yes; + pRefCell 0; + pRefValue 0; +} + +relaxationFactors +{ + equations + { + U 0.7; + k 0.5; + omega 0.5; + nuTilda 0.5; + epsilon 0.5; + "(phit|f)" 0.5; + R 0.4; + } +} + + +// ************************************************************************* // diff --git a/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/system/sampleEpsilon b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/system/sampleEpsilon new file mode 100644 index 0000000000..de09bff3b1 --- /dev/null +++ b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/system/sampleEpsilon @@ -0,0 +1,40 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object sample; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +type sets; +libs (sampling); +interpolationScheme cellPoint; +setFormat raw; +executeControl writeTime; +writeControl writeTime; +fields +( + turbulenceProperties:epsilon +); + +sets +( + y + { + type midPoint; + axis y; + start (0.5 0 0.5); + end (0.5 1 0.5); + } +); + + +// ************************************************************************* // diff --git a/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/system/sampleF b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/system/sampleF new file mode 100644 index 0000000000..22151890bc --- /dev/null +++ b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/system/sampleF @@ -0,0 +1,40 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object sample; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +type sets; +libs (sampling); +interpolationScheme cellPoint; +setFormat raw; +executeControl writeTime; +writeControl writeTime; +fields +( + f +); + +sets +( + y + { + type midPoint; + axis y; + start (0.5 0 0.5); + end (0.5 1 0.5); + } +); + + +// ************************************************************************* // diff --git a/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/system/sampleG b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/system/sampleG new file mode 100644 index 0000000000..7460f2c6ca --- /dev/null +++ b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/system/sampleG @@ -0,0 +1,40 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object sample; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +type sets; +libs (sampling); +interpolationScheme cellPoint; +setFormat raw; +executeControl writeTime; +writeControl writeTime; +fields +( + productionRate +); + +sets +( + y + { + type midPoint; + axis y; + start (0.5 0 0.5); + end (0.5 1 0.5); + } +); + + +// ************************************************************************* // diff --git a/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/system/sampleK b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/system/sampleK new file mode 100644 index 0000000000..dbf17f37fe --- /dev/null +++ b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/system/sampleK @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object sample; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +type sets; +libs (sampling); +interpolationScheme cellPoint; +setFormat raw; +executeControl writeTime; +writeControl writeTime; +fields +( + turbulenceProperties:k +); + +sets +( + ref_point + { + type cloud; + axis y; + points ((0.5 1 0.5)); + } + + y + { + type midPoint; + axis y; + start (0.5 0 0.5); + end (0.5 1 0.5); + } +); + + +// ************************************************************************* // diff --git a/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/system/sampleR b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/system/sampleR new file mode 100644 index 0000000000..fd9333708b --- /dev/null +++ b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/system/sampleR @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object sample; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +type sets; +libs (sampling); +interpolationScheme cellPoint; +setFormat raw; +executeControl writeTime; +writeControl writeTime; +fields +( + turbulenceProperties:R +); + +sets +( + ref_point + { + type cloud; + axis y; + points ((0.5 1 0.5)); + } + + y + { + type midPoint; + axis y; + start (0.5 0 0.5); + end (0.5 1 0.5); + } +); + + +// ************************************************************************* // diff --git a/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/system/sampleU b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/system/sampleU new file mode 100644 index 0000000000..e49f5d0370 --- /dev/null +++ b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/common/system/sampleU @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object sample; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +type sets; +libs (sampling); +interpolationScheme cellPoint; +setFormat raw; +executeControl writeTime; +writeControl writeTime; +fields +( + U +); + +sets +( + ref_point + { + type cloud; + axis y; + points ((0.5 1 0.5)); + } + + y + { + type midPoint; + axis y; + start (0.5 0 0.5); + end (0.5 1 0.5); + } +); + + +// ************************************************************************* // diff --git a/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/kOmegaSST/0.orig/k b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/kOmegaSST/0.orig/k new file mode 100644 index 0000000000..62e72281cf --- /dev/null +++ b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/kOmegaSST/0.orig/k @@ -0,0 +1,41 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: 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 2.577; // Lardeau14-Coel Eq. 21 + +boundaryField +{ + "(bottom|top)" + { + type fixedValue; + value uniform 1e-10; + } + + "(inlet|outlet)" + { + type cyclic; + } + + leftAndRight + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/kOmegaSST/0.orig/omega b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/kOmegaSST/0.orig/omega new file mode 100644 index 0000000000..18c68f9098 --- /dev/null +++ b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/kOmegaSST/0.orig/omega @@ -0,0 +1,41 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object omega; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 -1 0 0 0 0]; + +internalField uniform 144.87; // epsilon/Cmu/k + +boundaryField +{ + "(bottom|top)" + { + type omegaWallFunction; + value $internalField; + } + + "(inlet|outlet)" + { + type cyclic; + } + + leftAndRight + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/kOmegaSST/constant/turbulenceProperties b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/kOmegaSST/constant/turbulenceProperties new file mode 100644 index 0000000000..61413fd752 --- /dev/null +++ b/tutorials/verificationAndValidation/turbulenceModels/planeChannel/setups.orig/kOmegaSST/constant/turbulenceProperties @@ -0,0 +1,27 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / 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; +} + + +// ************************************************************************* //