mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
TUT: basic, IO, preProcessing, VV: clean up tutorials
- TUT: mesh: add missing SnakeRiverCanyon files - TUT: mesh: add missing cp source in a foamyHexMesh tutorial
This commit is contained in:
@ -5,7 +5,10 @@ cd "${0%/*}" || exit # Run from this directory
|
||||
|
||||
cleanCase0
|
||||
|
||||
rm -rf constant/polyMesh
|
||||
rm -f constant/turbulenceProperties
|
||||
rm -rf 0.orig
|
||||
rm -rf system
|
||||
rm -rf constant
|
||||
rm -rf results
|
||||
rm -rf plots
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
#------------------------------------------------------------------------------
|
||||
@ -1,26 +1,130 @@
|
||||
#!/bin/sh
|
||||
cd "${0%/*}" || exit # Run from this directory
|
||||
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
|
||||
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
RASModel="kEpsilon" # "kOmegaSST"
|
||||
# settings
|
||||
|
||||
sed -e "s|RAS_MODEL|$RASModel|g" \
|
||||
constant/turbulenceProperties.template \
|
||||
> constant/turbulenceProperties
|
||||
# operand setups (only neutral stability)
|
||||
setups="
|
||||
kEpsilon
|
||||
kOmegaSST
|
||||
"
|
||||
|
||||
restore0Dir
|
||||
# flag to enable computations in parallel mode
|
||||
parallel=true
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
#######################################
|
||||
# Collect results and mesh into a given path
|
||||
# and clean the case for the next run
|
||||
# Arguments:
|
||||
# $1 = Path to move results
|
||||
# Outputs:
|
||||
# Writes info to stdout
|
||||
#######################################
|
||||
collect() {
|
||||
|
||||
[ $# -eq 0 ] && { echo "Usage: $0 dir-model"; exit 1; }
|
||||
|
||||
collection="$1"
|
||||
|
||||
dirResult=results/"$collection"
|
||||
dirSettings="$dirResult"/settings
|
||||
|
||||
if [ ! -d "$dirResult" ]
|
||||
then
|
||||
|
||||
echo " # Collecting results and settings into $dirResult"
|
||||
|
||||
mkdir -p "$dirResult"
|
||||
mkdir -p "$dirSettings"
|
||||
|
||||
mv -f $(foamListTimes) "$dirResult"
|
||||
[ -d postProcessing ] && mv -f postProcessing "$dirResult"
|
||||
[ -d processor0 ] && mv -f processor* "$dirResult"
|
||||
mv -f log.* "$dirResult"
|
||||
cp -f system/{fv*,controlDict} constant/*Properties "$dirSettings"
|
||||
mv -f 0/ "$dirSettings"
|
||||
[ -d constant ] && mv -f constant "$dirResult"
|
||||
[ -d system ] && mv -f system "$dirResult"
|
||||
|
||||
echo " # Cleaning up the case"
|
||||
|
||||
cleanTimeDirectories
|
||||
cleanPostProcessing
|
||||
|
||||
else
|
||||
|
||||
echo " # Directory $dirResult already exists"
|
||||
echo " # Skipping the computation"
|
||||
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
for setup in $setups
|
||||
do
|
||||
|
||||
echo ""
|
||||
echo "# Computations for the setup: $setup"
|
||||
echo ""
|
||||
|
||||
dirSetup="setups.orig/$setup"
|
||||
|
||||
if [ ! -d "$dirSetup" ]
|
||||
then
|
||||
echo "Setup directory: $dirSetup" \
|
||||
"could not be found - skipping execution" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cp -rfL "$dirSetup/0.orig" .
|
||||
cp -rfL "$dirSetup/constant" .
|
||||
cp -rfL "$dirSetup/system" .
|
||||
cp -rf 0.orig/ 0/
|
||||
|
||||
if [ ! -d constant/polyMesh ]
|
||||
then
|
||||
|
||||
runApplication blockMesh
|
||||
|
||||
runApplication topoSet
|
||||
|
||||
runApplication createPatch -overwrite
|
||||
|
||||
runApplication renumberMesh -overwrite -constant
|
||||
|
||||
runApplication checkMesh -allTopology -allGeometry -constant
|
||||
|
||||
fi
|
||||
|
||||
runApplication mapFields \
|
||||
../precursor/results/"$setup" -sourceTime latestTime
|
||||
|
||||
if [ "$parallel" = true ]
|
||||
then
|
||||
|
||||
runApplication decomposePar
|
||||
|
||||
runParallel $(getApplication)
|
||||
|
||||
runApplication reconstructPar
|
||||
|
||||
else
|
||||
|
||||
runApplication $(getApplication)
|
||||
|
||||
fi
|
||||
|
||||
collect "$setup"
|
||||
|
||||
done
|
||||
|
||||
cp -rf constant/polyMesh.orig constant/polyMesh
|
||||
|
||||
runApplication mapFields ../precursor -sourceTime latestTime
|
||||
|
||||
runApplication decomposePar -force
|
||||
|
||||
runParallel renumberMesh -overwrite
|
||||
|
||||
runParallel $(getApplication)
|
||||
|
||||
runApplication reconstructPar -latestTime
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -48,12 +48,6 @@ boundaryField
|
||||
{
|
||||
type slip;
|
||||
}
|
||||
|
||||
"(upperInterface|lowerInterface)"
|
||||
{
|
||||
type cyclicAMI;
|
||||
value $internalField;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -44,12 +44,6 @@ boundaryField
|
||||
{
|
||||
type slip;
|
||||
}
|
||||
|
||||
"(upperInterface|lowerInterface)"
|
||||
{
|
||||
type cyclicAMI;
|
||||
value $internalField;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -49,12 +49,6 @@ boundaryField
|
||||
{
|
||||
type slip;
|
||||
}
|
||||
|
||||
"(upperInterface|lowerInterface)"
|
||||
{
|
||||
type cyclicAMI;
|
||||
value $internalField;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -44,12 +44,6 @@ boundaryField
|
||||
{
|
||||
type slip;
|
||||
}
|
||||
|
||||
"(upperInterface|lowerInterface)"
|
||||
{
|
||||
type cyclicAMI;
|
||||
value $internalField;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -47,12 +47,6 @@ boundaryField
|
||||
{
|
||||
type slip;
|
||||
}
|
||||
|
||||
"(upperInterface|lowerInterface)"
|
||||
{
|
||||
type cyclicAMI;
|
||||
value $internalField;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -37,12 +37,6 @@ boundaryField
|
||||
type fixedValue;
|
||||
value uniform 10.123;
|
||||
}
|
||||
|
||||
"(upperInterface|lowerInterface)"
|
||||
{
|
||||
type cyclicAMI;
|
||||
value $internalField;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user