ship generator working principle