The calculated distance (air line) between Valencia and Castelldefels is approximately 176 miles respectively 283 kilometers.
By car or train, the actual journey to Castelldefels is certainly longer, as only the direct route (as the crow flies) between Valencia and Castelldefels has been calculated here.
Air line (approximately)
283 kilometers
152 nautical miles