Smooth Second Boundary Value Problem for Optimal Transport