2022-04-11 16:06:36 +02:00
#!/usr/bin/env sh
2022-05-03 12:15:58 +02:00
export cas = " $1 "
export inp_of = " of_ $cas "
export out_of = " out_of_ $cas "
export out_post = " out_post_ $cas "
2022-04-11 16:06:36 +02:00
2022-05-03 12:15:58 +02:00
if [ [ ! -d $inp_of ] ]
then echo $inp_of not found
exit 1
fi
2022-05-05 09:18:09 +02:00
if [ [ -d $out_of ] ]
then echo $out_of already exists
mv $out_of " $out_of .bak "
fi
if [ [ -d $out_post ] ]
then echo $out_post already exists
mv $out_post " $out_post .bak "
fi
2022-05-03 12:24:30 +02:00
echo START
2022-05-03 12:15:58 +02:00
cp -r --reflink $inp_of $out_of
2022-05-03 11:13:27 +02:00
pushd $out_of
2022-04-11 16:06:36 +02:00
source /opt/OpenFOAM/OpenFOAM-9/etc/bashrc
mkdir log
echo Generating mesh
blockMesh > log/blockMesh.log
echo Refining mesh
snappyHexMesh -overwrite > log/snappyHexMesh.log
cp -r 0.org 0
echo Setting initial fields
setFields > log/setFields.log
2022-04-12 10:29:37 +02:00
popd
2022-04-11 16:06:36 +02:00
echo Converting swash output to initial condition
2022-05-05 09:18:09 +02:00
python -m processing.sws_ola -o $out_of > $out_of /log/sws_ola.log
2022-04-11 16:06:36 +02:00
echo Converting swash output to boundary condition
2022-05-05 09:18:09 +02:00
python -m processing.sws_wavedict_paddle -o $out_of > $out_of /log/sws_wave.log
2022-05-03 11:13:27 +02:00
pushd $out_of
2022-04-11 16:06:36 +02:00
echo Generating parallel cases
decomposePar > log/decomposePar.log
echo Running model
2022-05-05 09:18:09 +02:00
mpirun --use-hwthread-cpus -np 6 olaFlow -parallel > log/olaFlow.log
2022-04-11 16:06:36 +02:00
echo Merging parallel cases
reconstructPar > log/reconstructPar.log
2022-04-14 12:37:24 +02:00
#echo Removing parallel cases
#rm -r processor*
2022-04-11 16:06:36 +02:00
2022-05-03 10:48:39 +02:00
echo Running Openfoam post-process
postProcess -func graphUniform > log/postProcess.log
2022-05-06 11:14:29 +02:00
postProcess -func graphUniform2 > log/postProcess2.log
2022-05-03 10:48:39 +02:00
2022-05-03 09:14:06 +02:00
popd
echo Pickling Olaflow output
2022-05-05 09:18:09 +02:00
python -m processing.pickle -i $out_of -o $out_post > $out_of /log/pickle.log
2022-05-03 09:14:06 +02:00
2022-04-11 16:06:36 +02:00
echo END