Chaotic flow generated by an oscillating foil