diff --git a/tutorials/verificationAndValidation/schemes/weightedFluxExample/0.orig/DT b/tutorials/verificationAndValidation/schemes/weightedFluxExample/0.orig/DT new file mode 100644 index 0000000000..e9e255e0b5 --- /dev/null +++ b/tutorials/verificationAndValidation/schemes/weightedFluxExample/0.orig/DT @@ -0,0 +1,30 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object DT; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + "(top|bottom|sideWalls)" + { + type fixedGradient; + gradient uniform 0; + } +} + +// ************************************************************************* // diff --git a/tutorials/verificationAndValidation/schemes/weightedFluxExample/0.orig/T b/tutorials/verificationAndValidation/schemes/weightedFluxExample/0.orig/T new file mode 100644 index 0000000000..43e145270b --- /dev/null +++ b/tutorials/verificationAndValidation/schemes/weightedFluxExample/0.orig/T @@ -0,0 +1,39 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object T; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 273; + +boundaryField +{ + top + { + type fixedValue; + value uniform 1; + } + bottom + { + type fixedValue; + value uniform 0; + } + sideWalls + { + type zeroGradient; + } +} + +// ************************************************************************* // diff --git a/tutorials/verificationAndValidation/schemes/weightedFluxExample/Allclean b/tutorials/verificationAndValidation/schemes/weightedFluxExample/Allclean new file mode 100755 index 0000000000..10503f97cb --- /dev/null +++ b/tutorials/verificationAndValidation/schemes/weightedFluxExample/Allclean @@ -0,0 +1,12 @@ +#!/bin/sh +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions +#------------------------------------------------------------------------------ + +cleanCase0 + +rm -f *.png + +rm -f system/controlDict system/fvSchemes + +#------------------------------------------------------------------------------ diff --git a/tutorials/verificationAndValidation/schemes/weightedFluxExample/Allrun b/tutorials/verificationAndValidation/schemes/weightedFluxExample/Allrun new file mode 100755 index 0000000000..5bcc22315a --- /dev/null +++ b/tutorials/verificationAndValidation/schemes/weightedFluxExample/Allrun @@ -0,0 +1,42 @@ +#!/bin/sh +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions +#------------------------------------------------------------------------------ + +restore0Dir + +cp -f system/controlDict.template system/controlDict +cp -f system/fvSchemes.template system/fvSchemes + +runApplication blockMesh +runApplication setFields + +# ---- +echo "Run base-line (1)" +foamDictionary -entry endTime -set 1 system/controlDict >/dev/null +sed -i '/^ *laplacian/s/Gauss.*;/Gauss linear corrected;/' system/fvSchemes + +runApplication -s 1 $(getApplication) + +# ---- +echo "Run harmonic corrected (2)" + +foamDictionary -entry endTime -set 2 system/controlDict >/dev/null +sed -i '/^ *laplacian/s/Gauss.*;/Gauss harmonic corrected;/' system/fvSchemes + +runApplication -s 2 $(getApplication) + +# ---- +echo "Run weightedFlux (3)" +foamDictionary -entry endTime -set 3 system/controlDict >/dev/null +sed -i '/^ *grad/s/Gauss.*;/Gauss weightedFlux "DT";/' system/fvSchemes + +runApplication -s 3 $(getApplication) + +# ---- + +runApplication -s singleGraph postProcess -func singleGraph + +./plot $@ + +#------------------------------------------------------------------------------ diff --git a/tutorials/verificationAndValidation/schemes/weightedFluxExample/constant/transportProperties b/tutorials/verificationAndValidation/schemes/weightedFluxExample/constant/transportProperties new file mode 100644 index 0000000000..63ccdb4eca --- /dev/null +++ b/tutorials/verificationAndValidation/schemes/weightedFluxExample/constant/transportProperties @@ -0,0 +1,20 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object transportProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +DT 0; //Not used + +// ************************************************************************* // diff --git a/tutorials/verificationAndValidation/schemes/weightedFluxExample/plot b/tutorials/verificationAndValidation/schemes/weightedFluxExample/plot new file mode 100755 index 0000000000..3d4164670b --- /dev/null +++ b/tutorials/verificationAndValidation/schemes/weightedFluxExample/plot @@ -0,0 +1,88 @@ +#!/bin/bash +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions +#------------------------------------------------------------------------------ + +# Plot temperature, heat flux vs analytical + +graphDir="postProcessing/singleGraph" + +#------------------------------------------------------------------------------ + +plotTemperature() { + graphName="Tprofile.png" + echo "Creating temperature profile graph to $graphName" + gnuplot</dev/null || { + echo "gnuplot not found - skipping graph creation" 1>&2 + exit 1 + } + + plotTemperature + plotHeatFlux +fi + +# ------------------------------------------------------------------------------ diff --git a/tutorials/verificationAndValidation/schemes/weightedFluxExample/system/blockMeshDict b/tutorials/verificationAndValidation/schemes/weightedFluxExample/system/blockMeshDict new file mode 100644 index 0000000000..6f60948134 --- /dev/null +++ b/tutorials/verificationAndValidation/schemes/weightedFluxExample/system/blockMeshDict @@ -0,0 +1,68 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +a 0.5; +b -0.5; +h1 -1; +h2 1; + +vertices +( + ($a $a $h1) + ($b $a $h1) + ($b $b $h1) + ($a $b $h1) + + ($a $a $h2) + ($b $a $h2) + ($b $b $h2) + ($a $b $h2) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (1 1 100) simpleGrading (1 1 1) +); + +edges +( +); + +boundary +( + bottom + { + type wall; + faces + ( + (0 1 2 3) + ); + } + top + { + type wall; + faces + ( + (4 5 6 7) + ); + } +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/verificationAndValidation/schemes/weightedFluxExample/system/controlDict.template b/tutorials/verificationAndValidation/schemes/weightedFluxExample/system/controlDict.template new file mode 100644 index 0000000000..8076b8e8a9 --- /dev/null +++ b/tutorials/verificationAndValidation/schemes/weightedFluxExample/system/controlDict.template @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application laplacianFoam; + +startFrom latestTime; + +startTime 0; + +stopAt endTime; + +endTime 1; + +deltaT 0.005; + +writeControl runTime; + +writeInterval 1; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable true; + + +// ************************************************************************* // diff --git a/tutorials/verificationAndValidation/schemes/weightedFluxExample/system/fvSchemes.template b/tutorials/verificationAndValidation/schemes/weightedFluxExample/system/fvSchemes.template new file mode 100644 index 0000000000..3cfbac54f5 --- /dev/null +++ b/tutorials/verificationAndValidation/schemes/weightedFluxExample/system/fvSchemes.template @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default steadyState; +} + +gradSchemes +{ + grad(T) Gauss linear; +} + +divSchemes +{ + default none; +} + +laplacianSchemes +{ + laplacian(DT,T) Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + + +// ************************************************************************* // diff --git a/tutorials/verificationAndValidation/schemes/weightedFluxExample/system/fvSolution b/tutorials/verificationAndValidation/schemes/weightedFluxExample/system/fvSolution new file mode 100644 index 0000000000..e9b4e33f1a --- /dev/null +++ b/tutorials/verificationAndValidation/schemes/weightedFluxExample/system/fvSolution @@ -0,0 +1,35 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + T + { + solver PCG; + preconditioner DIC; + tolerance 1e-15; + relTol 0; + } +} + +SIMPLE +{ + nNonOrthogonalCorrectors 2; +} + + +// ************************************************************************* // diff --git a/tutorials/verificationAndValidation/schemes/weightedFluxExample/system/setFieldsDict b/tutorials/verificationAndValidation/schemes/weightedFluxExample/system/setFieldsDict new file mode 100644 index 0000000000..f4dbb22c4d --- /dev/null +++ b/tutorials/verificationAndValidation/schemes/weightedFluxExample/system/setFieldsDict @@ -0,0 +1,38 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object setFieldsDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +defaultFieldValues +( + volScalarFieldValue DT 1 +); + +regions +( + cylinderToCell + { + p1 (0 0 -5); + p2 (0 0 .000); + radius 1; + fieldValues + ( + volScalarFieldValue DT 1e6 + ); + } +); + + +// ************************************************************************* // diff --git a/tutorials/verificationAndValidation/schemes/weightedFluxExample/system/singleGraph b/tutorials/verificationAndValidation/schemes/weightedFluxExample/system/singleGraph new file mode 100644 index 0000000000..6139c9e90f --- /dev/null +++ b/tutorials/verificationAndValidation/schemes/weightedFluxExample/system/singleGraph @@ -0,0 +1,26 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +singleGraph +{ + start (0 0 -1); + end (0 0 1); + fields (T flux); + + #includeEtc "caseDicts/postProcessing/graphs/sampleDict.cfg" + + setConfig + { + axis z; + } + + // Must be last entry + #includeEtc "caseDicts/postProcessing/graphs/graph.cfg" +} + +// ************************************************************************* //