2022-04-11 16:06:36 +02:00
|
|
|
#!/usr/bin/env sh
|
|
|
|
echo START
|
|
|
|
export inp="of"
|
2022-05-03 11:13:27 +02:00
|
|
|
read -p "Case: " out
|
|
|
|
export out_of="out_of_$out"
|
|
|
|
export out_post="out_post_$out"
|
2022-04-11 16:06:36 +02:00
|
|
|
|
2022-05-03 11:13:27 +02:00
|
|
|
cp -r --reflink $inp $out_of
|
|
|
|
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-03 11:13:27 +02:00
|
|
|
python -m processing.sws_ola -o $out_of
|
2022-04-11 16:06:36 +02:00
|
|
|
echo Converting swash output to boundary condition
|
2022-05-03 11:13:27 +02:00
|
|
|
python -m processing.sws_wavedict_paddle -o $out_of
|
|
|
|
pushd $out_of
|
2022-04-11 16:06:36 +02:00
|
|
|
|
|
|
|
echo Generating parallel cases
|
|
|
|
decomposePar > log/decomposePar.log
|
|
|
|
echo Running model
|
|
|
|
mpirun -np 4 olaFlow -parallel > log/olaFlow.log
|
|
|
|
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-03 09:14:06 +02:00
|
|
|
popd
|
|
|
|
echo Pickling Olaflow output
|
2022-05-03 11:13:27 +02:00
|
|
|
python -m processing.pickle -i $out_of -o $out_post
|
2022-05-03 09:14:06 +02:00
|
|
|
|
2022-04-11 16:06:36 +02:00
|
|
|
echo END
|