A time-domain simulation for predicting the downwind performance of yachts in waves