Numerical computation of flapping-wing propulsion and power extraction