TUT: fix mesh/parallel/cavity for Alltest mode
- use foamListTimes instead of hard-coded time to track the redistribution point. Still slightly fragile...
This commit is contained in:
parent
7b7dde0a6d
commit
81f0620b7b
@ -7,7 +7,7 @@
|
|||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Copyright (C) 2011-2016 OpenFOAM Foundation
|
# Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
# Copyright (C) 2017-2023 OpenCFD Ltd.
|
# Copyright (C) 2017-2024 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
@ -150,6 +150,7 @@ modifyCaseControlDict()
|
|||||||
{
|
{
|
||||||
for dict in $(find . -name "controlDict*" -type f)
|
for dict in $(find . -name "controlDict*" -type f)
|
||||||
do
|
do
|
||||||
|
case "${dict}" in (*.orig) continue;; esac
|
||||||
cp -f "${dict}" "${dict}.orig"
|
cp -f "${dict}" "${dict}.orig"
|
||||||
sed \
|
sed \
|
||||||
-e 's/\(startFrom[ \t]*\)[^ \t;]*;/\1 latestTime;/' \
|
-e 's/\(startFrom[ \t]*\)[^ \t;]*;/\1 latestTime;/' \
|
||||||
|
@ -25,16 +25,27 @@ runParallel -s random icoFoam $fileHandler
|
|||||||
# Pick up last result
|
# Pick up last result
|
||||||
cp system/controlDict-latestTime system/controlDict
|
cp system/controlDict-latestTime system/controlDict
|
||||||
|
|
||||||
# Redistribute to 5 processors. Note that new processors only get written
|
# Redistribute to 5 processors.
|
||||||
# a mesh to the current time (0.505). Use -overwrite instead to write the
|
# Note that new processors only get written with a mesh at the current time.
|
||||||
# mesh to constant.
|
# Use -overwrite instead to write the mesh to constant
|
||||||
runParallel -s 5 $decompDict5 redistributePar -cellDist $fileHandler
|
runParallel -s 5 $decompDict5 redistributePar -cellDist $fileHandler
|
||||||
|
|
||||||
|
latestTime=$(foamListTimes -processor -latestTime)
|
||||||
|
|
||||||
|
echo "New mesh distribution. Time = $latestTime"
|
||||||
|
|
||||||
# Run a bit more
|
# Run a bit more
|
||||||
runParallel -s 5 $decompDict5 icoFoam $fileHandler
|
runParallel -s 5 $decompDict5 icoFoam $fileHandler
|
||||||
|
|
||||||
# Reconstruct mesh and results. Note the time argument to make sure we
|
# Reconstruct mesh and results.
|
||||||
# only pick up the new decomposition
|
# The time argument to make sure we only pick up the new decomposition
|
||||||
runParallel -s reconstruct -np 5 redistributePar -reconstruct -time 0.505: $fileHandler
|
if [ -n "$latestTime" ]
|
||||||
|
then
|
||||||
|
runParallel -s reconstruct -np 5 redistributePar -reconstruct \
|
||||||
|
-time "${latestTime}:" $fileHandler
|
||||||
|
else
|
||||||
|
runParallel -s reconstruct -np 5 redistributePar -reconstruct \
|
||||||
|
-latestTime $fileHandler
|
||||||
|
fi
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user