From 31fbd774b719fec68e38e4e9736c1efc5d5d5b66 Mon Sep 17 00:00:00 2001 From: Chris Greenshields Date: Wed, 20 May 2015 08:28:03 +0100 Subject: [PATCH] Updated kivaTest to run without restart at CA = -15 degs using coded function object to change time step at CA = -15 degs Also updated incorrect scheme keywords in fvSchemes --- .../combustion/engineFoam/kivaTest/Allclean | 8 ++- .../combustion/engineFoam/kivaTest/Allrun | 6 -- .../kivaTest/constant/polyMesh/boundary | 43 --------------- .../kivaTest/constant/polyMesh/boundary.org | 44 --------------- .../engineFoam/kivaTest/system/controlDict | 23 +++++++- .../kivaTest/system/controlDict.1st | 55 ------------------- .../kivaTest/system/controlDict.2nd | 55 ------------------- .../engineFoam/kivaTest/system/fvSchemes | 4 +- 8 files changed, 29 insertions(+), 209 deletions(-) delete mode 100644 tutorials/combustion/engineFoam/kivaTest/constant/polyMesh/boundary delete mode 100644 tutorials/combustion/engineFoam/kivaTest/constant/polyMesh/boundary.org delete mode 100644 tutorials/combustion/engineFoam/kivaTest/system/controlDict.1st delete mode 100644 tutorials/combustion/engineFoam/kivaTest/system/controlDict.2nd diff --git a/tutorials/combustion/engineFoam/kivaTest/Allclean b/tutorials/combustion/engineFoam/kivaTest/Allclean index 9f2f4ac44..6be1f524b 100755 --- a/tutorials/combustion/engineFoam/kivaTest/Allclean +++ b/tutorials/combustion/engineFoam/kivaTest/Allclean @@ -5,9 +5,11 @@ cd ${0%/*} || exit 1 # Run from this directory . $WM_PROJECT_DIR/bin/tools/CleanFunctions mv ./-180 temp180 -rm -rf 0 -cp system/controlDict.1st system/controlDict cleanCase + +rm -rf 0 > /dev/null 2>&1 +rm -f constant/polyMesh/boundary > /dev/null 2>&1 + mv temp180 ./-180 -# ----------------------------------------------------------------- end-of-file +# ----------------------------------------------------------------- end-of-file \ No newline at end of file diff --git a/tutorials/combustion/engineFoam/kivaTest/Allrun b/tutorials/combustion/engineFoam/kivaTest/Allrun index 603fc9cad..592be37ba 100755 --- a/tutorials/combustion/engineFoam/kivaTest/Allrun +++ b/tutorials/combustion/engineFoam/kivaTest/Allrun @@ -9,12 +9,6 @@ application=`getApplication` runApplication kivaToFoam -file otape17 -cp system/controlDict.1st system/controlDict runApplication $application -mv log.$application log.$application.1 - -cp system/controlDict.2nd system/controlDict -runApplication $application -mv log.$application log.$application.2 # ----------------------------------------------------------------- end-of-file diff --git a/tutorials/combustion/engineFoam/kivaTest/constant/polyMesh/boundary b/tutorials/combustion/engineFoam/kivaTest/constant/polyMesh/boundary deleted file mode 100644 index 0b12967f8..000000000 --- a/tutorials/combustion/engineFoam/kivaTest/constant/polyMesh/boundary +++ /dev/null @@ -1,43 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class polyBoundaryMesh; - location "constant/polyMesh"; - object boundary; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -3 -( - piston - { - type wall; - inGroups 1(wall); - nFaces 1326; - startFace 79522; - } - liner - { - type wall; - inGroups 1(wall); - nFaces 2710; - startFace 80848; - } - cylinderHead - { - type wall; - inGroups 1(wall); - nFaces 2184; - startFace 83558; - } -) - -// ************************************************************************* // diff --git a/tutorials/combustion/engineFoam/kivaTest/constant/polyMesh/boundary.org b/tutorials/combustion/engineFoam/kivaTest/constant/polyMesh/boundary.org deleted file mode 100644 index 5a2dbd5ac..000000000 --- a/tutorials/combustion/engineFoam/kivaTest/constant/polyMesh/boundary.org +++ /dev/null @@ -1,44 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class polyBoundaryMesh; - object boundary; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -3 -( -piston -{ - type wall; - physicalType fixedTemperatureMovingWallFunctions; - nFaces 1326; - startFace 79522; -} - -liner -{ - type wall; - physicalType fixedTemperatureWallFunctions; - nFaces 2710; - startFace 80848; -} - -cylinderHead -{ - type wall; - physicalType fixedTemperatureWallFunctions; - nFaces 2184; - startFace 83558; -} -) - -// ************************************************************************* // diff --git a/tutorials/combustion/engineFoam/kivaTest/system/controlDict b/tutorials/combustion/engineFoam/kivaTest/system/controlDict index 8505a50c9..d417c3737 100644 --- a/tutorials/combustion/engineFoam/kivaTest/system/controlDict +++ b/tutorials/combustion/engineFoam/kivaTest/system/controlDict @@ -23,7 +23,7 @@ startTime -180; stopAt endTime; -endTime -15; +endTime 60; deltaT 0.25; @@ -51,5 +51,26 @@ maxCo 0.2; maxDeltaT 1; +functions +{ + timeStep + { + type coded; + functionObjectLibs ("libutilityFunctionObjects.so"); + redirectType setDeltaT; + + code + #{ + const Time& runTime = mesh().time(); + if (runTime.timeToUserTime(runTime.value()) >= -15.0) + { + const_cast(runTime).setDeltaT + ( + runTime.userTimeToTime(0.025) + ); + } + #}; + } +} // ************************************************************************* // diff --git a/tutorials/combustion/engineFoam/kivaTest/system/controlDict.1st b/tutorials/combustion/engineFoam/kivaTest/system/controlDict.1st deleted file mode 100644 index 8505a50c9..000000000 --- a/tutorials/combustion/engineFoam/kivaTest/system/controlDict.1st +++ /dev/null @@ -1,55 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - location "system"; - object controlDict.1st; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -application engineFoam; - -startFrom startTime; - -startTime -180; - -stopAt endTime; - -endTime -15; - -deltaT 0.25; - -writeControl runTime; - -writeInterval 5; - -purgeWrite 0; - -writeFormat ascii; - -writePrecision 6; - -writeCompression off; - -timeFormat general; - -timePrecision 6; - -runTimeModifiable true; - -adjustTimeStep no; - -maxCo 0.2; - -maxDeltaT 1; - - -// ************************************************************************* // diff --git a/tutorials/combustion/engineFoam/kivaTest/system/controlDict.2nd b/tutorials/combustion/engineFoam/kivaTest/system/controlDict.2nd deleted file mode 100644 index 0253c4d82..000000000 --- a/tutorials/combustion/engineFoam/kivaTest/system/controlDict.2nd +++ /dev/null @@ -1,55 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - location "system"; - object controlDict.2nd; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -application engineFoam; - -startFrom startTime; - -startTime -15; - -stopAt endTime; - -endTime 60; - -deltaT 0.025; - -writeControl runTime; - -writeInterval 5; - -purgeWrite 0; - -writeFormat ascii; - -writePrecision 6; - -writeCompression off; - -timeFormat general; - -timePrecision 6; - -runTimeModifiable true; - -adjustTimeStep no; - -maxCo 0.2; - -maxDeltaT 1; - - -// ************************************************************************* // diff --git a/tutorials/combustion/engineFoam/kivaTest/system/fvSchemes b/tutorials/combustion/engineFoam/kivaTest/system/fvSchemes index ed155cb77..87efa40d7 100644 --- a/tutorials/combustion/engineFoam/kivaTest/system/fvSchemes +++ b/tutorials/combustion/engineFoam/kivaTest/system/fvSchemes @@ -51,8 +51,8 @@ divSchemes eau limitedLinear 1; }; div(U) Gauss linear; - div((Su*grad(b))) Gauss linear; - div((U+((Su*Xi)*grad(b)))) Gauss linear; + div((Su*n)) Gauss linear; + div((U+((Su*Xi)*n))) Gauss linear; div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear; }