From 9d26b25c460652156c6c497cc41e9c8d8ddc5d17 Mon Sep 17 00:00:00 2001 From: Mark Olesen <Mark.Olesen@esi-group.com> Date: Wed, 28 Jul 2021 09:54:19 +0200 Subject: [PATCH] TUT: multi-world tutorial setup with circular connectivity --- applications/test/multiWorld/left/0/T | 80 ------------- applications/test/multiWorld/mpirun.schema | 2 - .../test/multiWorld/mpirun_left_right.schema | 2 - applications/test/multiWorld/right/0/T | 79 ------------- .../right/constant/transportProperties | 1 - .../laplacianFoam/multiWorld/mpirun.schema | 2 - .../right/constant/transportProperties | 1 - .../basic/laplacianFoam/multiWorld1}/Allclean | 8 +- .../{multiWorld => multiWorld1}/Allrun | 22 ++-- .../multiWorld1/Allrun.addDatabase | 30 +++++ .../{multiWorld => multiWorld1}/Allrun.pre | 12 +- .../Allrun.pre-parallel | 2 +- .../common}/constant/transportProperties | 0 .../common/system/controlDict | 0 .../common/system/decomposeParDict | 0 .../common/system/fvSchemes | 0 .../common/system/fvSolution | 0 .../{multiWorld => multiWorld1}/left/0.orig/T | 2 +- .../left/constant/transportProperties | 1 + .../left/system/blockMeshDict | 0 .../multiWorld1}/left/system/controlDict | 0 .../multiWorld1}/left/system/decomposeParDict | 0 .../multiWorld1}/left/system/fvSchemes | 0 .../multiWorld1}/left/system/fvSolution | 0 .../laplacianFoam/multiWorld1/list-worlds | 6 + .../laplacianFoam/multiWorld1/mpirun.schema | 2 + .../mpirun_worlds.schema} | 0 .../right/0.orig/T | 2 +- .../right/constant/transportProperties | 1 + .../right/system/blockMeshDict | 0 .../multiWorld1}/right/system/controlDict | 0 .../right/system/decomposeParDict | 0 .../multiWorld1}/right/system/fvSchemes | 0 .../multiWorld1}/right/system/fvSolution | 0 .../laplacianFoam/multiWorld1}/run_world.sh | 8 +- .../{multiWorld => multiWorld2}/Allclean | 8 +- .../basic/laplacianFoam/multiWorld2}/Allrun | 22 ++-- .../multiWorld2/Allrun.addDatabase | 30 +++++ .../laplacianFoam/multiWorld2/Allrun.pre | 15 ++- .../common}/constant/transportProperties | 2 +- .../multiWorld2}/common/system/controlDict | 6 +- .../common/system/decomposeParDict | 0 .../multiWorld2}/common/system/fvSchemes | 2 +- .../multiWorld2}/common/system/fvSolution | 2 +- .../laplacianFoam/multiWorld2/list-worlds | 6 + .../laplacianFoam/multiWorld2/load-worlds.py | 67 +++++++++++ .../multiWorld2/mpirun_full.schema | 5 + .../{multiWorld => multiWorld2}/run_world.sh | 14 +-- .../laplacianFoam/multiWorld2/slab1/0.orig/T | 87 ++++++++++++++ .../slab1/constant/transportProperties | 1 + .../multiWorld2/slab1/system/blockMeshDict | 84 ++++++++++++++ .../slab1}/system/controlDict | 0 .../slab1}/system/decomposeParDict | 0 .../slab1}/system/fvSchemes | 0 .../slab1}/system/fvSolution | 0 .../laplacianFoam/multiWorld2/slab2/0.orig/T | 94 +++++++++++++++ .../slab2/constant/transportProperties | 1 + .../multiWorld2/slab2}/system/blockMeshDict | 90 +++++++-------- .../slab2}/system/controlDict | 0 .../slab2}/system/decomposeParDict | 0 .../slab2}/system/fvSchemes | 0 .../slab2}/system/fvSolution | 0 .../laplacianFoam/multiWorld2/slab3/0.orig/T | 88 ++++++++++++++ .../slab3/constant/transportProperties | 1 + .../multiWorld2/slab3/system/blockMeshDict | 83 +++++++++++++ .../multiWorld2/slab3/system/controlDict | 1 + .../multiWorld2/slab3/system/decomposeParDict | 1 + .../multiWorld2/slab3/system/fvSchemes | 1 + .../multiWorld2/slab3/system/fvSolution | 1 + .../laplacianFoam/multiWorld2/slab4/0.orig/T | 87 ++++++++++++++ .../slab4/constant/transportProperties | 1 + .../multiWorld2/slab4/system/blockMeshDict | 83 +++++++++++++ .../multiWorld2/slab4/system/controlDict | 1 + .../multiWorld2/slab4/system/decomposeParDict | 1 + .../multiWorld2/slab4/system/fvSchemes | 1 + .../multiWorld2/slab4/system/fvSolution | 1 + .../laplacianFoam/multiWorld2/top/0.orig/T | 109 ++++++++++++++++++ .../laplacianFoam/multiWorld2/top}/Allrun.pre | 12 +- .../top/constant/transportProperties | 1 + .../multiWorld2/top}/system/blockMeshDict | 89 +++++++------- .../multiWorld2/top/system/controlDict | 1 + .../multiWorld2/top/system/createPatchDict | 55 +++++++++ .../multiWorld2/top/system/decomposeParDict | 1 + .../multiWorld2/top/system/fvSchemes | 1 + .../multiWorld2/top/system/fvSolution | 1 + .../top/system/topoSetDict.patches | 71 ++++++++++++ 86 files changed, 1168 insertions(+), 323 deletions(-) delete mode 100644 applications/test/multiWorld/left/0/T delete mode 100644 applications/test/multiWorld/mpirun.schema delete mode 100644 applications/test/multiWorld/mpirun_left_right.schema delete mode 100644 applications/test/multiWorld/right/0/T delete mode 120000 applications/test/multiWorld/right/constant/transportProperties delete mode 100644 tutorials/basic/laplacianFoam/multiWorld/mpirun.schema delete mode 120000 tutorials/basic/laplacianFoam/multiWorld/right/constant/transportProperties rename {applications/test/multiWorld => tutorials/basic/laplacianFoam/multiWorld1}/Allclean (71%) rename tutorials/basic/laplacianFoam/{multiWorld => multiWorld1}/Allrun (60%) create mode 100755 tutorials/basic/laplacianFoam/multiWorld1/Allrun.addDatabase rename tutorials/basic/laplacianFoam/{multiWorld => multiWorld1}/Allrun.pre (68%) rename tutorials/basic/laplacianFoam/{multiWorld => multiWorld1}/Allrun.pre-parallel (93%) rename tutorials/basic/laplacianFoam/{multiWorld/left => multiWorld1/common}/constant/transportProperties (100%) rename tutorials/basic/laplacianFoam/{multiWorld => multiWorld1}/common/system/controlDict (100%) rename tutorials/basic/laplacianFoam/{multiWorld => multiWorld1}/common/system/decomposeParDict (100%) rename tutorials/basic/laplacianFoam/{multiWorld => multiWorld1}/common/system/fvSchemes (100%) rename tutorials/basic/laplacianFoam/{multiWorld => multiWorld1}/common/system/fvSolution (100%) rename tutorials/basic/laplacianFoam/{multiWorld => multiWorld1}/left/0.orig/T (98%) create mode 120000 tutorials/basic/laplacianFoam/multiWorld1/left/constant/transportProperties rename tutorials/basic/laplacianFoam/{multiWorld => multiWorld1}/left/system/blockMeshDict (100%) rename {applications/test/multiWorld => tutorials/basic/laplacianFoam/multiWorld1}/left/system/controlDict (100%) rename {applications/test/multiWorld => tutorials/basic/laplacianFoam/multiWorld1}/left/system/decomposeParDict (100%) rename {applications/test/multiWorld => tutorials/basic/laplacianFoam/multiWorld1}/left/system/fvSchemes (100%) rename {applications/test/multiWorld => tutorials/basic/laplacianFoam/multiWorld1}/left/system/fvSolution (100%) create mode 100755 tutorials/basic/laplacianFoam/multiWorld1/list-worlds create mode 100644 tutorials/basic/laplacianFoam/multiWorld1/mpirun.schema rename tutorials/basic/laplacianFoam/{multiWorld/mpirun_left_right.schema => multiWorld1/mpirun_worlds.schema} (100%) rename tutorials/basic/laplacianFoam/{multiWorld => multiWorld1}/right/0.orig/T (98%) create mode 120000 tutorials/basic/laplacianFoam/multiWorld1/right/constant/transportProperties rename tutorials/basic/laplacianFoam/{multiWorld => multiWorld1}/right/system/blockMeshDict (100%) rename {applications/test/multiWorld => tutorials/basic/laplacianFoam/multiWorld1}/right/system/controlDict (100%) rename {applications/test/multiWorld => tutorials/basic/laplacianFoam/multiWorld1}/right/system/decomposeParDict (100%) rename {applications/test/multiWorld => tutorials/basic/laplacianFoam/multiWorld1}/right/system/fvSchemes (100%) rename {applications/test/multiWorld => tutorials/basic/laplacianFoam/multiWorld1}/right/system/fvSolution (100%) rename {applications/test/multiWorld => tutorials/basic/laplacianFoam/multiWorld1}/run_world.sh (71%) rename tutorials/basic/laplacianFoam/{multiWorld => multiWorld2}/Allclean (71%) rename {applications/test/multiWorld => tutorials/basic/laplacianFoam/multiWorld2}/Allrun (52%) create mode 100755 tutorials/basic/laplacianFoam/multiWorld2/Allrun.addDatabase rename applications/test/multiWorld/Allrun.pre-parallel => tutorials/basic/laplacianFoam/multiWorld2/Allrun.pre (58%) rename {applications/test/multiWorld/left => tutorials/basic/laplacianFoam/multiWorld2/common}/constant/transportProperties (92%) rename {applications/test/multiWorld => tutorials/basic/laplacianFoam/multiWorld2}/common/system/controlDict (94%) rename {applications/test/multiWorld => tutorials/basic/laplacianFoam/multiWorld2}/common/system/decomposeParDict (100%) rename {applications/test/multiWorld => tutorials/basic/laplacianFoam/multiWorld2}/common/system/fvSchemes (95%) rename {applications/test/multiWorld => tutorials/basic/laplacianFoam/multiWorld2}/common/system/fvSolution (93%) create mode 100755 tutorials/basic/laplacianFoam/multiWorld2/list-worlds create mode 100644 tutorials/basic/laplacianFoam/multiWorld2/load-worlds.py create mode 100644 tutorials/basic/laplacianFoam/multiWorld2/mpirun_full.schema rename tutorials/basic/laplacianFoam/{multiWorld => multiWorld2}/run_world.sh (58%) create mode 100644 tutorials/basic/laplacianFoam/multiWorld2/slab1/0.orig/T create mode 120000 tutorials/basic/laplacianFoam/multiWorld2/slab1/constant/transportProperties create mode 100644 tutorials/basic/laplacianFoam/multiWorld2/slab1/system/blockMeshDict rename tutorials/basic/laplacianFoam/{multiWorld/left => multiWorld2/slab1}/system/controlDict (100%) rename tutorials/basic/laplacianFoam/{multiWorld/left => multiWorld2/slab1}/system/decomposeParDict (100%) rename tutorials/basic/laplacianFoam/{multiWorld/left => multiWorld2/slab1}/system/fvSchemes (100%) rename tutorials/basic/laplacianFoam/{multiWorld/left => multiWorld2/slab1}/system/fvSolution (100%) create mode 100644 tutorials/basic/laplacianFoam/multiWorld2/slab2/0.orig/T create mode 120000 tutorials/basic/laplacianFoam/multiWorld2/slab2/constant/transportProperties rename {applications/test/multiWorld/right => tutorials/basic/laplacianFoam/multiWorld2/slab2}/system/blockMeshDict (51%) rename tutorials/basic/laplacianFoam/{multiWorld/right => multiWorld2/slab2}/system/controlDict (100%) rename tutorials/basic/laplacianFoam/{multiWorld/right => multiWorld2/slab2}/system/decomposeParDict (100%) rename tutorials/basic/laplacianFoam/{multiWorld/right => multiWorld2/slab2}/system/fvSchemes (100%) rename tutorials/basic/laplacianFoam/{multiWorld/right => multiWorld2/slab2}/system/fvSolution (100%) create mode 100644 tutorials/basic/laplacianFoam/multiWorld2/slab3/0.orig/T create mode 120000 tutorials/basic/laplacianFoam/multiWorld2/slab3/constant/transportProperties create mode 100644 tutorials/basic/laplacianFoam/multiWorld2/slab3/system/blockMeshDict create mode 120000 tutorials/basic/laplacianFoam/multiWorld2/slab3/system/controlDict create mode 120000 tutorials/basic/laplacianFoam/multiWorld2/slab3/system/decomposeParDict create mode 120000 tutorials/basic/laplacianFoam/multiWorld2/slab3/system/fvSchemes create mode 120000 tutorials/basic/laplacianFoam/multiWorld2/slab3/system/fvSolution create mode 100644 tutorials/basic/laplacianFoam/multiWorld2/slab4/0.orig/T create mode 120000 tutorials/basic/laplacianFoam/multiWorld2/slab4/constant/transportProperties create mode 100644 tutorials/basic/laplacianFoam/multiWorld2/slab4/system/blockMeshDict create mode 120000 tutorials/basic/laplacianFoam/multiWorld2/slab4/system/controlDict create mode 120000 tutorials/basic/laplacianFoam/multiWorld2/slab4/system/decomposeParDict create mode 120000 tutorials/basic/laplacianFoam/multiWorld2/slab4/system/fvSchemes create mode 120000 tutorials/basic/laplacianFoam/multiWorld2/slab4/system/fvSolution create mode 100644 tutorials/basic/laplacianFoam/multiWorld2/top/0.orig/T rename {applications/test/multiWorld => tutorials/basic/laplacianFoam/multiWorld2/top}/Allrun.pre (72%) create mode 120000 tutorials/basic/laplacianFoam/multiWorld2/top/constant/transportProperties rename {applications/test/multiWorld/left => tutorials/basic/laplacianFoam/multiWorld2/top}/system/blockMeshDict (55%) create mode 120000 tutorials/basic/laplacianFoam/multiWorld2/top/system/controlDict create mode 100644 tutorials/basic/laplacianFoam/multiWorld2/top/system/createPatchDict create mode 120000 tutorials/basic/laplacianFoam/multiWorld2/top/system/decomposeParDict create mode 120000 tutorials/basic/laplacianFoam/multiWorld2/top/system/fvSchemes create mode 120000 tutorials/basic/laplacianFoam/multiWorld2/top/system/fvSolution create mode 100644 tutorials/basic/laplacianFoam/multiWorld2/top/system/topoSetDict.patches diff --git a/applications/test/multiWorld/left/0/T b/applications/test/multiWorld/left/0/T deleted file mode 100644 index a03c1499991..00000000000 --- a/applications/test/multiWorld/left/0/T +++ /dev/null @@ -1,80 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: v2106 | -| \\ / 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 1; - -boundaryField -{ - coupled - { - //type mappedField; - type mappedMixedField; - - // What to sample: - sampleMode nearestPatchFace; - - // Simulation world to sample - sampleWorld RIGHT; - - // Region to sample - sampleRegion region0; - - // If sampleMode is nearestPatchFace : patch to find faces of - samplePatch coupled; - - // Use database to get data from (one-way or loose coupling in - // combination with functionObject) - //sampleDatabase false; //true; - - // According to offsetMode (see above) supply one of - // offset, offsets or distance - offset (0 0 0); - - value uniform 0.0; - - - // For mappedMixed - //weightField DTV; - refValue $value; - refGradient uniform 0.0; - valueFraction uniform 1.0; - } - - top - { - type zeroGradient; - } - - bottom - { - type zeroGradient; - } - - left - { - type fixedValue; - value uniform 1; - } - - frontAndBack - { - type empty; - } -} - -// ************************************************************************* // diff --git a/applications/test/multiWorld/mpirun.schema b/applications/test/multiWorld/mpirun.schema deleted file mode 100644 index 49aadf442ee..00000000000 --- a/applications/test/multiWorld/mpirun.schema +++ /dev/null @@ -1,2 +0,0 @@ --np 2 laplacianFoam -case left -world LEFT -parallel --np 2 laplacianFoam -case right -world RIGHT -parallel diff --git a/applications/test/multiWorld/mpirun_left_right.schema b/applications/test/multiWorld/mpirun_left_right.schema deleted file mode 100644 index 133e452fb60..00000000000 --- a/applications/test/multiWorld/mpirun_left_right.schema +++ /dev/null @@ -1,2 +0,0 @@ --np 1 xterm -font fixed -title left -geometry 200x15+0+0 -e ./run_world.sh left --np 1 xterm -font fixed -title right -geometry 200x15+0+200 -e ./run_world.sh right diff --git a/applications/test/multiWorld/right/0/T b/applications/test/multiWorld/right/0/T deleted file mode 100644 index eb9be91317e..00000000000 --- a/applications/test/multiWorld/right/0/T +++ /dev/null @@ -1,79 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: v2106 | -| \\ / 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 0; - -boundaryField -{ - coupled - { - //type mappedField; - type mappedMixedField; - - // What to sample: - sampleMode nearestPatchFace; - - // Simulation world to sample - sampleWorld LEFT; - - // Region to sample - sampleRegion region0; - - // If sampleMode is nearestPatchFace : patch to find faces of - samplePatch coupled; - - // Use database to get data from (one-way or loose coupling in - // combination with functionObject) - //sampleDatabase false; //true; - - // According to offsetMode (see above) supply one of - // offset, offsets or distance - offset (0 0 0); - - value uniform 1.1; - - // For mappedMixed - //weightField DTV; - refValue $value; - refGradient uniform 0.0; - valueFraction uniform 1.0; - } - - top - { - type zeroGradient; - } - - bottom - { - type zeroGradient; - } - - right - { - type fixedValue; - value uniform 0; - } - - frontAndBack - { - type empty; - } -} - -// ************************************************************************* // diff --git a/applications/test/multiWorld/right/constant/transportProperties b/applications/test/multiWorld/right/constant/transportProperties deleted file mode 120000 index d0e9cc0e1ca..00000000000 --- a/applications/test/multiWorld/right/constant/transportProperties +++ /dev/null @@ -1 +0,0 @@ -../../left/constant/transportProperties \ No newline at end of file diff --git a/tutorials/basic/laplacianFoam/multiWorld/mpirun.schema b/tutorials/basic/laplacianFoam/multiWorld/mpirun.schema deleted file mode 100644 index cc3c3af9f1c..00000000000 --- a/tutorials/basic/laplacianFoam/multiWorld/mpirun.schema +++ /dev/null @@ -1,2 +0,0 @@ --np 2 laplacianFoam -case left -world LEFT -parallel --np 2 laplacianFoam -case right -world RIGHT -parallel diff --git a/tutorials/basic/laplacianFoam/multiWorld/right/constant/transportProperties b/tutorials/basic/laplacianFoam/multiWorld/right/constant/transportProperties deleted file mode 120000 index d0e9cc0e1ca..00000000000 --- a/tutorials/basic/laplacianFoam/multiWorld/right/constant/transportProperties +++ /dev/null @@ -1 +0,0 @@ -../../left/constant/transportProperties \ No newline at end of file diff --git a/applications/test/multiWorld/Allclean b/tutorials/basic/laplacianFoam/multiWorld1/Allclean similarity index 71% rename from applications/test/multiWorld/Allclean rename to tutorials/basic/laplacianFoam/multiWorld1/Allclean index 336db413851..4512a2f0dcc 100755 --- a/applications/test/multiWorld/Allclean +++ b/tutorials/basic/laplacianFoam/multiWorld1/Allclean @@ -3,12 +3,14 @@ cd "${0%/*}" || exit # Run from this directory . ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions #------------------------------------------------------------------------------ -for subcase in left right +for subcase in $(./list-worlds) do ( - cd "$subcase" && cleanCase + cd "$subcase" || exit + cleanCase0 + rm -f *_mapped.obj 2>/dev/null ) done -rm -f log.* +rm -rf log.* 2>/dev/null #------------------------------------------------------------------------------ diff --git a/tutorials/basic/laplacianFoam/multiWorld/Allrun b/tutorials/basic/laplacianFoam/multiWorld1/Allrun similarity index 60% rename from tutorials/basic/laplacianFoam/multiWorld/Allrun rename to tutorials/basic/laplacianFoam/multiWorld1/Allrun index 4ad24b00fe1..73f3d91f7d7 100755 --- a/tutorials/basic/laplacianFoam/multiWorld/Allrun +++ b/tutorials/basic/laplacianFoam/multiWorld1/Allrun @@ -5,25 +5,19 @@ cd "${0%/*}" || exit # Run from this directory # Run serial ./Allrun.pre -mpirun -app ./mpirun_left_right.schema +echo "Begin run" +mpirun -app ./mpirun_worlds.schema # Run with database -mv -f log.run_left* log.run_right* - -for subcase in left right -do -( - cd "$subcase" || exit - foamListTimes -rm - restore0Dir - foamDictionary 0/T -entry boundaryField.coupled.sampleDatabase -add true -) -done - -mpirun -app ./mpirun_left_right.schema +./Allrun.addDatabase +mv -f log.run_* 2>/dev/null +echo "Begin run with database" +mpirun -app ./mpirun_worlds.schema ## Run parallel ## ./Allrun.pre-parallel ## mpirun -app ./mpirun.schema +echo "End" + #------------------------------------------------------------------------------ diff --git a/tutorials/basic/laplacianFoam/multiWorld1/Allrun.addDatabase b/tutorials/basic/laplacianFoam/multiWorld1/Allrun.addDatabase new file mode 100755 index 00000000000..17ba9cf53dd --- /dev/null +++ b/tutorials/basic/laplacianFoam/multiWorld1/Allrun.addDatabase @@ -0,0 +1,30 @@ +#!/bin/sh +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions +#------------------------------------------------------------------------------ + +# Running with database +for subcase in $(./list-worlds) +do +( + cd "$subcase" || exit + foamListTimes -rm + restore0Dir + + dictFile="0/T" + + for patch in $(foamDictionary "$dictFile" -keywords -entry boundaryField) + do + patchType="$(foamDictionary "$dictFile" -value -entry boundaryField/"$patch"/type)" + + case "$patchType" in + (mapped*) + foamDictionary "$dictFile" -entry boundaryField/"$patch"/sampleDatabase -add true >/dev/null + echo "Use sampleDatabase: $subcase/$dictFile patch=$patch" + ;; + esac + done +) +done + +#------------------------------------------------------------------------------ diff --git a/tutorials/basic/laplacianFoam/multiWorld/Allrun.pre b/tutorials/basic/laplacianFoam/multiWorld1/Allrun.pre similarity index 68% rename from tutorials/basic/laplacianFoam/multiWorld/Allrun.pre rename to tutorials/basic/laplacianFoam/multiWorld1/Allrun.pre index 61541f6f5f6..05ad890d2a6 100755 --- a/tutorials/basic/laplacianFoam/multiWorld/Allrun.pre +++ b/tutorials/basic/laplacianFoam/multiWorld1/Allrun.pre @@ -4,11 +4,19 @@ cd "${0%/*}" || exit # Run from this directory #------------------------------------------------------------------------------ # Create meshes and initial fields -for subcase in left right +for subcase in $(./list-worlds) do ( cd "$subcase" || exit - runApplication blockMesh && restore0Dir + echo "case=$subcase" + if [ -x ./Allrun.pre ] + then + ./Allrun.pre + else + runApplication blockMesh + fi + restore0Dir + echo ) done diff --git a/tutorials/basic/laplacianFoam/multiWorld/Allrun.pre-parallel b/tutorials/basic/laplacianFoam/multiWorld1/Allrun.pre-parallel similarity index 93% rename from tutorials/basic/laplacianFoam/multiWorld/Allrun.pre-parallel rename to tutorials/basic/laplacianFoam/multiWorld1/Allrun.pre-parallel index d6227536a02..ded773acc38 100755 --- a/tutorials/basic/laplacianFoam/multiWorld/Allrun.pre-parallel +++ b/tutorials/basic/laplacianFoam/multiWorld1/Allrun.pre-parallel @@ -4,7 +4,7 @@ cd "${0%/*}" || exit # Run from this directory #------------------------------------------------------------------------------ # Create meshes and initial fields -for subcase in left right +for subcase in $(./list-worlds) do ( cd "$subcase" || exit diff --git a/tutorials/basic/laplacianFoam/multiWorld/left/constant/transportProperties b/tutorials/basic/laplacianFoam/multiWorld1/common/constant/transportProperties similarity index 100% rename from tutorials/basic/laplacianFoam/multiWorld/left/constant/transportProperties rename to tutorials/basic/laplacianFoam/multiWorld1/common/constant/transportProperties diff --git a/tutorials/basic/laplacianFoam/multiWorld/common/system/controlDict b/tutorials/basic/laplacianFoam/multiWorld1/common/system/controlDict similarity index 100% rename from tutorials/basic/laplacianFoam/multiWorld/common/system/controlDict rename to tutorials/basic/laplacianFoam/multiWorld1/common/system/controlDict diff --git a/tutorials/basic/laplacianFoam/multiWorld/common/system/decomposeParDict b/tutorials/basic/laplacianFoam/multiWorld1/common/system/decomposeParDict similarity index 100% rename from tutorials/basic/laplacianFoam/multiWorld/common/system/decomposeParDict rename to tutorials/basic/laplacianFoam/multiWorld1/common/system/decomposeParDict diff --git a/tutorials/basic/laplacianFoam/multiWorld/common/system/fvSchemes b/tutorials/basic/laplacianFoam/multiWorld1/common/system/fvSchemes similarity index 100% rename from tutorials/basic/laplacianFoam/multiWorld/common/system/fvSchemes rename to tutorials/basic/laplacianFoam/multiWorld1/common/system/fvSchemes diff --git a/tutorials/basic/laplacianFoam/multiWorld/common/system/fvSolution b/tutorials/basic/laplacianFoam/multiWorld1/common/system/fvSolution similarity index 100% rename from tutorials/basic/laplacianFoam/multiWorld/common/system/fvSolution rename to tutorials/basic/laplacianFoam/multiWorld1/common/system/fvSolution diff --git a/tutorials/basic/laplacianFoam/multiWorld/left/0.orig/T b/tutorials/basic/laplacianFoam/multiWorld1/left/0.orig/T similarity index 98% rename from tutorials/basic/laplacianFoam/multiWorld/left/0.orig/T rename to tutorials/basic/laplacianFoam/multiWorld1/left/0.orig/T index f94e100bd8d..ea1ba37ff22 100644 --- a/tutorials/basic/laplacianFoam/multiWorld/left/0.orig/T +++ b/tutorials/basic/laplacianFoam/multiWorld1/left/0.orig/T @@ -29,7 +29,7 @@ boundaryField sampleMode nearestPatchFaceAMI; // Simulation world to sample - sampleWorld RIGHT; + sampleWorld right; // Region to sample sampleRegion region0; diff --git a/tutorials/basic/laplacianFoam/multiWorld1/left/constant/transportProperties b/tutorials/basic/laplacianFoam/multiWorld1/left/constant/transportProperties new file mode 120000 index 00000000000..e6a4e4f7fc5 --- /dev/null +++ b/tutorials/basic/laplacianFoam/multiWorld1/left/constant/transportProperties @@ -0,0 +1 @@ +../../common/constant/transportProperties \ No newline at end of file diff --git a/tutorials/basic/laplacianFoam/multiWorld/left/system/blockMeshDict b/tutorials/basic/laplacianFoam/multiWorld1/left/system/blockMeshDict similarity index 100% rename from tutorials/basic/laplacianFoam/multiWorld/left/system/blockMeshDict rename to tutorials/basic/laplacianFoam/multiWorld1/left/system/blockMeshDict diff --git a/applications/test/multiWorld/left/system/controlDict b/tutorials/basic/laplacianFoam/multiWorld1/left/system/controlDict similarity index 100% rename from applications/test/multiWorld/left/system/controlDict rename to tutorials/basic/laplacianFoam/multiWorld1/left/system/controlDict diff --git a/applications/test/multiWorld/left/system/decomposeParDict b/tutorials/basic/laplacianFoam/multiWorld1/left/system/decomposeParDict similarity index 100% rename from applications/test/multiWorld/left/system/decomposeParDict rename to tutorials/basic/laplacianFoam/multiWorld1/left/system/decomposeParDict diff --git a/applications/test/multiWorld/left/system/fvSchemes b/tutorials/basic/laplacianFoam/multiWorld1/left/system/fvSchemes similarity index 100% rename from applications/test/multiWorld/left/system/fvSchemes rename to tutorials/basic/laplacianFoam/multiWorld1/left/system/fvSchemes diff --git a/applications/test/multiWorld/left/system/fvSolution b/tutorials/basic/laplacianFoam/multiWorld1/left/system/fvSolution similarity index 100% rename from applications/test/multiWorld/left/system/fvSolution rename to tutorials/basic/laplacianFoam/multiWorld1/left/system/fvSolution diff --git a/tutorials/basic/laplacianFoam/multiWorld1/list-worlds b/tutorials/basic/laplacianFoam/multiWorld1/list-worlds new file mode 100755 index 00000000000..536d4dfe2ef --- /dev/null +++ b/tutorials/basic/laplacianFoam/multiWorld1/list-worlds @@ -0,0 +1,6 @@ +#!/bin/sh +#------------------------------------------------------------------------------ + +echo left right + +#------------------------------------------------------------------------------ diff --git a/tutorials/basic/laplacianFoam/multiWorld1/mpirun.schema b/tutorials/basic/laplacianFoam/multiWorld1/mpirun.schema new file mode 100644 index 00000000000..e0ec9b41401 --- /dev/null +++ b/tutorials/basic/laplacianFoam/multiWorld1/mpirun.schema @@ -0,0 +1,2 @@ +-np 2 laplacianFoam -case left -world left -parallel +-np 2 laplacianFoam -case right -world right -parallel diff --git a/tutorials/basic/laplacianFoam/multiWorld/mpirun_left_right.schema b/tutorials/basic/laplacianFoam/multiWorld1/mpirun_worlds.schema similarity index 100% rename from tutorials/basic/laplacianFoam/multiWorld/mpirun_left_right.schema rename to tutorials/basic/laplacianFoam/multiWorld1/mpirun_worlds.schema diff --git a/tutorials/basic/laplacianFoam/multiWorld/right/0.orig/T b/tutorials/basic/laplacianFoam/multiWorld1/right/0.orig/T similarity index 98% rename from tutorials/basic/laplacianFoam/multiWorld/right/0.orig/T rename to tutorials/basic/laplacianFoam/multiWorld1/right/0.orig/T index b98bee77b29..b9521e967aa 100644 --- a/tutorials/basic/laplacianFoam/multiWorld/right/0.orig/T +++ b/tutorials/basic/laplacianFoam/multiWorld1/right/0.orig/T @@ -29,7 +29,7 @@ boundaryField sampleMode nearestPatchFaceAMI; // Simulation world to sample - sampleWorld LEFT; + sampleWorld left; // Region to sample sampleRegion region0; diff --git a/tutorials/basic/laplacianFoam/multiWorld1/right/constant/transportProperties b/tutorials/basic/laplacianFoam/multiWorld1/right/constant/transportProperties new file mode 120000 index 00000000000..e6a4e4f7fc5 --- /dev/null +++ b/tutorials/basic/laplacianFoam/multiWorld1/right/constant/transportProperties @@ -0,0 +1 @@ +../../common/constant/transportProperties \ No newline at end of file diff --git a/tutorials/basic/laplacianFoam/multiWorld/right/system/blockMeshDict b/tutorials/basic/laplacianFoam/multiWorld1/right/system/blockMeshDict similarity index 100% rename from tutorials/basic/laplacianFoam/multiWorld/right/system/blockMeshDict rename to tutorials/basic/laplacianFoam/multiWorld1/right/system/blockMeshDict diff --git a/applications/test/multiWorld/right/system/controlDict b/tutorials/basic/laplacianFoam/multiWorld1/right/system/controlDict similarity index 100% rename from applications/test/multiWorld/right/system/controlDict rename to tutorials/basic/laplacianFoam/multiWorld1/right/system/controlDict diff --git a/applications/test/multiWorld/right/system/decomposeParDict b/tutorials/basic/laplacianFoam/multiWorld1/right/system/decomposeParDict similarity index 100% rename from applications/test/multiWorld/right/system/decomposeParDict rename to tutorials/basic/laplacianFoam/multiWorld1/right/system/decomposeParDict diff --git a/applications/test/multiWorld/right/system/fvSchemes b/tutorials/basic/laplacianFoam/multiWorld1/right/system/fvSchemes similarity index 100% rename from applications/test/multiWorld/right/system/fvSchemes rename to tutorials/basic/laplacianFoam/multiWorld1/right/system/fvSchemes diff --git a/applications/test/multiWorld/right/system/fvSolution b/tutorials/basic/laplacianFoam/multiWorld1/right/system/fvSolution similarity index 100% rename from applications/test/multiWorld/right/system/fvSolution rename to tutorials/basic/laplacianFoam/multiWorld1/right/system/fvSolution diff --git a/applications/test/multiWorld/run_world.sh b/tutorials/basic/laplacianFoam/multiWorld1/run_world.sh similarity index 71% rename from applications/test/multiWorld/run_world.sh rename to tutorials/basic/laplacianFoam/multiWorld1/run_world.sh index 2f2ac9f9761..5e574ef4e26 100755 --- a/applications/test/multiWorld/run_world.sh +++ b/tutorials/basic/laplacianFoam/multiWorld1/run_world.sh @@ -15,9 +15,11 @@ then fi worldCase="$(echo "$world" | tr '[:upper:]' '[:lower:]')" -worldName="$(echo "$world" | tr '[:lower:]' '[:upper:]')" +# worldName="$(echo "$world" | tr '[:lower:]' '[:upper:]')" +worldName="$worldCase" -"$application" -case "$worldCase" -world "$worldName" 2>&1 | tee log.run_"$worldCase" -read dummy +log="log.run_$worldCase" + +"$application" -case "$worldCase" -world "$worldName" > "$log" 2>&1 # ---------------------------------------------------------------------------- diff --git a/tutorials/basic/laplacianFoam/multiWorld/Allclean b/tutorials/basic/laplacianFoam/multiWorld2/Allclean similarity index 71% rename from tutorials/basic/laplacianFoam/multiWorld/Allclean rename to tutorials/basic/laplacianFoam/multiWorld2/Allclean index d9d9ef5636a..4512a2f0dcc 100755 --- a/tutorials/basic/laplacianFoam/multiWorld/Allclean +++ b/tutorials/basic/laplacianFoam/multiWorld2/Allclean @@ -3,12 +3,14 @@ cd "${0%/*}" || exit # Run from this directory . ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions #------------------------------------------------------------------------------ -for subcase in left right +for subcase in $(./list-worlds) do ( - cd "$subcase" && cleanCase0 + cd "$subcase" || exit + cleanCase0 + rm -f *_mapped.obj 2>/dev/null ) done -rm -f log.* +rm -rf log.* 2>/dev/null #------------------------------------------------------------------------------ diff --git a/applications/test/multiWorld/Allrun b/tutorials/basic/laplacianFoam/multiWorld2/Allrun similarity index 52% rename from applications/test/multiWorld/Allrun rename to tutorials/basic/laplacianFoam/multiWorld2/Allrun index a5604a34e68..cc3093f244f 100755 --- a/applications/test/multiWorld/Allrun +++ b/tutorials/basic/laplacianFoam/multiWorld2/Allrun @@ -5,15 +5,19 @@ cd "${0%/*}" || exit # Run from this directory # Run serial ./Allrun.pre -mpirun -app ./mpirun_left_right.schema +echo "Begin run - interworld communication" +mpirun -app ./mpirun_full.schema -## Run parallel -# ./Allrun.pre-parallel -#(cd left && runApplication blockMesh) -#(cd left && runApplication decomposePar) -#(cd right && runApplication blockMesh) -#(cd right && runApplication decomposePar) -# -#mpirun -app ./mpirun.schema +# Run with database +if false +then + ./Allrun.addDatabase + rm -f log.run* 2>/dev/null + echo "Begin run - database data exchange" + mpirun -app ./mpirun_full.schema +fi + +echo "Can load with: paraview --script=load-worlds.py &" +echo "End" #------------------------------------------------------------------------------ diff --git a/tutorials/basic/laplacianFoam/multiWorld2/Allrun.addDatabase b/tutorials/basic/laplacianFoam/multiWorld2/Allrun.addDatabase new file mode 100755 index 00000000000..5b5b26469e6 --- /dev/null +++ b/tutorials/basic/laplacianFoam/multiWorld2/Allrun.addDatabase @@ -0,0 +1,30 @@ +#!/bin/sh +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions +#------------------------------------------------------------------------------ + +# Prepare for running with database +for subcase in $(./list-worlds) +do +( + cd "$subcase" || exit + foamListTimes -rm + restore0Dir + + dictFile="0/T" + + for patch in $(foamDictionary "$dictFile" -keywords -entry boundaryField) + do + patchType="$(foamDictionary "$dictFile" -value -entry boundaryField/"$patch"/type)" + + case "$patchType" in + (mapped*) + foamDictionary "$dictFile" -entry boundaryField/"$patch"/sampleDatabase -add true >/dev/null + echo "Use sampleDatabase: $subcase/$dictFile patch=$patch" + ;; + esac + done +) +done + +#------------------------------------------------------------------------------ diff --git a/applications/test/multiWorld/Allrun.pre-parallel b/tutorials/basic/laplacianFoam/multiWorld2/Allrun.pre similarity index 58% rename from applications/test/multiWorld/Allrun.pre-parallel rename to tutorials/basic/laplacianFoam/multiWorld2/Allrun.pre index eaad67c68b6..928c9e25428 100755 --- a/applications/test/multiWorld/Allrun.pre-parallel +++ b/tutorials/basic/laplacianFoam/multiWorld2/Allrun.pre @@ -3,12 +3,21 @@ cd "${0%/*}" || exit # Run from this directory . ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions #------------------------------------------------------------------------------ -# Create meshes -for subcase in left right +# Create meshes and initial fields +for subcase in $(./list-worlds) do ( cd "$subcase" || exit - runApplication blockMesh + echo "case=$subcase" + if [ -x ./Allrun.pre ] + then + ./Allrun.pre + else + runApplication blockMesh + fi + restore0Dir + touch "$subcase.foam" # paraview + echo ) done diff --git a/applications/test/multiWorld/left/constant/transportProperties b/tutorials/basic/laplacianFoam/multiWorld2/common/constant/transportProperties similarity index 92% rename from applications/test/multiWorld/left/constant/transportProperties rename to tutorials/basic/laplacianFoam/multiWorld2/common/constant/transportProperties index 5bb8a0784a5..fb641eeeb3a 100644 --- a/applications/test/multiWorld/left/constant/transportProperties +++ b/tutorials/basic/laplacianFoam/multiWorld2/common/constant/transportProperties @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: v2106 | +| \\ / O peration | Version: v2112 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ diff --git a/applications/test/multiWorld/common/system/controlDict b/tutorials/basic/laplacianFoam/multiWorld2/common/system/controlDict similarity index 94% rename from applications/test/multiWorld/common/system/controlDict rename to tutorials/basic/laplacianFoam/multiWorld2/common/system/controlDict index aff336cb41b..7ee2771851a 100644 --- a/applications/test/multiWorld/common/system/controlDict +++ b/tutorials/basic/laplacianFoam/multiWorld2/common/system/controlDict @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: v2106 | +| \\ / O peration | Version: v2112 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ @@ -19,9 +19,9 @@ libs (utilityFunctionObjects); DebugSwitches { + multiWorld 1; // mappedPatchBase 1; -// syncObjects 1; - +// syncObjects 2; } diff --git a/applications/test/multiWorld/common/system/decomposeParDict b/tutorials/basic/laplacianFoam/multiWorld2/common/system/decomposeParDict similarity index 100% rename from applications/test/multiWorld/common/system/decomposeParDict rename to tutorials/basic/laplacianFoam/multiWorld2/common/system/decomposeParDict diff --git a/applications/test/multiWorld/common/system/fvSchemes b/tutorials/basic/laplacianFoam/multiWorld2/common/system/fvSchemes similarity index 95% rename from applications/test/multiWorld/common/system/fvSchemes rename to tutorials/basic/laplacianFoam/multiWorld2/common/system/fvSchemes index 6e67d123db9..028412c048b 100644 --- a/applications/test/multiWorld/common/system/fvSchemes +++ b/tutorials/basic/laplacianFoam/multiWorld2/common/system/fvSchemes @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: v2106 | +| \\ / O peration | Version: v2112 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ diff --git a/applications/test/multiWorld/common/system/fvSolution b/tutorials/basic/laplacianFoam/multiWorld2/common/system/fvSolution similarity index 93% rename from applications/test/multiWorld/common/system/fvSolution rename to tutorials/basic/laplacianFoam/multiWorld2/common/system/fvSolution index 737bf06d151..a7c94ca0baf 100644 --- a/applications/test/multiWorld/common/system/fvSolution +++ b/tutorials/basic/laplacianFoam/multiWorld2/common/system/fvSolution @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: v2106 | +| \\ / O peration | Version: v2112 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ diff --git a/tutorials/basic/laplacianFoam/multiWorld2/list-worlds b/tutorials/basic/laplacianFoam/multiWorld2/list-worlds new file mode 100755 index 00000000000..0ca989fc697 --- /dev/null +++ b/tutorials/basic/laplacianFoam/multiWorld2/list-worlds @@ -0,0 +1,6 @@ +#!/bin/sh +#------------------------------------------------------------------------------ + +echo top slab1 slab2 slab3 slab4 + +#------------------------------------------------------------------------------ diff --git a/tutorials/basic/laplacianFoam/multiWorld2/load-worlds.py b/tutorials/basic/laplacianFoam/multiWorld2/load-worlds.py new file mode 100644 index 00000000000..ff80ba41b89 --- /dev/null +++ b/tutorials/basic/laplacianFoam/multiWorld2/load-worlds.py @@ -0,0 +1,67 @@ +#### import the simple module from the paraview +from paraview.simple import * +#### disable automatic camera reset on 'Show' +paraview.simple._DisableFirstRenderCameraReset() + +# get active view +renderView1 = GetActiveViewOrCreate('RenderView') + +useGroup = True +pieces = [] + +# Load all pieces +for worldName in ['top', 'slab1', 'slab2', 'slab3', 'slab4']: + # Could also touch world/world.foam into existence + loadedDir = './' + worldName + '/' + worldName + '.foam' + piece = OpenFOAMReader(registrationName=worldName, FileName=loadedDir) + piece.SkipZeroTime = 0 + piece.Decomposepolyhedra = 0 + piece.MeshRegions = ['internalMesh'] + piece.CellArrays = ['T'] + pieces.append(piece) + +# Set display for all pieces +for piece in pieces: + display = Show(piece, renderView1, 'UnstructuredGridRepresentation') + display.SetRepresentationType('Surface With Edges') + ColorBy(display, ('CELLS', 'T')) + # Show color bar/color legend + display.SetScalarBarVisibility(renderView1, True) + +# ---- +# Group pieces +if useGroup: + # Hide data in view + group1 = GroupDatasets(registrationName='GroupDatasets1', Input=pieces) + + # show data in view + display = Show(group1, renderView1, 'UnstructuredGridRepresentation') + + display.SetRepresentationType('Surface With Edges') + ColorBy(display, ('CELLS', 'T')) + # Show color bar/color legend + display.SetScalarBarVisibility(renderView1, True) + + for piece in pieces: + Hide(piece, renderView1) + +# ---- +# get color transfer function/color map for 'T' +tLUT = GetColorTransferFunction('T') + +# Rescale transfer function +tLUT.RescaleTransferFunction(0.0, 1.2) + +# get opacity transfer function/opacity map for 'T' +tPWF = GetOpacityTransferFunction('T') + +# Rescale transfer function +tPWF.RescaleTransferFunction(0.0, 1.2) + +# reset view to fit data +renderView1.ResetCamera(False) + +# update the view to ensure updated data information +renderView1.Update() + +#================================================================ diff --git a/tutorials/basic/laplacianFoam/multiWorld2/mpirun_full.schema b/tutorials/basic/laplacianFoam/multiWorld2/mpirun_full.schema new file mode 100644 index 00000000000..f2af1722c0c --- /dev/null +++ b/tutorials/basic/laplacianFoam/multiWorld2/mpirun_full.schema @@ -0,0 +1,5 @@ +-np 1 ./run_world.sh top +-np 1 ./run_world.sh slab1 +-np 1 ./run_world.sh slab2 +-np 1 ./run_world.sh slab3 +-np 1 ./run_world.sh slab4 diff --git a/tutorials/basic/laplacianFoam/multiWorld/run_world.sh b/tutorials/basic/laplacianFoam/multiWorld2/run_world.sh similarity index 58% rename from tutorials/basic/laplacianFoam/multiWorld/run_world.sh rename to tutorials/basic/laplacianFoam/multiWorld2/run_world.sh index 2f2ac9f9761..8fe4a93df59 100755 --- a/tutorials/basic/laplacianFoam/multiWorld/run_world.sh +++ b/tutorials/basic/laplacianFoam/multiWorld2/run_world.sh @@ -2,12 +2,6 @@ world="${1:?specify world/case}" application="${2:-laplacianFoam}" -# case "$application" in -# (-test) -# application="Test-multiWorld1" -# ;; -# esac - if [ -z "$application" ] || ! command -v "$application" > /dev/null then echo "No application: $application" @@ -15,9 +9,11 @@ then fi worldCase="$(echo "$world" | tr '[:upper:]' '[:lower:]')" -worldName="$(echo "$world" | tr '[:lower:]' '[:upper:]')" +# worldName="$(echo "$world" | tr '[:lower:]' '[:upper:]')" +worldName="$worldCase" + +log="log.run_$worldCase" -"$application" -case "$worldCase" -world "$worldName" 2>&1 | tee log.run_"$worldCase" -read dummy +"$application" -case "$worldCase" -world "$worldName" > "$log" 2>&1 # ---------------------------------------------------------------------------- diff --git a/tutorials/basic/laplacianFoam/multiWorld2/slab1/0.orig/T b/tutorials/basic/laplacianFoam/multiWorld2/slab1/0.orig/T new file mode 100644 index 00000000000..5cf8ed43c2a --- /dev/null +++ b/tutorials/basic/laplacianFoam/multiWorld2/slab1/0.orig/T @@ -0,0 +1,87 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2112 | +| \\ / 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 0; + +_mappedMixedField +{ + type mappedMixedField; + + // What/how to sample: + sampleMode nearestPatchFaceAMI; + + // Simulation world to sample + // Overwrite -> sampleWorld top; + + // Region to sample + sampleRegion region0; + + // If sampleMode is nearestPatchFace : patch to find faces of + // Overwrite -> samplePatch right_to_left; + + // Use database to get data from (one-way or loose coupling in + // combination with functionObject) + //sampleDatabase false; //true; + + // According to offsetMode (see above) supply one of + // offset, offsets or distance + offset (0 0 0); + + value uniform 0.0; + + // For mappedMixed + //weightField DTV; + refValue $value; + refGradient uniform 0.0; + valueFraction uniform 1.0; +} + +boundaryField +{ + slab1_to_2 + { + $_mappedMixedField; + sampleWorld slab2; + samplePatch slab2_to_1; + } + + left + { + type fixedValue; + value uniform 1; + } + + to_top + { + $_mappedMixedField; + sampleWorld top; + samplePatch top_to_1; + } + + bottom + { + type zeroGradient; + } + + frontAndBack + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/basic/laplacianFoam/multiWorld2/slab1/constant/transportProperties b/tutorials/basic/laplacianFoam/multiWorld2/slab1/constant/transportProperties new file mode 120000 index 00000000000..e6a4e4f7fc5 --- /dev/null +++ b/tutorials/basic/laplacianFoam/multiWorld2/slab1/constant/transportProperties @@ -0,0 +1 @@ +../../common/constant/transportProperties \ No newline at end of file diff --git a/tutorials/basic/laplacianFoam/multiWorld2/slab1/system/blockMeshDict b/tutorials/basic/laplacianFoam/multiWorld2/slab1/system/blockMeshDict new file mode 100644 index 00000000000..8ee7c1603ad --- /dev/null +++ b/tutorials/basic/laplacianFoam/multiWorld2/slab1/system/blockMeshDict @@ -0,0 +1,84 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2112 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +SLAB_OFFSET 0; + +scale 0.1; + +transform +{ + origin (#eval{0.5 * $SLAB_OFFSET} 0 0); + rotation none; +} + +xdim 0.5; +ydim 1; +zdim 0.1; + +vertices +( + (0 0 0) + ($xdim 0 0) + ($xdim $ydim 0) + (0 $ydim 0) + + (0 0 $zdim) + ($xdim 0 $zdim) + ($xdim $ydim $zdim) + (0 $ydim $zdim) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (2 2 1) grading (1 1 1) +); + + +boundary +( + left // left-side (face 0) + { + type wall; + faces ((0 0)); + } + + slab1_to_2 // right-side (face 1) + { + type wall; + faces ((0 1)); + } + + bottom // face 2 + { + type wall; + faces ((0 2)); + } + + to_top // top: face 3 + { + type wall; + faces ((0 3)); + } + + frontAndBack // face 4 5 + { + type empty; + faces ((0 4) (0 5)); + } +); + + +// ************************************************************************* // diff --git a/tutorials/basic/laplacianFoam/multiWorld/left/system/controlDict b/tutorials/basic/laplacianFoam/multiWorld2/slab1/system/controlDict similarity index 100% rename from tutorials/basic/laplacianFoam/multiWorld/left/system/controlDict rename to tutorials/basic/laplacianFoam/multiWorld2/slab1/system/controlDict diff --git a/tutorials/basic/laplacianFoam/multiWorld/left/system/decomposeParDict b/tutorials/basic/laplacianFoam/multiWorld2/slab1/system/decomposeParDict similarity index 100% rename from tutorials/basic/laplacianFoam/multiWorld/left/system/decomposeParDict rename to tutorials/basic/laplacianFoam/multiWorld2/slab1/system/decomposeParDict diff --git a/tutorials/basic/laplacianFoam/multiWorld/left/system/fvSchemes b/tutorials/basic/laplacianFoam/multiWorld2/slab1/system/fvSchemes similarity index 100% rename from tutorials/basic/laplacianFoam/multiWorld/left/system/fvSchemes rename to tutorials/basic/laplacianFoam/multiWorld2/slab1/system/fvSchemes diff --git a/tutorials/basic/laplacianFoam/multiWorld/left/system/fvSolution b/tutorials/basic/laplacianFoam/multiWorld2/slab1/system/fvSolution similarity index 100% rename from tutorials/basic/laplacianFoam/multiWorld/left/system/fvSolution rename to tutorials/basic/laplacianFoam/multiWorld2/slab1/system/fvSolution diff --git a/tutorials/basic/laplacianFoam/multiWorld2/slab2/0.orig/T b/tutorials/basic/laplacianFoam/multiWorld2/slab2/0.orig/T new file mode 100644 index 00000000000..c2cf629f7db --- /dev/null +++ b/tutorials/basic/laplacianFoam/multiWorld2/slab2/0.orig/T @@ -0,0 +1,94 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2112 | +| \\ / 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 0; + +_mappedMixedField +{ + type mappedMixedField; + + // What/how to sample: + sampleMode nearestPatchFaceAMI; + + // Simulation world to sample + // Overwrite -> sampleWorld top; + + // Region to sample + sampleRegion region0; + + // If sampleMode is nearestPatchFace : patch to find faces of + // Overwrite -> samplePatch right_to_left; + + // Use database to get data from (one-way or loose coupling in + // combination with functionObject) + //sampleDatabase false; //true; + + // According to offsetMode (see above) supply one of + // offset, offsets or distance + offset (0 0 0); + + value uniform 0.0; + + // For mappedMixed + //weightField DTV; + refValue $value; + refGradient uniform 0.0; + valueFraction uniform 1.0; +} + +boundaryField +{ + slab2_to_1 + { + $_mappedMixedField; + sampleWorld slab1; + samplePatch slab1_to_2; + } + + slab2_to_3 + { + $_mappedMixedField; + sampleWorld slab3; + samplePatch slab3_to_2; + } + + to_top + { + $_mappedMixedField; + sampleWorld top; + samplePatch top_to_2; + } + + bottom + { + type zeroGradient; + } + + right + { + type fixedValue; + value uniform 0; + } + + frontAndBack + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/basic/laplacianFoam/multiWorld2/slab2/constant/transportProperties b/tutorials/basic/laplacianFoam/multiWorld2/slab2/constant/transportProperties new file mode 120000 index 00000000000..e6a4e4f7fc5 --- /dev/null +++ b/tutorials/basic/laplacianFoam/multiWorld2/slab2/constant/transportProperties @@ -0,0 +1 @@ +../../common/constant/transportProperties \ No newline at end of file diff --git a/applications/test/multiWorld/right/system/blockMeshDict b/tutorials/basic/laplacianFoam/multiWorld2/slab2/system/blockMeshDict similarity index 51% rename from applications/test/multiWorld/right/system/blockMeshDict rename to tutorials/basic/laplacianFoam/multiWorld2/slab2/system/blockMeshDict index e2833174626..c482516dbfe 100644 --- a/applications/test/multiWorld/right/system/blockMeshDict +++ b/tutorials/basic/laplacianFoam/multiWorld2/slab2/system/blockMeshDict @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: v2106 | +| \\ / O peration | Version: v2112 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ @@ -14,76 +14,70 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +SLAB_OFFSET 1; + scale 0.1; +transform +{ + origin (#eval{0.5 * $SLAB_OFFSET} 0 0); + rotation none; +} + +xdim 0.5; +ydim 1; +zdim 0.1; + vertices ( - (0.5 0 0) - (1 0 0) - (1 1 0) - (0.5 1 0) - (0.5 0 0.1) - (1 0 0.1) - (1 1 0.1) - (0.5 1 0.1) -); + (0 0 0) + ($xdim 0 0) + ($xdim $ydim 0) + (0 $ydim 0) -blocks -( - hex (0 1 2 3 4 5 6 7) (2 2 1) simpleGrading (1 1 1) + (0 0 $zdim) + ($xdim 0 $zdim) + ($xdim $ydim $zdim) + (0 $ydim $zdim) ); -edges +blocks ( + hex (0 1 2 3 4 5 6 7) (2 2 1) grading (1 1 1) ); boundary ( - coupled + slab2_to_1 // left-side (face 0) { - type wall; - faces - ( - (0 4 7 3) - ); + type wall; + faces ((0 0)); } - top + + slab2_to_3 // right-side (face 1) { - type wall; - faces - ( - (3 7 6 2) - ); + type wall; + faces ((0 1)); } - bottom + + bottom // face 2 { - type wall; - faces - ( - (1 5 4 0) - ); + type wall; + faces ((0 2)); } - right + + to_top // top: face 3 { - type wall; - faces - ( - (2 6 5 1) - ); + type wall; + faces ((0 3)); } - frontAndBack + + frontAndBack // face 4 5 { - type empty; - faces - ( - (0 3 2 1) - (4 5 6 7) - ); + type empty; + faces ((0 4) (0 5)); } ); -mergePatchPairs -( -); // ************************************************************************* // diff --git a/tutorials/basic/laplacianFoam/multiWorld/right/system/controlDict b/tutorials/basic/laplacianFoam/multiWorld2/slab2/system/controlDict similarity index 100% rename from tutorials/basic/laplacianFoam/multiWorld/right/system/controlDict rename to tutorials/basic/laplacianFoam/multiWorld2/slab2/system/controlDict diff --git a/tutorials/basic/laplacianFoam/multiWorld/right/system/decomposeParDict b/tutorials/basic/laplacianFoam/multiWorld2/slab2/system/decomposeParDict similarity index 100% rename from tutorials/basic/laplacianFoam/multiWorld/right/system/decomposeParDict rename to tutorials/basic/laplacianFoam/multiWorld2/slab2/system/decomposeParDict diff --git a/tutorials/basic/laplacianFoam/multiWorld/right/system/fvSchemes b/tutorials/basic/laplacianFoam/multiWorld2/slab2/system/fvSchemes similarity index 100% rename from tutorials/basic/laplacianFoam/multiWorld/right/system/fvSchemes rename to tutorials/basic/laplacianFoam/multiWorld2/slab2/system/fvSchemes diff --git a/tutorials/basic/laplacianFoam/multiWorld/right/system/fvSolution b/tutorials/basic/laplacianFoam/multiWorld2/slab2/system/fvSolution similarity index 100% rename from tutorials/basic/laplacianFoam/multiWorld/right/system/fvSolution rename to tutorials/basic/laplacianFoam/multiWorld2/slab2/system/fvSolution diff --git a/tutorials/basic/laplacianFoam/multiWorld2/slab3/0.orig/T b/tutorials/basic/laplacianFoam/multiWorld2/slab3/0.orig/T new file mode 100644 index 00000000000..23bd2a6fbfa --- /dev/null +++ b/tutorials/basic/laplacianFoam/multiWorld2/slab3/0.orig/T @@ -0,0 +1,88 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2112 | +| \\ / 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 0; + +_mappedMixedField +{ + type mappedMixedField; + + // What/how to sample: + sampleMode nearestPatchFaceAMI; + + // Simulation world to sample + // Overwrite -> sampleWorld top; + + // Region to sample + sampleRegion region0; + + // If sampleMode is nearestPatchFace : patch to find faces of + // Overwrite -> samplePatch right_to_left; + + // Use database to get data from (one-way or loose coupling in + // combination with functionObject) + //sampleDatabase false; //true; + + // According to offsetMode (see above) supply one of + // offset, offsets or distance + offset (0 0 0); + + value uniform 0.0; + + // For mappedMixed + //weightField DTV; + refValue $value; + refGradient uniform 0.0; + valueFraction uniform 1.0; +} + +boundaryField +{ + slab3_to_2 + { + $_mappedMixedField; + sampleWorld slab2; + samplePatch slab2_to_3; + } + + slab3_to_4 + { + $_mappedMixedField; + sampleWorld slab4; + samplePatch slab4_to_3; + } + + to_top + { + $_mappedMixedField; + sampleWorld top; + samplePatch top_to_3; + } + + bottom + { + type zeroGradient; + } + + frontAndBack + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/basic/laplacianFoam/multiWorld2/slab3/constant/transportProperties b/tutorials/basic/laplacianFoam/multiWorld2/slab3/constant/transportProperties new file mode 120000 index 00000000000..e6a4e4f7fc5 --- /dev/null +++ b/tutorials/basic/laplacianFoam/multiWorld2/slab3/constant/transportProperties @@ -0,0 +1 @@ +../../common/constant/transportProperties \ No newline at end of file diff --git a/tutorials/basic/laplacianFoam/multiWorld2/slab3/system/blockMeshDict b/tutorials/basic/laplacianFoam/multiWorld2/slab3/system/blockMeshDict new file mode 100644 index 00000000000..afb6537de04 --- /dev/null +++ b/tutorials/basic/laplacianFoam/multiWorld2/slab3/system/blockMeshDict @@ -0,0 +1,83 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2112 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +SLAB_OFFSET 2; + +scale 0.1; + +transform +{ + origin (#eval{0.5 * $SLAB_OFFSET} 0 0); + rotation none; +} + +xdim 0.5; +ydim 1; +zdim 0.1; + +vertices +( + (0 0 0) + ($xdim 0 0) + ($xdim $ydim 0) + (0 $ydim 0) + + (0 0 $zdim) + ($xdim 0 $zdim) + ($xdim $ydim $zdim) + (0 $ydim $zdim) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (2 2 1) grading (1 1 1) +); + +boundary +( + slab3_to_2 // left-side (face 0) + { + type wall; + faces ((0 0)); + } + + slab3_to_4 // right-side (face 1) + { + type wall; + faces ((0 1)); + } + + bottom // face 2 + { + type wall; + faces ((0 2)); + } + + to_top // top: face 3 + { + type wall; + faces ((0 3)); + } + + frontAndBack // face 4 5 + { + type empty; + faces ((0 4) (0 5)); + } +); + + +// ************************************************************************* // diff --git a/tutorials/basic/laplacianFoam/multiWorld2/slab3/system/controlDict b/tutorials/basic/laplacianFoam/multiWorld2/slab3/system/controlDict new file mode 120000 index 00000000000..e38bfb1f6b2 --- /dev/null +++ b/tutorials/basic/laplacianFoam/multiWorld2/slab3/system/controlDict @@ -0,0 +1 @@ +../../common/system/controlDict \ No newline at end of file diff --git a/tutorials/basic/laplacianFoam/multiWorld2/slab3/system/decomposeParDict b/tutorials/basic/laplacianFoam/multiWorld2/slab3/system/decomposeParDict new file mode 120000 index 00000000000..9276e7939a3 --- /dev/null +++ b/tutorials/basic/laplacianFoam/multiWorld2/slab3/system/decomposeParDict @@ -0,0 +1 @@ +../../common/system/decomposeParDict \ No newline at end of file diff --git a/tutorials/basic/laplacianFoam/multiWorld2/slab3/system/fvSchemes b/tutorials/basic/laplacianFoam/multiWorld2/slab3/system/fvSchemes new file mode 120000 index 00000000000..274d17e1728 --- /dev/null +++ b/tutorials/basic/laplacianFoam/multiWorld2/slab3/system/fvSchemes @@ -0,0 +1 @@ +../../common/system/fvSchemes \ No newline at end of file diff --git a/tutorials/basic/laplacianFoam/multiWorld2/slab3/system/fvSolution b/tutorials/basic/laplacianFoam/multiWorld2/slab3/system/fvSolution new file mode 120000 index 00000000000..504f0b1c9e2 --- /dev/null +++ b/tutorials/basic/laplacianFoam/multiWorld2/slab3/system/fvSolution @@ -0,0 +1 @@ +../../common/system/fvSolution \ No newline at end of file diff --git a/tutorials/basic/laplacianFoam/multiWorld2/slab4/0.orig/T b/tutorials/basic/laplacianFoam/multiWorld2/slab4/0.orig/T new file mode 100644 index 00000000000..e22efdd6aab --- /dev/null +++ b/tutorials/basic/laplacianFoam/multiWorld2/slab4/0.orig/T @@ -0,0 +1,87 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2112 | +| \\ / 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 0; + +_mappedMixedField +{ + type mappedMixedField; + + // What/how to sample: + sampleMode nearestPatchFaceAMI; + + // Simulation world to sample + // Overwrite -> sampleWorld top; + + // Region to sample + sampleRegion region0; + + // If sampleMode is nearestPatchFace : patch to find faces of + // Overwrite -> samplePatch right_to_left; + + // Use database to get data from (one-way or loose coupling in + // combination with functionObject) + //sampleDatabase false; //true; + + // According to offsetMode (see above) supply one of + // offset, offsets or distance + offset (0 0 0); + + value uniform 0.0; + + // For mappedMixed + //weightField DTV; + refValue $value; + refGradient uniform 0.0; + valueFraction uniform 1.0; +} + +boundaryField +{ + slab4_to_3 + { + $_mappedMixedField; + sampleWorld slab3; + samplePatch slab3_to_4; + } + + right + { + type fixedValue; + value uniform 0; + } + + to_top + { + $_mappedMixedField; + sampleWorld top; + samplePatch top_to_4; + } + + bottom + { + type zeroGradient; + } + + frontAndBack + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/basic/laplacianFoam/multiWorld2/slab4/constant/transportProperties b/tutorials/basic/laplacianFoam/multiWorld2/slab4/constant/transportProperties new file mode 120000 index 00000000000..e6a4e4f7fc5 --- /dev/null +++ b/tutorials/basic/laplacianFoam/multiWorld2/slab4/constant/transportProperties @@ -0,0 +1 @@ +../../common/constant/transportProperties \ No newline at end of file diff --git a/tutorials/basic/laplacianFoam/multiWorld2/slab4/system/blockMeshDict b/tutorials/basic/laplacianFoam/multiWorld2/slab4/system/blockMeshDict new file mode 100644 index 00000000000..493d29f1647 --- /dev/null +++ b/tutorials/basic/laplacianFoam/multiWorld2/slab4/system/blockMeshDict @@ -0,0 +1,83 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2112 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +SLAB_OFFSET 3; + +scale 0.1; + +transform +{ + origin (#eval{0.5 * $SLAB_OFFSET} 0 0); + rotation none; +} + +xdim 0.5; +ydim 1; +zdim 0.1; + +vertices +( + (0 0 0) + ($xdim 0 0) + ($xdim $ydim 0) + (0 $ydim 0) + + (0 0 $zdim) + ($xdim 0 $zdim) + ($xdim $ydim $zdim) + (0 $ydim $zdim) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (2 2 1) grading (1 1 1) +); + +boundary +( + slab4_to_3 // left-side (face 0) + { + type wall; + faces ((0 0)); + } + + right // right-side (face 1) + { + type wall; + faces ((0 1)); + } + + bottom // face 2 + { + type wall; + faces ((0 2)); + } + + to_top // top: face 3 + { + type wall; + faces ((0 3)); + } + + frontAndBack // face 4 5 + { + type empty; + faces ((0 4) (0 5)); + } +); + + +// ************************************************************************* // diff --git a/tutorials/basic/laplacianFoam/multiWorld2/slab4/system/controlDict b/tutorials/basic/laplacianFoam/multiWorld2/slab4/system/controlDict new file mode 120000 index 00000000000..e38bfb1f6b2 --- /dev/null +++ b/tutorials/basic/laplacianFoam/multiWorld2/slab4/system/controlDict @@ -0,0 +1 @@ +../../common/system/controlDict \ No newline at end of file diff --git a/tutorials/basic/laplacianFoam/multiWorld2/slab4/system/decomposeParDict b/tutorials/basic/laplacianFoam/multiWorld2/slab4/system/decomposeParDict new file mode 120000 index 00000000000..9276e7939a3 --- /dev/null +++ b/tutorials/basic/laplacianFoam/multiWorld2/slab4/system/decomposeParDict @@ -0,0 +1 @@ +../../common/system/decomposeParDict \ No newline at end of file diff --git a/tutorials/basic/laplacianFoam/multiWorld2/slab4/system/fvSchemes b/tutorials/basic/laplacianFoam/multiWorld2/slab4/system/fvSchemes new file mode 120000 index 00000000000..274d17e1728 --- /dev/null +++ b/tutorials/basic/laplacianFoam/multiWorld2/slab4/system/fvSchemes @@ -0,0 +1 @@ +../../common/system/fvSchemes \ No newline at end of file diff --git a/tutorials/basic/laplacianFoam/multiWorld2/slab4/system/fvSolution b/tutorials/basic/laplacianFoam/multiWorld2/slab4/system/fvSolution new file mode 120000 index 00000000000..504f0b1c9e2 --- /dev/null +++ b/tutorials/basic/laplacianFoam/multiWorld2/slab4/system/fvSolution @@ -0,0 +1 @@ +../../common/system/fvSolution \ No newline at end of file diff --git a/tutorials/basic/laplacianFoam/multiWorld2/top/0.orig/T b/tutorials/basic/laplacianFoam/multiWorld2/top/0.orig/T new file mode 100644 index 00000000000..d480b95498e --- /dev/null +++ b/tutorials/basic/laplacianFoam/multiWorld2/top/0.orig/T @@ -0,0 +1,109 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2112 | +| \\ / 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 0; + +_mappedMixedField +{ + type mappedMixedField; + + // What/how to sample: + sampleMode nearestPatchFaceAMI; + + // Simulation world to sample + // Overwrite -> sampleWorld slabN; + + // Region to sample + sampleRegion region0; + + // If sampleMode is nearestPatchFace : patch to find faces of + samplePatch to_top; + + // Use database to get data from (one-way or loose coupling in + // combination with functionObject) + //sampleDatabase false; //true; + + // According to offsetMode (see above) supply one of + // offset, offsets or distance + offset (0 0 0); + + value uniform 0.0; + + // For mappedMixed + //weightField DTV; + refValue $value; + refGradient uniform 0.0; + valueFraction uniform 1.0; +} + + +boundaryField +{ + top_to_1 + { + $_mappedMixedField; + sampleWorld slab1; + } + + top_to_2 + { + $_mappedMixedField; + sampleWorld slab2; + } + + top_to_3 + { + $_mappedMixedField; + sampleWorld slab3; + } + + top_to_4 + { + $_mappedMixedField; + sampleWorld slab4; + } + + top + { + type zeroGradient; + } + + interface + { + type zeroGradient; + } + + left + { + type fixedValue; + value uniform 1.2; + } + + right + { + type fixedValue; + value uniform 0.2; + } + + frontAndBack + { + type empty; + } +} + +// ************************************************************************* // diff --git a/applications/test/multiWorld/Allrun.pre b/tutorials/basic/laplacianFoam/multiWorld2/top/Allrun.pre similarity index 72% rename from applications/test/multiWorld/Allrun.pre rename to tutorials/basic/laplacianFoam/multiWorld2/top/Allrun.pre index eaad67c68b6..1863e020ca3 100755 --- a/applications/test/multiWorld/Allrun.pre +++ b/tutorials/basic/laplacianFoam/multiWorld2/top/Allrun.pre @@ -4,12 +4,10 @@ cd "${0%/*}" || exit # Run from this directory #------------------------------------------------------------------------------ # Create meshes -for subcase in left right -do -( - cd "$subcase" || exit - runApplication blockMesh -) -done +runApplication blockMesh + +runApplication -s patches topoSet -dict system/topoSetDict.patches + +runApplication createPatch -overwrite #------------------------------------------------------------------------------ diff --git a/tutorials/basic/laplacianFoam/multiWorld2/top/constant/transportProperties b/tutorials/basic/laplacianFoam/multiWorld2/top/constant/transportProperties new file mode 120000 index 00000000000..e6a4e4f7fc5 --- /dev/null +++ b/tutorials/basic/laplacianFoam/multiWorld2/top/constant/transportProperties @@ -0,0 +1 @@ +../../common/constant/transportProperties \ No newline at end of file diff --git a/applications/test/multiWorld/left/system/blockMeshDict b/tutorials/basic/laplacianFoam/multiWorld2/top/system/blockMeshDict similarity index 55% rename from applications/test/multiWorld/left/system/blockMeshDict rename to tutorials/basic/laplacianFoam/multiWorld2/top/system/blockMeshDict index eb3f42e5735..1fed71bacc9 100644 --- a/applications/test/multiWorld/left/system/blockMeshDict +++ b/tutorials/basic/laplacianFoam/multiWorld2/top/system/blockMeshDict @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: v2106 | +| \\ / O peration | Version: v2112 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ @@ -13,78 +13,75 @@ FoamFile object blockMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// TOP + +NSLABS 4; scale 0.1; +transform +{ + origin (0 1 0); + rotation none; +} + +xdim #eval{0.5 * $NSLABS}; +ydim 0.2; +zdim 0.1; + +nx #eval #{ round(5 * $NSLABS) #}; + vertices ( - (0 0 0) - (0.5 0 0) - (0.5 1 0) - (0 1 0) - (0 0 0.1) - (0.5 0 0.1) - (0.5 1 0.1) - (0 1 0.1) + (0 0 0) + ($xdim 0 0) + ($xdim $ydim 0) + (0 $ydim 0) + + (0 0 $zdim) + ($xdim 0 $zdim) + ($xdim $ydim $zdim) + (0 $ydim $zdim) ); blocks ( - hex (0 1 2 3 4 5 6 7) (2 2 1) simpleGrading (1 1 1) + hex (0 1 2 3 4 5 6 7) ($nx 2 1) grading (1 1 1) ); -edges -( -); boundary ( - coupled + left { - type wall; - faces - ( - (2 6 5 1) - ); + type wall; + faces ((0 0)); } - top + right { - type wall; - faces - ( - (3 7 6 2) - ); + type wall; + faces ((0 1)); } - bottom + + interface // inter-world connections { - type wall; - faces - ( - (1 5 4 0) - ); + type wall; + faces ((0 2)); } - left + + top { - type wall; - faces - ( - (0 4 7 3) - ); + type wall; + faces ((0 3)); } + frontAndBack { - type empty; - faces - ( - (0 3 2 1) - (4 5 6 7) - ); + type empty; + faces ((0 4) (0 5)); } ); -mergePatchPairs -( -); // ************************************************************************* // diff --git a/tutorials/basic/laplacianFoam/multiWorld2/top/system/controlDict b/tutorials/basic/laplacianFoam/multiWorld2/top/system/controlDict new file mode 120000 index 00000000000..e38bfb1f6b2 --- /dev/null +++ b/tutorials/basic/laplacianFoam/multiWorld2/top/system/controlDict @@ -0,0 +1 @@ +../../common/system/controlDict \ No newline at end of file diff --git a/tutorials/basic/laplacianFoam/multiWorld2/top/system/createPatchDict b/tutorials/basic/laplacianFoam/multiWorld2/top/system/createPatchDict new file mode 100644 index 00000000000..9d333f1df2d --- /dev/null +++ b/tutorials/basic/laplacianFoam/multiWorld2/top/system/createPatchDict @@ -0,0 +1,55 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2112 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object createPatchDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +pointSync false; + +_fromSet +{ + patchInfo { type patch; } + constructFrom set; +} + + +// Patches to create +patches +( + { + name top_to_1; + set top_to_1; + $_fromSet; + } + + { + name top_to_2; + set top_to_2; + $_fromSet; + } + + { + name top_to_3; + set top_to_3; + $_fromSet; + } + + { + name top_to_4; + set top_to_4; + $_fromSet; + } +); + + +// ************************************************************************* // diff --git a/tutorials/basic/laplacianFoam/multiWorld2/top/system/decomposeParDict b/tutorials/basic/laplacianFoam/multiWorld2/top/system/decomposeParDict new file mode 120000 index 00000000000..9276e7939a3 --- /dev/null +++ b/tutorials/basic/laplacianFoam/multiWorld2/top/system/decomposeParDict @@ -0,0 +1 @@ +../../common/system/decomposeParDict \ No newline at end of file diff --git a/tutorials/basic/laplacianFoam/multiWorld2/top/system/fvSchemes b/tutorials/basic/laplacianFoam/multiWorld2/top/system/fvSchemes new file mode 120000 index 00000000000..274d17e1728 --- /dev/null +++ b/tutorials/basic/laplacianFoam/multiWorld2/top/system/fvSchemes @@ -0,0 +1 @@ +../../common/system/fvSchemes \ No newline at end of file diff --git a/tutorials/basic/laplacianFoam/multiWorld2/top/system/fvSolution b/tutorials/basic/laplacianFoam/multiWorld2/top/system/fvSolution new file mode 120000 index 00000000000..504f0b1c9e2 --- /dev/null +++ b/tutorials/basic/laplacianFoam/multiWorld2/top/system/fvSolution @@ -0,0 +1 @@ +../../common/system/fvSolution \ No newline at end of file diff --git a/tutorials/basic/laplacianFoam/multiWorld2/top/system/topoSetDict.patches b/tutorials/basic/laplacianFoam/multiWorld2/top/system/topoSetDict.patches new file mode 100644 index 00000000000..2249d242f84 --- /dev/null +++ b/tutorials/basic/laplacianFoam/multiWorld2/top/system/topoSetDict.patches @@ -0,0 +1,71 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2112 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object topoSetDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +_newFromPatch +{ + type faceSet; + action new; + source patchToFace; + patch interface; +} + +_subsetBox +{ + type faceSet; + action subset; + source boxToFace; + min (0 0 -1); + span (0.05 2 2); +} + + +actions +( + // slab 1 (offset 0) + { name top_to_1; $_newFromPatch } + { + name top_to_1; + $_subsetBox; + min (0 0 -1); + } + + // slab 2 (offset 1) + { name top_to_2; $_newFromPatch } + { + name top_to_2; + $_subsetBox; + min (0.05 0 -1); + } + + // slab 3 (offset 2) + { name top_to_3; $_newFromPatch } + { + name top_to_3; + $_subsetBox; + min (0.10 0 -1); + } + + // slab 4 (offset 3) + { name top_to_4; $_newFromPatch } + { + name top_to_4; + $_subsetBox; + min (0.15 0 -1); + } +); + + +// ************************************************************************* // -- GitLab