Rafael Nadal defeated Ryan Harrison of the USA in three sets to reach the second round of the US Open.