#!/bin/sh
cd ${0%/*} || exit 1    # Run from this directory

# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions

# Make 3D mesh in slab of cells.
cd wingMotion_snappyHexMesh
runApplication blockMesh
runApplication snappyHexMesh

# Make a 2D mesh by extruding a patch and solve to steady state.
cd ../wingMotion2D_steady
runApplication extrudeMesh
runApplication createPatch
runApplication foamRun

# Copy the mesh from the steady state case and map the results to a
# mesh motion case, then solve transient.
cd ../wingMotion2D_transient
cp -R ../wingMotion2D_steady/constant/polyMesh constant
runApplication mapFields ../wingMotion2D_steady -sourceTime latestTime -consistent
cp pointDisplacement 0/pointDisplacement
runApplication decomposePar
runParallel foamRun
runApplication reconstructPar

#------------------------------------------------------------------------------
