TUT: snappyMultiRegionHeater with redistributePar

This commit is contained in:
Mark Olesen
2017-12-08 16:06:30 +00:00
parent 03b8275a83
commit 88423b2a6f
29 changed files with 214 additions and 204 deletions

View File

@ -2,16 +2,10 @@
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 -f 0/cellToRegion
rm -rf 0/bottomWater
rm -rf 0/topAir
rm -rf 0/heater
rm -rf 0/leftSolid
rm -rf 0/rightSolid
rm -rf constant/bottomWater/polyMesh
rm -rf constant/topAir/polyMesh

View File

@ -4,23 +4,25 @@ 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 $(foamListRegions solid)
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}
done
for i in $(foamListRegions)
for region in $(foamListRegions)
do
runApplication -s $i changeDictionary -region $i
runApplication -s $region changeDictionary -region $region
done
echo
echo "Creating files for paraview post-processing"
echo "Use paraFoam -touch-all to create files for paraview post-processing"
echo
paraFoam -touchAll
#------------------------------------------------------------------------------

View File

@ -30,12 +30,11 @@ regions
heater
{
numberOfSubdomains 1;
method none;
method simple; // none;
coeffs
{
n (1 1 1);
delta 0.001;
}
}
}

View File

@ -20,10 +20,12 @@ internalField uniform 300;
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
".*"
{
type calculated;
value uniform 300;
value $internalField;
}
}

View File

@ -20,10 +20,12 @@ internalField uniform (0.01 0 0);
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
".*"
{
type calculated;
value uniform (0.01 0 0);
value $internalField;
}
}

View File

@ -20,12 +20,13 @@ internalField uniform 0;
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
".*"
{
type calculated;
value uniform 0;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -20,12 +20,13 @@ internalField uniform 0.01;
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
".*"
{
type calculated;
value uniform 0.01;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -20,12 +20,13 @@ internalField uniform 0.1;
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
".*"
{
type calculated;
value uniform 0.1;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -20,10 +20,12 @@ internalField uniform 1e5;
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
".*"
{
type calculated;
value uniform 1e5;
value $internalField;
}
}

View File

@ -20,10 +20,12 @@ internalField uniform 1e5;
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
".*"
{
type calculated;
value uniform 1e5;
value $internalField;
}
}

View File

@ -20,10 +20,12 @@ internalField uniform 8000;
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
".*"
{
type calculated;
value uniform 8000;
value $internalField;
}
}

View File

@ -2,19 +2,13 @@
cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/CleanFunctions # Tutorial clean functions
cleanCase
cleanCase0
rm -rf constant/extendedFeatureEdgeMesh > /dev/null 2>&1
rm -f constant/triSurface/*.eMesh > /dev/null 2>&1
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

View File

@ -1,45 +0,0 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions # Tutorial run functions
rm -rf constant/polyMesh/sets
runApplication blockMesh
runApplication surfaceFeatureExtract
runApplication snappyHexMesh -overwrite
runApplication splitMeshRegions -cellZones -overwrite
# remove fluid fields from solid regions (important for post-processing)
for i in $(foamListRegions solid)
do
rm -f 0*/$i/{nut,alphat,epsilon,k,U,p_rgh}
done
for i in $(foamListRegions)
do
runApplication -s $i changeDictionary -region $i
done
#-- Run on single processor
runApplication $(getApplication)
## Decompose
#runApplication decomposePar -allRegions
#
## Run
#runParallel $(getApplication)
#
## Reconstruct
#runApplication reconstructPar -allRegions
echo
echo "creating files for paraview post-processing"
echo
paraFoam -touchAll
#------------------------------------------------------------------------------

View File

@ -0,0 +1 @@
Allrun-parallel

View File

@ -0,0 +1,55 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions # Tutorial run functions
rm -rf constant/polyMesh/sets
# For meshing only
decompDict="-decomposeParDict system/decomposeParDict.6"
runApplication blockMesh
runApplication surfaceFeatureExtract
runApplication $decompDict decomposePar
runParallel $decompDict snappyHexMesh -overwrite
# Restore initial fields
restore0Dir -processor
runParallel $decompDict splitMeshRegions -cellZones -overwrite
# Remove fluid fields from solid regions (important for post-processing)
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)
do
runParallel $decompDict -s $region changeDictionary -region $region
done
# Redistribute onto fewer processors, with special treatment for heater
for region in $(foamListRegions)
do
runParallel -np 6 -s redist-$region \
redistributePar -overwrite -region $region
done
#-- Run in parallel
runParallel $(getApplication)
# Reconstruct
for region in $(foamListRegions)
do
runParallel -s reconstruct-$region \
redistributePar -reconstruct -region $region
done
echo
echo "Use paraFoam -touch-all to create files for paraview post-processing"
echo
#------------------------------------------------------------------------------

View File

@ -0,0 +1,36 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions # Tutorial run functions
rm -rf constant/polyMesh/sets
runApplication blockMesh
runApplication surfaceFeatureExtract
runApplication snappyHexMesh -overwrite
# Restore initial fields
restore0Dir
runApplication splitMeshRegions -cellZones -overwrite
# Remove fluid fields from solid regions (important for post-processing)
for region in $(foamListRegions solid)
do
rm -f 0/$region/{nut,alphat,epsilon,k,U,p_rgh}
done
for region in $(foamListRegions)
do
runApplication -s $region changeDictionary -region $region
done
# Run on single processor
runApplication $(getApplication)
echo
echo "Use paraFoam -touch-all to create files for paraview post-processing"
echo
#------------------------------------------------------------------------------

View File

@ -37,6 +37,10 @@ U
type fixedValue;
value uniform (0 0 0);
}
"procBoundary.*"
{
type processor;
}
}
}
@ -51,6 +55,11 @@ T
type zeroGradient;
}
"procBoundary.*"
{
type processor;
}
"bottomAir_to_.*"
{
type compressible::turbulentTemperatureCoupledBaffleMixed;
@ -74,6 +83,10 @@ epsilon
type epsilonWallFunction;
value uniform 0.01;
}
"procBoundary.*"
{
type processor;
}
}
}
@ -88,6 +101,10 @@ k
type kqRWallFunction;
value uniform 0.1;
}
"procBoundary.*"
{
type processor;
}
}
}
@ -102,6 +119,10 @@ p_rgh
type fixedFluxPressure;
value uniform 1e5;
}
"procBoundary.*"
{
type processor;
}
}
}
@ -116,6 +137,10 @@ p
type calculated;
value uniform 1e5;
}
"procBoundary.*"
{
type processor;
}
}
}

View File

@ -1,48 +0,0 @@
/*--------------------------------*- 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 decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 4;
//- Keep owner and neighbour on same processor for faces in zones:
// 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";
}
scotchCoeffs
{
//processorWeights
//(
// 1
// 1
// 1
// 1
//);
//writeGraph true;
//strategy "b";
}
// ************************************************************************* //

View File

@ -19,30 +19,25 @@ numberOfSubdomains 4;
//- Keep owner and neighbour on same processor for faces in zones:
// preserveFaceZones (heater solid1 solid3);
// method scotch;
method hierarchical;
// method simple;
// method manual;
method scotch;
regions
{
heater
{
numberOfSubdomains 1;
method simple;
coeffs
{
n (1 1 1);
}
}
}
coeffs
{
n (2 2 1);
//delta 0.001; // default=0.001
//order xyz; // default=xzy
dataFile "decompositionData";
}
scotchCoeffs
{
//processorWeights
//(
// 1
// 1
// 1
// 1
//);
//writeGraph true;
//strategy "b";
}
// ************************************************************************* //

View File

@ -41,6 +41,10 @@ T
type zeroGradient;
value uniform 300;
}
"procBoundary.*"
{
type processor;
}
"heater_to_.*"
{
type compressible::turbulentTemperatureCoupledBaffleMixed;

View File

@ -1,49 +0,0 @@
/*--------------------------------*- 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 decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 4;
//- Keep owner and neighbour on same processor for faces in zones:
// 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";
}
scotchCoeffs
{
//processorWeights
//(
// 1
// 1
// 1
// 1
//);
//writeGraph true;
//strategy "b";
}
// ************************************************************************* //

View File

@ -37,6 +37,10 @@ T
type zeroGradient;
value uniform 300;
}
"procBoundary.*"
{
type processor;
}
"leftSolid_to_.*"
{
type compressible::turbulentTemperatureCoupledBaffleMixed;

View File

@ -37,6 +37,10 @@ T
type zeroGradient;
value uniform 300;
}
"procBoundary.*"
{
type processor;
}
"rightSolid_to_.*"
{
type compressible::turbulentTemperatureCoupledBaffleMixed;

View File

@ -25,6 +25,10 @@ U
type fixedValue;
value uniform (0 0 0);
}
"procBoundary.*"
{
type processor;
}
minX
{
type fixedValue;
@ -49,6 +53,10 @@ T
{
type zeroGradient;
}
"procBoundary.*"
{
type processor;
}
minX
{
@ -83,6 +91,10 @@ epsilon
type epsilonWallFunction;
value uniform 0.01;
}
"procBoundary.*"
{
type processor;
}
minX
{
@ -109,6 +121,10 @@ k
type kqRWallFunction;
value uniform 0.1;
}
"procBoundary.*"
{
type processor;
}
minX
{
@ -135,6 +151,10 @@ p_rgh
type fixedFluxPressure;
value uniform 1e5;
}
"procBoundary.*"
{
type processor;
}
maxX
{
@ -155,6 +175,10 @@ p
type calculated;
value uniform 1e5;
}
"procBoundary.*"
{
type processor;
}
maxX
{