From d1cb32970673000cb526a4a5227922aa08d5b175 Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Tue, 7 Feb 2023 15:41:34 +0000 Subject: [PATCH] tutorials: movingCone: Corrected and simplified The '-region' option has been leveraged to significantly simplify the meshing and decomposition in the movingCone cases. These cases have also been corrected to restore the variation in decomposition between the different meshes, which is important for thoroughly testing the patch field mapping. The shockFluid case has also had its duration extended a little in order to span the final mesh mapping time. --- .../incompressibleFluid/movingCone/Allrun | 19 ++----- .../movingCone/Allrun-parallel | 40 ++++---------- .../movingCone/system/controlDict | 2 +- ...decomposeParDict => decomposeParDict.orig} | 15 ------ .../blockMeshDict} | 0 .../decomposeParDict} | 21 -------- .../blockMeshDict} | 0 .../system/meshToMesh_0.003/decomposeParDict} | 15 ------ .../modules/shockFluid/movingCone/Allrun | 19 ++----- .../shockFluid/movingCone/Allrun-parallel | 40 ++++---------- tutorials/modules/shockFluid/movingCone/U | 52 ------------------ .../shockFluid/movingCone/pointMotionUx | 54 ------------------- .../shockFluid/movingCone/system/controlDict | 2 +- ...decomposeParDict => decomposeParDict.orig} | 15 ------ .../blockMeshDict} | 0 .../decomposeParDict} | 21 -------- .../blockMeshDict} | 0 .../system/meshToMesh_2e-05/decomposeParDict} | 15 ------ 18 files changed, 30 insertions(+), 300 deletions(-) rename tutorials/modules/incompressibleFluid/movingCone/system/{decomposeParDict => decomposeParDict.orig} (85%) rename tutorials/modules/incompressibleFluid/movingCone/system/{blockMeshDict_0.0015 => meshToMesh_0.0015/blockMeshDict} (100%) rename tutorials/modules/incompressibleFluid/movingCone/system/{decomposeParDict_0.0015 => meshToMesh_0.0015/decomposeParDict} (77%) rename tutorials/modules/incompressibleFluid/movingCone/system/{blockMeshDict_0.003 => meshToMesh_0.003/blockMeshDict} (100%) rename tutorials/modules/{shockFluid/movingCone/system/decomposeParDict_2e-05 => incompressibleFluid/movingCone/system/meshToMesh_0.003/decomposeParDict} (85%) delete mode 100644 tutorials/modules/shockFluid/movingCone/U delete mode 100644 tutorials/modules/shockFluid/movingCone/pointMotionUx rename tutorials/modules/shockFluid/movingCone/system/{decomposeParDict => decomposeParDict.orig} (85%) rename tutorials/modules/shockFluid/movingCone/system/{blockMeshDict_1e-05 => meshToMesh_1e-05/blockMeshDict} (100%) rename tutorials/modules/shockFluid/movingCone/system/{decomposeParDict_1e-05 => meshToMesh_1e-05/decomposeParDict} (77%) rename tutorials/modules/shockFluid/movingCone/system/{blockMeshDict_2e-05 => meshToMesh_2e-05/blockMeshDict} (100%) rename tutorials/modules/{incompressibleFluid/movingCone/system/decomposeParDict_0.003 => shockFluid/movingCone/system/meshToMesh_2e-05/decomposeParDict} (85%) diff --git a/tutorials/modules/incompressibleFluid/movingCone/Allrun b/tutorials/modules/incompressibleFluid/movingCone/Allrun index dbdadba61b..ae69a3b537 100755 --- a/tutorials/modules/incompressibleFluid/movingCone/Allrun +++ b/tutorials/modules/incompressibleFluid/movingCone/Allrun @@ -4,22 +4,13 @@ cd ${0%/*} || exit 1 # Run from this directory # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions -application=$(getApplication) - -mapTimes="0.0015 0.003" - -# Iterate the string variable using for loop -for mapTime in $mapTimes; do - - runApplication -a blockMesh -dict blockMeshDict_$mapTime - rm -rf constant/meshToMesh_$mapTime - mkdir constant/meshToMesh_$mapTime - mv constant/polyMesh constant/meshToMesh_$mapTime +runApplication blockMesh +for mapTime in 0.0015 0.003 +do + runApplication -s $mapTime blockMesh -region meshToMesh_$mapTime done -runApplication -a blockMesh - -runApplication $application +runApplication $(getApplication) #------------------------------------------------------------------------------ diff --git a/tutorials/modules/incompressibleFluid/movingCone/Allrun-parallel b/tutorials/modules/incompressibleFluid/movingCone/Allrun-parallel index 3ec6ec782b..281c4cc12f 100755 --- a/tutorials/modules/incompressibleFluid/movingCone/Allrun-parallel +++ b/tutorials/modules/incompressibleFluid/movingCone/Allrun-parallel @@ -4,40 +4,18 @@ cd ${0%/*} || exit 1 # Run from this directory # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions -mapTimes="0.0015 0.003" - -# Iterate the string variable using for loop -for mapTime in $mapTimes; do - - runApplication -a blockMesh -dict blockMeshDict_$mapTime - runApplication -a decomposePar -force -noFields -dict decomposeParDict_$mapTime - - rm -rf constant/meshToMesh_$mapTime - mkdir constant/meshToMesh_$mapTime - - for procI in processor* - do - mv $procI/constant/polyMesh constant/meshToMesh_$mapTime/$procI - done - - mv constant/polyMesh constant/meshToMesh_$mapTime - -done - -runApplication -a blockMesh -dict blockMeshDict -runApplication -a decomposePar -force - -for mapTime in $mapTimes; do - - for procI in processor* - do - mkdir $procI/constant/meshToMesh_$mapTime - mv constant/meshToMesh_$mapTime/$procI $procI/constant/meshToMesh_$mapTime/polyMesh - done +runApplication blockMesh +runApplication decomposePar -cellProc +for mapTime in 0.0015 0.003 +do + runApplication -s $mapTime blockMesh -region meshToMesh_$mapTime + ln -s meshToMesh_$mapTime/decomposeParDict system/decomposeParDict + runApplication -s $mapTime decomposePar -region meshToMesh_$mapTime + rm -f system/decomposeParDict done runParallel $(getApplication) -runApplication reconstructPar +runApplication reconstructPar -cellProc #------------------------------------------------------------------------------ diff --git a/tutorials/modules/incompressibleFluid/movingCone/system/controlDict b/tutorials/modules/incompressibleFluid/movingCone/system/controlDict index 20cd7c57c7..baa4b5bfc2 100644 --- a/tutorials/modules/incompressibleFluid/movingCone/system/controlDict +++ b/tutorials/modules/incompressibleFluid/movingCone/system/controlDict @@ -34,7 +34,7 @@ writeInterval 1e-4; purgeWrite 0; -writeFormat binary; +writeFormat ascii; writePrecision 6; diff --git a/tutorials/modules/incompressibleFluid/movingCone/system/decomposeParDict b/tutorials/modules/incompressibleFluid/movingCone/system/decomposeParDict.orig similarity index 85% rename from tutorials/modules/incompressibleFluid/movingCone/system/decomposeParDict rename to tutorials/modules/incompressibleFluid/movingCone/system/decomposeParDict.orig index eeda159389..b83861d2e6 100644 --- a/tutorials/modules/incompressibleFluid/movingCone/system/decomposeParDict +++ b/tutorials/modules/incompressibleFluid/movingCone/system/decomposeParDict.orig @@ -18,25 +18,10 @@ numberOfSubdomains 4; method hierarchical; -simpleCoeffs -{ - n (2 1 1); -} - hierarchicalCoeffs { n (4 1 1); order xyz; } -manualCoeffs -{ - dataFile ""; -} - -distributed no; - -roots ( ); - - // ************************************************************************* // diff --git a/tutorials/modules/incompressibleFluid/movingCone/system/blockMeshDict_0.0015 b/tutorials/modules/incompressibleFluid/movingCone/system/meshToMesh_0.0015/blockMeshDict similarity index 100% rename from tutorials/modules/incompressibleFluid/movingCone/system/blockMeshDict_0.0015 rename to tutorials/modules/incompressibleFluid/movingCone/system/meshToMesh_0.0015/blockMeshDict diff --git a/tutorials/modules/incompressibleFluid/movingCone/system/decomposeParDict_0.0015 b/tutorials/modules/incompressibleFluid/movingCone/system/meshToMesh_0.0015/decomposeParDict similarity index 77% rename from tutorials/modules/incompressibleFluid/movingCone/system/decomposeParDict_0.0015 rename to tutorials/modules/incompressibleFluid/movingCone/system/meshToMesh_0.0015/decomposeParDict index 9a200b8a99..1d575ea9c8 100644 --- a/tutorials/modules/incompressibleFluid/movingCone/system/decomposeParDict_0.0015 +++ b/tutorials/modules/incompressibleFluid/movingCone/system/meshToMesh_0.0015/decomposeParDict @@ -18,25 +18,4 @@ numberOfSubdomains 4; method scotch; -simpleCoeffs -{ - n (2 1 1); -} - -hierarchicalCoeffs -{ - n (4 1 1); - order xyz; -} - -manualCoeffs -{ - dataFile ""; -} - -distributed no; - -roots ( ); - - // ************************************************************************* // diff --git a/tutorials/modules/incompressibleFluid/movingCone/system/blockMeshDict_0.003 b/tutorials/modules/incompressibleFluid/movingCone/system/meshToMesh_0.003/blockMeshDict similarity index 100% rename from tutorials/modules/incompressibleFluid/movingCone/system/blockMeshDict_0.003 rename to tutorials/modules/incompressibleFluid/movingCone/system/meshToMesh_0.003/blockMeshDict diff --git a/tutorials/modules/shockFluid/movingCone/system/decomposeParDict_2e-05 b/tutorials/modules/incompressibleFluid/movingCone/system/meshToMesh_0.003/decomposeParDict similarity index 85% rename from tutorials/modules/shockFluid/movingCone/system/decomposeParDict_2e-05 rename to tutorials/modules/incompressibleFluid/movingCone/system/meshToMesh_0.003/decomposeParDict index 32f6bb75e1..becf428718 100644 --- a/tutorials/modules/shockFluid/movingCone/system/decomposeParDict_2e-05 +++ b/tutorials/modules/incompressibleFluid/movingCone/system/meshToMesh_0.003/decomposeParDict @@ -18,25 +18,10 @@ numberOfSubdomains 4; method hierarchical; -simpleCoeffs -{ - n (2 1 1); -} - hierarchicalCoeffs { n (2 2 1); order xyz; } -manualCoeffs -{ - dataFile ""; -} - -distributed no; - -roots ( ); - - // ************************************************************************* // diff --git a/tutorials/modules/shockFluid/movingCone/Allrun b/tutorials/modules/shockFluid/movingCone/Allrun index d36e85b4bd..88cfccdcbb 100755 --- a/tutorials/modules/shockFluid/movingCone/Allrun +++ b/tutorials/modules/shockFluid/movingCone/Allrun @@ -4,22 +4,13 @@ cd ${0%/*} || exit 1 # Run from this directory # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions -application=$(getApplication) - -mapTimes="1e-05 2e-05" - -# Iterate the string variable using for loop -for mapTime in $mapTimes; do - - runApplication -a blockMesh -dict blockMeshDict_$mapTime - rm -rf constant/meshToMesh_$mapTime - mkdir constant/meshToMesh_$mapTime - mv constant/polyMesh constant/meshToMesh_$mapTime +runApplication blockMesh +for mapTime in 1e-05 2e-05 +do + runApplication -s $mapTime blockMesh -region meshToMesh_$mapTime done -runApplication -a blockMesh - -runApplication $application +runApplication $(getApplication) #------------------------------------------------------------------------------ diff --git a/tutorials/modules/shockFluid/movingCone/Allrun-parallel b/tutorials/modules/shockFluid/movingCone/Allrun-parallel index fe26befd2b..3f1f898db0 100755 --- a/tutorials/modules/shockFluid/movingCone/Allrun-parallel +++ b/tutorials/modules/shockFluid/movingCone/Allrun-parallel @@ -4,40 +4,18 @@ cd ${0%/*} || exit 1 # Run from this directory # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions -mapTimes="1e-05 2e-05" - -# Iterate the string variable using for loop -for mapTime in $mapTimes; do - - runApplication -a blockMesh -dict blockMeshDict_$mapTime - runApplication -a decomposePar -force -noFields -dict decomposeParDict_$mapTime - - rm -rf constant/meshToMesh_$mapTime - mkdir constant/meshToMesh_$mapTime - - for procI in processor* - do - mv $procI/constant/polyMesh constant/meshToMesh_$mapTime/$procI - done - - mv constant/polyMesh constant/meshToMesh_$mapTime - -done - -runApplication -a blockMesh -dict blockMeshDict -runApplication -a decomposePar -force - -for mapTime in $mapTimes; do - - for procI in processor* - do - mkdir $procI/constant/meshToMesh_$mapTime - mv constant/meshToMesh_$mapTime/$procI $procI/constant/meshToMesh_$mapTime/polyMesh - done +runApplication blockMesh +runApplication decomposePar -cellProc +for mapTime in 1e-05 2e-05 +do + runApplication -s $mapTime blockMesh -region meshToMesh_$mapTime + ln -s meshToMesh_$mapTime/decomposeParDict system/decomposeParDict + runApplication -s $mapTime decomposePar -region meshToMesh_$mapTime + rm -f system/decomposeParDict done runParallel $(getApplication) -runApplication reconstructPar +runApplication reconstructPar -cellProc #------------------------------------------------------------------------------ diff --git a/tutorials/modules/shockFluid/movingCone/U b/tutorials/modules/shockFluid/movingCone/U deleted file mode 100644 index 4a34324300..0000000000 --- a/tutorials/modules/shockFluid/movingCone/U +++ /dev/null @@ -1,52 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class volVectorField; - object U; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 1 -1 0 0 0 0]; - -internalField uniform (0 0 0); - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - movingWall - { - type movingWallVelocity; - value $internalField; - } - - farFieldMoving - { - type noSlip; - } - - fixedWall - { - type noSlip; - } - - left - { - type pressureInletOutletVelocity; - value $internalField; - } - - farField - { - type noSlip; - } -} - -// ************************************************************************* // diff --git a/tutorials/modules/shockFluid/movingCone/pointMotionUx b/tutorials/modules/shockFluid/movingCone/pointMotionUx deleted file mode 100644 index 16a2d72c02..0000000000 --- a/tutorials/modules/shockFluid/movingCone/pointMotionUx +++ /dev/null @@ -1,54 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class pointScalarField; - object pointMotionUx; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 1 -1 0 0 0 0]; - -internalField uniform 0; - -boundaryField -{ - #includeEtc "caseDicts/setConstraintTypes" - - movingWall - { - type uniformFixedValue; - uniformValue constant 1; - } - - farFieldMoving - { - type uniformFixedValue; - uniformValue constant 1; - } - - fixedWall - { - type uniformFixedValue; - uniformValue constant 0; - } - - left - { - type uniformFixedValue; - uniformValue constant 0; - } - - farField - { - type slip; - } -} - -// ************************************************************************* // diff --git a/tutorials/modules/shockFluid/movingCone/system/controlDict b/tutorials/modules/shockFluid/movingCone/system/controlDict index a41dfb68be..b5cab7457c 100644 --- a/tutorials/modules/shockFluid/movingCone/system/controlDict +++ b/tutorials/modules/shockFluid/movingCone/system/controlDict @@ -24,7 +24,7 @@ startTime 0; stopAt endTime; -endTime 0.00002; +endTime 2.25e-05; deltaT 1e-08; diff --git a/tutorials/modules/shockFluid/movingCone/system/decomposeParDict b/tutorials/modules/shockFluid/movingCone/system/decomposeParDict.orig similarity index 85% rename from tutorials/modules/shockFluid/movingCone/system/decomposeParDict rename to tutorials/modules/shockFluid/movingCone/system/decomposeParDict.orig index eeda159389..b83861d2e6 100644 --- a/tutorials/modules/shockFluid/movingCone/system/decomposeParDict +++ b/tutorials/modules/shockFluid/movingCone/system/decomposeParDict.orig @@ -18,25 +18,10 @@ numberOfSubdomains 4; method hierarchical; -simpleCoeffs -{ - n (2 1 1); -} - hierarchicalCoeffs { n (4 1 1); order xyz; } -manualCoeffs -{ - dataFile ""; -} - -distributed no; - -roots ( ); - - // ************************************************************************* // diff --git a/tutorials/modules/shockFluid/movingCone/system/blockMeshDict_1e-05 b/tutorials/modules/shockFluid/movingCone/system/meshToMesh_1e-05/blockMeshDict similarity index 100% rename from tutorials/modules/shockFluid/movingCone/system/blockMeshDict_1e-05 rename to tutorials/modules/shockFluid/movingCone/system/meshToMesh_1e-05/blockMeshDict diff --git a/tutorials/modules/shockFluid/movingCone/system/decomposeParDict_1e-05 b/tutorials/modules/shockFluid/movingCone/system/meshToMesh_1e-05/decomposeParDict similarity index 77% rename from tutorials/modules/shockFluid/movingCone/system/decomposeParDict_1e-05 rename to tutorials/modules/shockFluid/movingCone/system/meshToMesh_1e-05/decomposeParDict index 9a200b8a99..1d575ea9c8 100644 --- a/tutorials/modules/shockFluid/movingCone/system/decomposeParDict_1e-05 +++ b/tutorials/modules/shockFluid/movingCone/system/meshToMesh_1e-05/decomposeParDict @@ -18,25 +18,4 @@ numberOfSubdomains 4; method scotch; -simpleCoeffs -{ - n (2 1 1); -} - -hierarchicalCoeffs -{ - n (4 1 1); - order xyz; -} - -manualCoeffs -{ - dataFile ""; -} - -distributed no; - -roots ( ); - - // ************************************************************************* // diff --git a/tutorials/modules/shockFluid/movingCone/system/blockMeshDict_2e-05 b/tutorials/modules/shockFluid/movingCone/system/meshToMesh_2e-05/blockMeshDict similarity index 100% rename from tutorials/modules/shockFluid/movingCone/system/blockMeshDict_2e-05 rename to tutorials/modules/shockFluid/movingCone/system/meshToMesh_2e-05/blockMeshDict diff --git a/tutorials/modules/incompressibleFluid/movingCone/system/decomposeParDict_0.003 b/tutorials/modules/shockFluid/movingCone/system/meshToMesh_2e-05/decomposeParDict similarity index 85% rename from tutorials/modules/incompressibleFluid/movingCone/system/decomposeParDict_0.003 rename to tutorials/modules/shockFluid/movingCone/system/meshToMesh_2e-05/decomposeParDict index 32f6bb75e1..becf428718 100644 --- a/tutorials/modules/incompressibleFluid/movingCone/system/decomposeParDict_0.003 +++ b/tutorials/modules/shockFluid/movingCone/system/meshToMesh_2e-05/decomposeParDict @@ -18,25 +18,10 @@ numberOfSubdomains 4; method hierarchical; -simpleCoeffs -{ - n (2 1 1); -} - hierarchicalCoeffs { n (2 2 1); order xyz; } -manualCoeffs -{ - dataFile ""; -} - -distributed no; - -roots ( ); - - // ************************************************************************* //