From 78d98ca48266a596bee08071ba9d2291c6f61557 Mon Sep 17 00:00:00 2001 From: Chris Greenshields Date: Tue, 19 May 2015 15:01:10 +0100 Subject: [PATCH] Modified waterChannel tutorial to make case better posed Existing case did not properly converge and suffered slow convergence with the water level failing to reach an equilibrium. A slight rise in the channel appears to help the water level reach an equlibrium when the flow rate over the rise matches the inlet flow rate. --- .../multiphase/interFoam/ras/waterChannel/0/U | 2 +- .../interFoam/ras/waterChannel/Allmesh | 20 ++++ .../interFoam/ras/waterChannel/Allrun | 11 +-- .../LTSInterFoam/system/controlDict | 86 ---------------- .../LTSInterFoam/system/fvSchemes | 62 ------------ .../LTSInterFoam/system/fvSolution | 98 ------------------- .../LTSInterFoam/system/setFieldsDict | 45 --------- .../interFoam/ras/waterChannel/README | 2 +- .../ras/waterChannel/system/controlDict | 2 +- .../ras/waterChannel/system/extrudeMeshDict.1 | 2 +- .../ras/waterChannel/system/extrudeMeshDict.2 | 2 +- .../ras/waterChannel/system/setFieldsDict | 2 +- 12 files changed, 27 insertions(+), 307 deletions(-) create mode 100755 tutorials/multiphase/interFoam/ras/waterChannel/Allmesh delete mode 100644 tutorials/multiphase/interFoam/ras/waterChannel/LTSInterFoam/system/controlDict delete mode 100644 tutorials/multiphase/interFoam/ras/waterChannel/LTSInterFoam/system/fvSchemes delete mode 100644 tutorials/multiphase/interFoam/ras/waterChannel/LTSInterFoam/system/fvSolution delete mode 100644 tutorials/multiphase/interFoam/ras/waterChannel/LTSInterFoam/system/setFieldsDict diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/0/U b/tutorials/multiphase/interFoam/ras/waterChannel/0/U index 5a7c8f166..687c94d91 100644 --- a/tutorials/multiphase/interFoam/ras/waterChannel/0/U +++ b/tutorials/multiphase/interFoam/ras/waterChannel/0/U @@ -16,7 +16,7 @@ FoamFile dimensions [0 1 -1 0 0 0 0]; -internalField uniform (2 0 0); +internalField uniform (1 0 0); boundaryField { diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/Allmesh b/tutorials/multiphase/interFoam/ras/waterChannel/Allmesh new file mode 100755 index 000000000..9cb847c02 --- /dev/null +++ b/tutorials/multiphase/interFoam/ras/waterChannel/Allmesh @@ -0,0 +1,20 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +application=`getApplication` + +runApplication blockMesh + +echo "Creating channel" +i=1 +while [ "$i" -lt 3 ] ; do + cp system/extrudeMeshDict.${i} system/extrudeMeshDict + echo "Running extrudeMesh, instance" ${i} + extrudeMesh > log.extrudeMesh.${i} + i=`expr $i + 1` +done + +# ----------------------------------------------------------------- end-of-file diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/Allrun b/tutorials/multiphase/interFoam/ras/waterChannel/Allrun index 765ea2042..3bf622c77 100755 --- a/tutorials/multiphase/interFoam/ras/waterChannel/Allrun +++ b/tutorials/multiphase/interFoam/ras/waterChannel/Allrun @@ -6,16 +6,7 @@ cd ${0%/*} || exit 1 # Run from this directory application=`getApplication` -runApplication blockMesh - -echo "Creating channel" -i=1 -while [ "$i" -lt 3 ] ; do - cp system/extrudeMeshDict.${i} system/extrudeMeshDict - echo "Running extrudeMesh, instance" ${i} - extrudeMesh > log.extrudeMesh.${i} - i=`expr $i + 1` -done +./Allmesh cp 0/alpha.water.org 0/alpha.water runApplication setFields diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/LTSInterFoam/system/controlDict b/tutorials/multiphase/interFoam/ras/waterChannel/LTSInterFoam/system/controlDict deleted file mode 100644 index bfea3cad8..000000000 --- a/tutorials/multiphase/interFoam/ras/waterChannel/LTSInterFoam/system/controlDict +++ /dev/null @@ -1,86 +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; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -application LTSInterFoam; - -startFrom latestTime; - -startTime 0; - -stopAt endTime; - -endTime 5000; - -deltaT 1; - -writeControl timeStep; - -writeInterval 200; - -purgeWrite 0; - -writeFormat ascii; - -writePrecision 6; - -writeCompression compressed; - -timeFormat general; - -timePrecision 6; - -runTimeModifiable yes; - -adjustTimeStep yes; -maxCo 0.5; -maxAlphaCo 0.5; -maxDeltaT 1; - -functions -{ - inletFlux - { - type faceSource; - functionObjectLibs ("libfieldFunctionObjects.so"); - outputControl timeStep; - log true; - // Output field values as well - valueOutput false; - source patch; - sourceName inlet; - operation sum; - - fields - ( - rhoPhi - ); - } - - outletFlux - { - $inletFlux; - sourceName outlet; - } - - atmosphereFlux - { - $inletFlux; - sourceName atmosphere; - } -} - -// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/LTSInterFoam/system/fvSchemes b/tutorials/multiphase/interFoam/ras/waterChannel/LTSInterFoam/system/fvSchemes deleted file mode 100644 index 22019100d..000000000 --- a/tutorials/multiphase/interFoam/ras/waterChannel/LTSInterFoam/system/fvSchemes +++ /dev/null @@ -1,62 +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 fvSchemes; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -ddtSchemes -{ - default localEuler rDeltaT; -} - -gradSchemes -{ - default Gauss linear; -} - -divSchemes -{ - div(rhoPhi,U) Gauss linearUpwind grad(U); - div(phi,alpha) Gauss vanLeer; - div(phirb,alpha) Gauss linear; - div(phi,k) Gauss upwind; - div(phi,omega) Gauss upwind; - div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear; -} - -laplacianSchemes -{ - default Gauss linear corrected; -} - -interpolationSchemes -{ - default linear; -} - -snGradSchemes -{ - default corrected; -} - -fluxRequired -{ - default no; - p_rgh; - pcorr; - alpha.water; -} - - -// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/LTSInterFoam/system/fvSolution b/tutorials/multiphase/interFoam/ras/waterChannel/LTSInterFoam/system/fvSolution deleted file mode 100644 index 2c7496729..000000000 --- a/tutorials/multiphase/interFoam/ras/waterChannel/LTSInterFoam/system/fvSolution +++ /dev/null @@ -1,98 +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 fvSolution; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -solvers -{ - alpha.water - { - nAlphaCorr 1; - nAlphaSubCycles 3; - cAlpha 1; - } - - pcorr - { - solver PCG; - preconditioner - { - preconditioner GAMG; - tolerance 1e-05; - relTol 0; - smoother DICGaussSeidel; - nPreSweeps 0; - nPostSweeps 2; - nFinestSweeps 2; - cacheAgglomeration true; - nCellsInCoarsestLevel 10; - agglomerator faceAreaPair; - mergeLevels 1; - } - tolerance 1e-05; - relTol 0; - maxIter 100; - } - - p_rgh - { - $pcorr; - tolerance 1e-6; - relTol 0.01; - }; - - p_rghFinal - { - $p_rgh; - tolerance 1e-6; - relTol 0; - } - - "(U|k|omega).*" - { - solver smoothSolver; - - smoother GaussSeidel; - nSweeps 1; - - tolerance 1e-7; - relTol 0.1; - }; -} - -PIMPLE -{ - momentumPredictor no; - nCorrectors 2; - nNonOrthogonalCorrectors 0; - - maxCo 0.5; - maxAlphaCo 0.2; - nAlphaSweepIter 1; - - rDeltaTSmoothingCoeff 0.1; - rDeltaTDampingCoeff 1; - maxDeltaT 100; -} - -relaxationFactors -{ - equations - { - } -} - - -// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/LTSInterFoam/system/setFieldsDict b/tutorials/multiphase/interFoam/ras/waterChannel/LTSInterFoam/system/setFieldsDict deleted file mode 100644 index 0caad9449..000000000 --- a/tutorials/multiphase/interFoam/ras/waterChannel/LTSInterFoam/system/setFieldsDict +++ /dev/null @@ -1,45 +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 setFieldsDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -defaultFieldValues -( - volScalarFieldValue alpha.water 0 -); - -regions -( - boxToCell - { - box (0 0 0) (50 130 27); - fieldValues - ( - volScalarFieldValue alpha.water 1 - ); - } - - boxToFace - { - box (0 0 0) (50 10.0001 24); - fieldValues - ( - volScalarFieldValue alpha.water 1 - ); - } -); - - -// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/README b/tutorials/multiphase/interFoam/ras/waterChannel/README index 965538a76..470115a6a 100644 --- a/tutorials/multiphase/interFoam/ras/waterChannel/README +++ b/tutorials/multiphase/interFoam/ras/waterChannel/README @@ -1,5 +1,5 @@ - This case uses blockMesh and extrudeMesh to create a channel geometry. - - See Allrun script to generate geometry. + - See Allmesh script to generate geometry. - The case is set up to run with interFoam. - For running with LTSInterFoam, an alternative set of main files from system directory (controlDict, etc) are included in LTSInterFoam diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/system/controlDict b/tutorials/multiphase/interFoam/ras/waterChannel/system/controlDict index 7d4ac3e2e..fab971dce 100644 --- a/tutorials/multiphase/interFoam/ras/waterChannel/system/controlDict +++ b/tutorials/multiphase/interFoam/ras/waterChannel/system/controlDict @@ -23,7 +23,7 @@ startTime 0; stopAt endTime; -endTime 100; +endTime 200; deltaT 0.1; diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/system/extrudeMeshDict.1 b/tutorials/multiphase/interFoam/ras/waterChannel/system/extrudeMeshDict.1 index 8204a892d..18b6966a1 100644 --- a/tutorials/multiphase/interFoam/ras/waterChannel/system/extrudeMeshDict.1 +++ b/tutorials/multiphase/interFoam/ras/waterChannel/system/extrudeMeshDict.1 @@ -28,7 +28,7 @@ expansionRatio 1.0; linearDirectionCoeffs { axisPt (0 0 0); - direction (1 0.2 -0.02); + direction (1 0.2 0.02); thickness 60; } diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/system/extrudeMeshDict.2 b/tutorials/multiphase/interFoam/ras/waterChannel/system/extrudeMeshDict.2 index ffa39b334..8ccc34c69 100644 --- a/tutorials/multiphase/interFoam/ras/waterChannel/system/extrudeMeshDict.2 +++ b/tutorials/multiphase/interFoam/ras/waterChannel/system/extrudeMeshDict.2 @@ -28,7 +28,7 @@ expansionRatio 1.0; linearDirectionCoeffs { axisPt (0 0 0); - direction (1 -0.2 -0.02); + direction (1 -0.2 -0.03); thickness 40; } diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/system/setFieldsDict b/tutorials/multiphase/interFoam/ras/waterChannel/system/setFieldsDict index 2258df9f4..8b7d29694 100644 --- a/tutorials/multiphase/interFoam/ras/waterChannel/system/setFieldsDict +++ b/tutorials/multiphase/interFoam/ras/waterChannel/system/setFieldsDict @@ -24,7 +24,7 @@ regions ( boxToCell { - box (-10 -20 -10) (200 20 4); + box (-10 -20 -10) (50 20 2.2); fieldValues ( volScalarFieldValue alpha.water 1