From 9585db0bb1a7a91b9ba86aafb6e09ba91172fed3 Mon Sep 17 00:00:00 2001 From: Chris Greenshields Date: Wed, 20 May 2015 07:58:55 +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 --- .../combustion/engineFoam/kivaTest/Allclean | 6 +- .../combustion/engineFoam/kivaTest/Allrun | 6 -- .../kivaTest/constant/polyMesh/boundary | 40 -------------- .../kivaTest/constant/polyMesh/boundary.org | 44 --------------- .../engineFoam/kivaTest/system/controlDict | 23 +++++++- .../kivaTest/system/controlDict.1st | 55 ------------------- .../kivaTest/system/controlDict.2nd | 55 ------------------- 7 files changed, 26 insertions(+), 203 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 77f5d344..6230b49d 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 diff --git a/tutorials/combustion/engineFoam/kivaTest/Allrun b/tutorials/combustion/engineFoam/kivaTest/Allrun index 5088aaff..53723f47 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 e7532134..00000000 --- a/tutorials/combustion/engineFoam/kivaTest/constant/polyMesh/boundary +++ /dev/null @@ -1,40 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 2.3.0 | -| \\ / 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; - nFaces 1326; - startFace 79522; - } - liner - { - type wall; - nFaces 2710; - startFace 80848; - } - cylinderHead - { - type 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 7bcec500..00000000 --- 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: 2.3.0 | -| \\ / 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 b037ae62..2a11bd79 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 b037ae62..00000000 --- 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: 2.3.0 | -| \\ / 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 5680c5dd..00000000 --- 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: 2.3.0 | -| \\ / 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; - - -// ************************************************************************* //