51 lines
1.1 KiB
Bash
Executable file
51 lines
1.1 KiB
Bash
Executable file
#!/usr/bin/env sh
|
|
echo START
|
|
export cas="$1"
|
|
export inp_of="of_$cas"
|
|
export out_of="out_of_$cas"
|
|
export out_post="out_post_$cas"
|
|
|
|
if [[ ! -d $inp_of ]]
|
|
then echo $inp_of not found
|
|
exit 1
|
|
fi
|
|
|
|
echo 0
|
|
exit 0
|
|
|
|
cp -r --reflink $inp_of $out_of
|
|
pushd $out_of
|
|
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
|
|
|
|
popd
|
|
echo Converting swash output to initial condition
|
|
python -m processing.sws_ola -o $out_of
|
|
echo Converting swash output to boundary condition
|
|
python -m processing.sws_wavedict_paddle -o $out_of
|
|
pushd $out_of
|
|
|
|
echo Generating parallel cases
|
|
decomposePar > log/decomposePar.log
|
|
echo Running model
|
|
mpirun -np 6 olaFlow -parallel > log/olaFlow.log
|
|
echo Merging parallel cases
|
|
reconstructPar > log/reconstructPar.log
|
|
#echo Removing parallel cases
|
|
#rm -r processor*
|
|
|
|
echo Running Openfoam post-process
|
|
postProcess -func graphUniform > log/postProcess.log
|
|
|
|
popd
|
|
echo Pickling Olaflow output
|
|
python -m processing.pickle -i $out_of -o $out_post
|
|
|
|
echo END
|