#!/bin/bash

GEOM="PRA"
RE_NUMBERS=("20000" "30000" "35000" "40000" "50000" "60000" "65000" "70000" "80000")

echo "==================================================="
echo "  Starting Cleanup for $GEOM Geometry Cases"
echo "==================================================="

for re in "${RE_NUMBERS[@]}"; do
    CASE_DIR="${GEOM}_${re}"
    
    if [ -d "$CASE_DIR" ]; then
        echo "--> Cleaning Case: $CASE_DIR"
        cd "$CASE_DIR" || exit
        
        foamListTimes -rm > /dev/null 2>&1
        
        rm -rf processor* postProcessing constant/polyMesh log.*
        
        cd ../
    else
        echo "--> Error: Directory $CASE_DIR not found!"
    fi
done

echo ""
echo "==================================================="
echo "  All $GEOM Re cases cleaned successfully."
echo "==================================================="
