#!/usr/bin/env python3
"""Compute OpenFOAM freestream Ux, Uy for a given AoA (degrees)."""
import math
import sys

U_INF = 29.2  # m/s — see simulation/parameters.yaml

def freestream(aoa_deg: float) -> tuple[float, float]:
    rad = math.radians(aoa_deg)
    return U_INF * math.cos(rad), U_INF * math.sin(rad)

if __name__ == "__main__":
    for aoa in sys.argv[1:] or ["0", "5", "9.25"]:
        aoa_f = float(aoa)
        ux, uy = freestream(aoa_f)
        print(f"AoA={aoa_f:5.2f}°  Ux={ux:.4f}  Uy={uy:.4f}  |U|={U_INF}")
