From 8bf98e74dae143857dba286482b03310de11097e Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 19 Dec 2017 14:40:33 +0100 Subject: [PATCH] TUT: added tutorial files (issue #671) - also cleanup by using 0.orig/ directory. - use foamListRegions to obtain region names --- .../externalCoupledHeater/{0 => 0.orig}/T | 0 .../externalCoupledHeater/{0 => 0.orig}/U | 0 .../{0 => 0.orig}/epsilon | 0 .../externalCoupledHeater/{0 => 0.orig}/k | 0 .../externalCoupledHeater/{0 => 0.orig}/p | 0 .../externalCoupledHeater/{0 => 0.orig}/p_rgh | 0 .../externalCoupledHeater/Allclean | 16 ++-------- .../externalCoupledHeater/Allrun.pre | 19 +++++++----- .../externalSolarLoad/Allclean | 13 +------- .../externalSolarLoad/Allrun | 15 +++++----- .../externalSolarLoad/Allrun-parallel | 15 +++++----- .../externalSolarLoad/Allrun.pre | 11 +++---- .../multiRegionHeater/Allclean | 7 +---- .../multiRegionHeater/Allmesh | 1 + .../snappyMultiRegionHeater/Allclean | 7 +---- .../snappyMultiRegionHeater/Allrun-serial | 1 + .../windshieldCondensation/Allclean | 3 +- .../windshieldCondensation/Allrun-parallel | 3 +- .../windshieldDefrost/Allclean | 4 +-- .../windshieldDefrost/Allrun-parallel | 1 - .../0 => externalCoupledHeater/0.orig}/T | 0 .../externalCoupledHeater/0.orig/U | 30 +++++++++++++++++++ .../externalCoupledHeater/0.orig/epsilon | 30 +++++++++++++++++++ .../externalCoupledHeater/0.orig/k | 30 +++++++++++++++++++ .../0 => externalCoupledHeater/0.orig}/p | 0 .../0 => externalCoupledHeater/0.orig}/p_rgh | 0 .../externalCoupledHeater/Allclean | 9 +----- .../externalCoupledHeater/Allrun.pre | 23 +++++++------- .../system/decomposeParDict | 10 ------- .../system/externalCoupled | 3 ++ .../externalCoupledHeater/system/fvSolution | 6 +++- .../heatExchanger/Allrun.pre | 9 +++--- .../jouleHeatingSolid/system/fvSolution | 22 ++++++++++++++ .../{0 => 0.orig}/G | 0 .../{0 => 0.orig}/IDefault | 0 .../multiRegionHeaterRadiation/0.orig/T | 30 +++++++++++++++++++ .../{0 => 0.orig}/U | 0 .../{0 => 0.orig}/epsilon | 0 .../{0 => 0.orig}/k | 0 .../multiRegionHeaterRadiation/0.orig/p | 30 +++++++++++++++++++ .../multiRegionHeaterRadiation/0.orig/p_rgh | 30 +++++++++++++++++++ .../{0 => 0.orig}/qr | 0 .../multiRegionHeaterRadiation/Allclean | 15 ++-------- .../multiRegionHeaterRadiation/Allrun | 17 +++++------ .../Allrun-parallel | 15 +++++----- .../multiRegionHeaterRadiation/Allrun.pre | 16 ++++++---- 46 files changed, 296 insertions(+), 145 deletions(-) rename tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/{0 => 0.orig}/T (100%) rename tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/{0 => 0.orig}/U (100%) rename tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/{0 => 0.orig}/epsilon (100%) rename tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/{0 => 0.orig}/k (100%) rename tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/{0 => 0.orig}/p (100%) rename tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/{0 => 0.orig}/p_rgh (100%) rename tutorials/heatTransfer/chtMultiRegionSimpleFoam/{multiRegionHeaterRadiation/0 => externalCoupledHeater/0.orig}/T (100%) create mode 100644 tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/0.orig/U create mode 100644 tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/0.orig/epsilon create mode 100644 tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/0.orig/k rename tutorials/heatTransfer/chtMultiRegionSimpleFoam/{multiRegionHeaterRadiation/0 => externalCoupledHeater/0.orig}/p (100%) rename tutorials/heatTransfer/chtMultiRegionSimpleFoam/{multiRegionHeaterRadiation/0 => externalCoupledHeater/0.orig}/p_rgh (100%) create mode 100644 tutorials/heatTransfer/chtMultiRegionSimpleFoam/jouleHeatingSolid/system/fvSolution rename tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/{0 => 0.orig}/G (100%) rename tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/{0 => 0.orig}/IDefault (100%) create mode 100644 tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/0.orig/T rename tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/{0 => 0.orig}/U (100%) rename tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/{0 => 0.orig}/epsilon (100%) rename tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/{0 => 0.orig}/k (100%) create mode 100644 tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/0.orig/p create mode 100644 tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/0.orig/p_rgh rename tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/{0 => 0.orig}/qr (100%) diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/0/T b/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/0.orig/T similarity index 100% rename from tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/0/T rename to tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/0.orig/T diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/0/U b/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/0.orig/U similarity index 100% rename from tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/0/U rename to tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/0.orig/U diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/0/epsilon b/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/0.orig/epsilon similarity index 100% rename from tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/0/epsilon rename to tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/0.orig/epsilon diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/0/k b/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/0.orig/k similarity index 100% rename from tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/0/k rename to tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/0.orig/k diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/0/p b/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/0.orig/p similarity index 100% rename from tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/0/p rename to tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/0.orig/p diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/0/p_rgh b/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/0.orig/p_rgh similarity index 100% rename from tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/0/p_rgh rename to tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/0.orig/p_rgh diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/Allclean b/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/Allclean index 3f7a0cb7a6..9016f2cd4f 100755 --- a/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/Allclean +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/Allclean @@ -2,23 +2,11 @@ cd ${0%/*} || exit 1 # Run from this directory . $WM_PROJECT_DIR/bin/tools/CleanFunctions # Tutorial clean functions -cleanCase +cleanCase0 rm -rf comms rm -rf VTK rm -rf constant/cellToRegion - -rm -rf 0/bottomWater -rm -rf 0/topAir -rm -rf 0/heater -rm -rf 0/leftSolid -rm -rf 0/rightSolid -rm -f 0/cellToRegion - -rm -rf constant/bottomWater/polyMesh -rm -rf constant/topAir/polyMesh -rm -rf constant/heater/polyMesh -rm -rf constant/leftSolid/polyMesh -rm -rf constant/rightSolid/polyMesh +rm -rf constant/*/polyMesh # region meshes #------------------------------------------------------------------------------ diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/Allrun.pre b/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/Allrun.pre index aebfbaa5ae..d48a059e42 100755 --- a/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/Allrun.pre +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/Allrun.pre @@ -4,18 +4,22 @@ cd ${0%/*} || exit 1 # Run from this directory runApplication blockMesh runApplication topoSet + +# Restore initial fields +restore0Dir + runApplication splitMeshRegions -cellZones -overwrite -# remove fluid fields from solid regions (important for post-processing) -for i in heater leftSolid rightSolid +# Remove fluid fields from solid regions (important for post-processing) +for region in $(foamListRegions solid) do - rm -f 0*/$i/{nut,alphat,epsilon,k,U,p_rgh} + rm -f 0/$region/{nut,alphat,epsilon,k,U,p_rgh} + rm -f processor*/0/$region/{nut,alphat,epsilon,k,U,p_rgh} done - -for i in bottomWater topAir heater leftSolid rightSolid +for region in $(foamListRegions) do - changeDictionary -region $i > log.changeDictionary.$i 2>&1 + runApplication -s $region changeDictionary -region $region done # Create coupling geometry @@ -23,8 +27,7 @@ runApplication createExternalCoupledPatchGeometry \ -regions '(topAir heater)' coupleGroup echo -echo "creating files for paraview post-processing" +echo "Use paraFoam -touch-all to create files for paraview post-processing" echo -paraFoam -touchAll 2>/dev/null #------------------------------------------------------------------------------ diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allclean b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allclean index fecea96c55..9e53e2850b 100755 --- a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allclean +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allclean @@ -6,11 +6,7 @@ cleanCase0 rm -rf VTK rm -rf constant/cellToRegion - -rm -rf constant/air/polyMesh -rm -rf constant/solid/polyMesh -rm -rf constant/floor/polyMesh -rm -rf constant/triSurface +rm -rf constant/*/polyMesh # region meshes rm -f constant/air/F rm -f constant/air/constructMap* @@ -19,11 +15,4 @@ rm -f constant/air/globalFaceFaces rm -f constant/air/mapDist rm -f constant/air/visibleFaceFaces -rm -f 0/air/facesAgglomeration -rm -f 0/air/viewFactorField -rm -f 0/air/cellToRegion -rm -f 0/floor/cellToRegion -rm -f 0/solid/cellToRegion -rm -f 0/cellToRegion - #------------------------------------------------------------------------------ diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allrun b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allrun index b1618a8119..afb775bd7e 100755 --- a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allrun +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allrun @@ -8,24 +8,23 @@ cd ${0%/*} || exit 1 # Run from this directory #-- Run on single processor # Agglomerate patch faces -for i in air +for region in air do - runApplication -s $i \ - faceAgglomerate -region $i -dict constant/viewFactorsDict + runApplication -s $region \ + faceAgglomerate -region $region -dict constant/viewFactorsDict done # Generate view factors -for i in air +for region in air do - runApplication -s $i \ - viewFactorsGen -region $i + runApplication -s $region \ + viewFactorsGen -region $region done runApplication $(getApplication) echo -echo "Creating files for paraview post-processing" +echo "Use paraFoam -touch-all to create files for paraview post-processing" echo -paraFoam -touchAll #------------------------------------------------------------------------------ diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allrun-parallel b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allrun-parallel index 4fd07828f9..3415a23574 100755 --- a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allrun-parallel +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allrun-parallel @@ -11,17 +11,17 @@ cd ${0%/*} || exit 1 # Run from this directory runApplication decomposePar -allRegions -constant # Agglomerate patch faces -for i in air +for region in air do - runParallel -s $i \ - faceAgglomerate -region $i -dict constant/viewFactorsDict + runParallel -s $region \ + faceAgglomerate -region $region -dict constant/viewFactorsDict done # Generate view factors -for i in air +for region in air do - runParallel -s $i \ - viewFactorsGen -region $i + runParallel -s $region \ + viewFactorsGen -region $region done # Set the initial fields @@ -33,8 +33,7 @@ runParallel $(getApplication) runApplication reconstructPar -allRegions echo -echo "Creating files for paraview post-processing" +echo "Use paraFoam -touch-all to create files for paraview post-processing" echo -paraFoam -touchAll #------------------------------------------------------------------------------ diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allrun.pre b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allrun.pre index 35a20b5e48..e47b160200 100755 --- a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allrun.pre +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allrun.pre @@ -10,18 +10,19 @@ runApplication splitMeshRegions -cellZones -overwrite rm -rf 0/domain3 constant/domain3 system/domain3 # Remove fluid fields from solid regions (important for post-processing) -for i in solid floor +for region in $(foamListRegions solid) do - rm -f 0*/$i/{rho,mut,alphat,epsilon,k,U,p_rgh,qr,G,IDefault} + rm -f 0/$region/{rho,mut,alphat,epsilon,k,U,p_rgh,qr,G,IDefault} + rm -f processor*/0/$region/{rho,mut,alphat,epsilon,k,U,p_rgh,qr,G,IDefault} done # Set the initial fields restore0Dir -for i in air solid floor +for region in $(foamListRegions) do - runApplication -s $i changeDictionary \ - -region $i -subDict dictionaryReplacement + runApplication -s $region changeDictionary \ + -region $region -subDict dictionaryReplacement done #------------------------------------------------------------------------------ diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/Allclean b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/Allclean index 696cfb7f54..711e9348ef 100755 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/Allclean +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/Allclean @@ -6,11 +6,6 @@ cleanCase0 rm -rf VTK rm -rf constant/cellToRegion - -rm -rf constant/bottomWater/polyMesh -rm -rf constant/topAir/polyMesh -rm -rf constant/heater/polyMesh -rm -rf constant/leftSolid/polyMesh -rm -rf constant/rightSolid/polyMesh +rm -rf constant/*/polyMesh # region meshes #------------------------------------------------------------------------------ diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/Allmesh b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/Allmesh index 44fa7da137..4f892a02f1 100755 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/Allmesh +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/Allmesh @@ -14,6 +14,7 @@ runApplication splitMeshRegions -cellZones -overwrite for region in $(foamListRegions solid) do rm -f 0/$region/{nut,alphat,epsilon,k,U,p_rgh} + rm -f processor*/0/$region/{nut,alphat,epsilon,k,U,p_rgh} done for region in $(foamListRegions) diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/Allclean b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/Allclean index e6134ad556..73ee293a5c 100755 --- a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/Allclean +++ b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/Allclean @@ -9,11 +9,6 @@ rm -f constant/triSurface/*.eMesh > /dev/null 2>&1 rm -rf VTK rm -rf constant/cellToRegion - -rm -rf constant/bottomAir/polyMesh -rm -rf constant/topAir/polyMesh -rm -rf constant/heater/polyMesh -rm -rf constant/leftSolid/polyMesh -rm -rf constant/rightSolid/polyMesh +rm -rf constant/*/polyMesh # region meshes #------------------------------------------------------------------------------ diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/Allrun-serial b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/Allrun-serial index 87936c1750..df169f31dd 100755 --- a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/Allrun-serial +++ b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/Allrun-serial @@ -18,6 +18,7 @@ runApplication splitMeshRegions -cellZones -overwrite for region in $(foamListRegions solid) do rm -f 0/$region/{nut,alphat,epsilon,k,U,p_rgh} + rm -f processor*/0/$region/{nut,alphat,epsilon,k,U,p_rgh} done for region in $(foamListRegions) diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/Allclean b/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/Allclean index d28baddd33..001719f751 100755 --- a/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/Allclean +++ b/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/Allclean @@ -4,7 +4,6 @@ cd ${0%/*} || exit 1 # Run from this directory cleanCase0 -rm -rf constant/windshield/polyMesh -rm -rf constant/cabin/polyMesh +rm -rf constant/*/polyMesh # region meshes #------------------------------------------------------------------------------ diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/Allrun-parallel b/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/Allrun-parallel index bdd571ebfc..d306f7901f 100755 --- a/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/Allrun-parallel +++ b/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/Allrun-parallel @@ -30,8 +30,7 @@ runParallel $(getApplication) runApplication reconstructPar -allRegions echo -echo "creating files for paraview post-processing" +echo "Use paraFoam -touch-all to create files for paraview post-processing" echo -paraFoam -touchAll #------------------------------------------------------------------------------ diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/windshieldDefrost/Allclean b/tutorials/heatTransfer/chtMultiRegionFoam/windshieldDefrost/Allclean index 9ce122ce3d..001719f751 100755 --- a/tutorials/heatTransfer/chtMultiRegionFoam/windshieldDefrost/Allclean +++ b/tutorials/heatTransfer/chtMultiRegionFoam/windshieldDefrost/Allclean @@ -4,8 +4,6 @@ cd ${0%/*} || exit 1 # Run from this directory cleanCase0 -rm -rf constant/exterior/polyMesh -rm -rf constant/ice/polyMesh -rm -rf constant/cabin/polyMesh +rm -rf constant/*/polyMesh # region meshes #------------------------------------------------------------------------------ diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/windshieldDefrost/Allrun-parallel b/tutorials/heatTransfer/chtMultiRegionFoam/windshieldDefrost/Allrun-parallel index 53e574a9d5..fcee42a202 100755 --- a/tutorials/heatTransfer/chtMultiRegionFoam/windshieldDefrost/Allrun-parallel +++ b/tutorials/heatTransfer/chtMultiRegionFoam/windshieldDefrost/Allrun-parallel @@ -16,5 +16,4 @@ runApplication -s cabin reconstructPar -region cabin runApplication -s ice reconstructPar -region ice runApplication -s exterior reconstructPar -region exterior - #------------------------------------------------------------------------------ diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/0/T b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/0.orig/T similarity index 100% rename from tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/0/T rename to tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/0.orig/T diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/0.orig/U b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/0.orig/U new file mode 100644 index 0000000000..049f4930b8 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/0.orig/U @@ -0,0 +1,30 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: plus | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0.01 0 0); + +boundaryField +{ + ".*" + { + type calculated; + value $internalField; + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/0.orig/epsilon b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/0.orig/epsilon new file mode 100644 index 0000000000..ffcdd13d9d --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/0.orig/epsilon @@ -0,0 +1,30 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: plus | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object epsilon; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -3 0 0 0 0]; + +internalField uniform 0.01; + +boundaryField +{ + ".*" + { + type calculated; + value $internalField; + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/0.orig/k b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/0.orig/k new file mode 100644 index 0000000000..e1e1fb1a54 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/0.orig/k @@ -0,0 +1,30 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: plus | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object k; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0.1; + +boundaryField +{ + ".*" + { + type calculated; + value $internalField; + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/0/p b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/0.orig/p similarity index 100% rename from tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/0/p rename to tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/0.orig/p diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/0/p_rgh b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/0.orig/p_rgh similarity index 100% rename from tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/0/p_rgh rename to tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/0.orig/p_rgh diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/Allclean b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/Allclean index 3f7a0cb7a6..8421c96559 100755 --- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/Allclean +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/Allclean @@ -2,19 +2,12 @@ cd ${0%/*} || exit 1 # Run from this directory . $WM_PROJECT_DIR/bin/tools/CleanFunctions # Tutorial clean functions -cleanCase +cleanCase0 rm -rf comms rm -rf VTK rm -rf constant/cellToRegion -rm -rf 0/bottomWater -rm -rf 0/topAir -rm -rf 0/heater -rm -rf 0/leftSolid -rm -rf 0/rightSolid -rm -f 0/cellToRegion - rm -rf constant/bottomWater/polyMesh rm -rf constant/topAir/polyMesh rm -rf constant/heater/polyMesh diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/Allrun.pre b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/Allrun.pre index 854fddc385..d48a059e42 100755 --- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/Allrun.pre +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/Allrun.pre @@ -4,27 +4,30 @@ cd ${0%/*} || exit 1 # Run from this directory runApplication blockMesh runApplication topoSet + +# Restore initial fields +restore0Dir + runApplication splitMeshRegions -cellZones -overwrite -# remove fluid fields from solid regions (important for post-processing) -for i in heater leftSolid rightSolid +# Remove fluid fields from solid regions (important for post-processing) +for region in $(foamListRegions solid) do - rm -f 0*/$i/{nut,alphat,epsilon,k,U,p_rgh} + rm -f 0/$region/{nut,alphat,epsilon,k,U,p_rgh} + rm -f processor*/0/$region/{nut,alphat,epsilon,k,U,p_rgh} done - -for i in bottomWater topAir heater leftSolid rightSolid +for region in $(foamListRegions) do - changeDictionary -region $i > log.changeDictionary.$i 2>&1 + runApplication -s $region changeDictionary -region $region done # Create coupling geometry runApplication createExternalCoupledPatchGeometry \ -regions '(topAir heater)' coupleGroup -# echo -# echo "creating files for paraview post-processing" -# echo -# paraFoam -touchAll 2>/dev/null +echo +echo "Use paraFoam -touch-all to create files for paraview post-processing" +echo #------------------------------------------------------------------------------ diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/system/decomposeParDict b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/system/decomposeParDict index bc03b02cb9..d133c59bcd 100644 --- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/system/decomposeParDict +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/system/decomposeParDict @@ -20,16 +20,6 @@ numberOfSubdomains 4; // preserveFaceZones (heater solid1 solid3); method scotch; -// method hierarchical; -// method simple; -// method manual; -coeffs -{ - n (2 2 1); - //delta 0.001; // default=0.001 - //order xyz; // default=xzy - dataFile "decompositionData"; -} // ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/system/externalCoupled b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/system/externalCoupled index 806e5b8a51..7e820e9d19 100644 --- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/system/externalCoupled +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/system/externalCoupled @@ -13,6 +13,9 @@ externalCoupled // Does external process start first initByExternal true; + // Frequency of coupling + calcFrequency 4; + // Additional output log true; diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/system/fvSolution b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/system/fvSolution index 14653b73e5..8f999e822a 100644 --- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/system/fvSolution +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/system/fvSolution @@ -19,7 +19,11 @@ SIMPLE { energyCoupling { - iterations 50; + iterations 10; + + timeStart 10; + + timeEnd 100; interval 0; diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/Allrun.pre b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/Allrun.pre index b3f7c19f36..5e972ad1d5 100755 --- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/Allrun.pre +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/Allrun.pre @@ -2,26 +2,27 @@ cd ${0%/*} || exit 1 # Run from this directory . $WM_PROJECT_DIR/bin/tools/RunFunctions # Tutorial run functions -#create meshes +# Create meshes runApplication -s air blockMesh -region air runApplication -s porous blockMesh -region porous -# create rotor blades in air region +# Create rotor blades in air region runApplication -s air.1 \ topoSet -region air -dict system/topoSetDict.1 runApplication createBaffles -region air -overwrite -# create rotor zone in air region for MRF +# Create rotor zone in air region for MRF runApplication -s air.2 \ topoSet -region air -dict system/topoSetDict.2 rm -rf constant/air/polyMesh/sets -# create dummy files for post-processing +# Create dummy files for post-processing paraFoam -touch -region porous paraFoam -touch -region air +# Set initial fields restore0Dir #------------------------------------------------------------------------------ diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/jouleHeatingSolid/system/fvSolution b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/jouleHeatingSolid/system/fvSolution new file mode 100644 index 0000000000..2799b02d0f --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/jouleHeatingSolid/system/fvSolution @@ -0,0 +1,22 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: plus | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +SIMPLE +{ +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/0/G b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/0.orig/G similarity index 100% rename from tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/0/G rename to tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/0.orig/G diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/0/IDefault b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/0.orig/IDefault similarity index 100% rename from tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/0/IDefault rename to tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/0.orig/IDefault diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/0.orig/T b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/0.orig/T new file mode 100644 index 0000000000..65205f56ce --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/0.orig/T @@ -0,0 +1,30 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: plus | +| \\ / A nd | Web: 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 300; + +boundaryField +{ + ".*" + { + type calculated; + value $internalField; + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/0/U b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/0.orig/U similarity index 100% rename from tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/0/U rename to tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/0.orig/U diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/0/epsilon b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/0.orig/epsilon similarity index 100% rename from tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/0/epsilon rename to tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/0.orig/epsilon diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/0/k b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/0.orig/k similarity index 100% rename from tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/0/k rename to tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/0.orig/k diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/0.orig/p b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/0.orig/p new file mode 100644 index 0000000000..24b94d43e7 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/0.orig/p @@ -0,0 +1,30 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: plus | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 1e5; + +boundaryField +{ + ".*" + { + type calculated; + value $internalField; + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/0.orig/p_rgh b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/0.orig/p_rgh new file mode 100644 index 0000000000..2e144189ab --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/0.orig/p_rgh @@ -0,0 +1,30 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: plus | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p_rgh; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 1e5; + +boundaryField +{ + ".*" + { + type calculated; + value $internalField; + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/0/qr b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/0.orig/qr similarity index 100% rename from tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/0/qr rename to tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/0.orig/qr diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/Allclean b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/Allclean index 8232cefee7..84fbcbcc3f 100755 --- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/Allclean +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/Allclean @@ -2,22 +2,11 @@ cd ${0%/*} || exit 1 # Run from this directory . $WM_PROJECT_DIR/bin/tools/CleanFunctions # Tutorial clean functions -cleanCase +cleanCase0 rm -rf VTK rm -rf constant/cellToRegion -rm -rf 0/bottomAir -rm -rf 0/topAir -rm -rf 0/heater -rm -rf 0/leftSolid -rm -rf 0/rightSolid -rm -f 0/cellToRegion - -rm -rf constant/bottomAir/polyMesh -rm -rf constant/topAir/polyMesh -rm -rf constant/heater/polyMesh -rm -rf constant/leftSolid/polyMesh -rm -rf constant/rightSolid/polyMesh +rm -rf constant/*/polyMesh # region meshes rm -f constant/bottomAir/F rm -f constant/bottomAir/constructMap* diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/Allrun b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/Allrun index e726d6fcab..eecc8c8ce3 100755 --- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/Allrun +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/Allrun @@ -2,32 +2,29 @@ cd ${0%/*} || exit 1 # Run from this directory . $WM_PROJECT_DIR/bin/tools/RunFunctions # Tutorial run functions - # Setup case ./Allrun.pre - #-- Run on single processor # Agglomerate patch faces -for i in bottomAir topAir +for region in bottomAir topAir do - runApplication -s $i \ - faceAgglomerate -region $i -dict constant/viewFactorsDict + runApplication -s $region \ + faceAgglomerate -region $region -dict constant/viewFactorsDict done # Generate view factors -for i in bottomAir topAir +for region in bottomAir topAir do - runApplication -s $i \ - viewFactorsGen -region $i + runApplication -s $region \ + viewFactorsGen -region $region done runApplication $(getApplication) echo -echo "creating files for paraview post-processing" +echo "Use paraFoam -touch-all to create files for paraview post-processing" echo -paraFoam -touchAll #------------------------------------------------------------------------------ diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/Allrun-parallel b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/Allrun-parallel index 42b3aad022..0ea963af1d 100755 --- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/Allrun-parallel +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/Allrun-parallel @@ -11,17 +11,17 @@ cd ${0%/*} || exit 1 # Run from this directory runApplication decomposePar -allRegions # Agglomerate patch faces -for i in bottomAir topAir +for region in bottomAir topAir do - runParallel -s $i \ - faceAgglomerate -region $i -dict constant/viewFactorsDict + runParallel -s $region \ + faceAgglomerate -region $region -dict constant/viewFactorsDict done # Generate view factors -for i in bottomAir topAir +for region in bottomAir topAir do - runParallel -s $i \ - viewFactorsGen -region $i + runParallel -s $region \ + viewFactorsGen -region $region done # Run @@ -31,8 +31,7 @@ runParallel $(getApplication) runApplication reconstructPar -allRegions echo -echo "Creating files for paraview post-processing" +echo "Use paraFoam -touch-all to create files for paraview post-processing" echo -paraFoam -touchAll #------------------------------------------------------------------------------ diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/Allrun.pre b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/Allrun.pre index b28d6eee4f..85223fb20a 100755 --- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/Allrun.pre +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/Allrun.pre @@ -4,18 +4,22 @@ cd ${0%/*} || exit 1 # Run from this directory runApplication blockMesh runApplication topoSet + +# Restore initial fields +restore0Dir + runApplication splitMeshRegions -cellZones -overwrite -# remove fluid fields from solid regions (important for post-processing) -for i in heater leftSolid rightSolid +# Remove fluid fields from solid regions (important for post-processing) +for region in $(foamListRegions solid) do - rm -f 0*/$i/{rho,nut,alphat,epsilon,k,U,p_rgh,qr,G,IDefault} + rm -f 0/$region/{rho,nut,alphat,epsilon,k,U,p_rgh,qr,G,IDefault} + rm -f processor*/0/$region/{rho,nut,alphat,epsilon,k,U,p_rgh,qr,G,IDefault} done -for i in bottomAir topAir heater leftSolid rightSolid +for region in $(foamListRegions) do - runApplication -s $i changeDictionary -region $i + runApplication -s $region changeDictionary -region $region done - #------------------------------------------------------------------------------