Fluid–structure coupling for an oscillating hydrofoil