Nonlinear calculation of arbitrarily shaped supercavitating hydrofoils near a free surface