In this work a fully passive energy harvesting foil is studied computationally. An in-house 2nd order finite volume CFD solver, MaPFlow, is strongly coupled with a rigid body dynamics solver to investigate the foil operation under uniform and sheared inflow conditions with/without free surface. The mesh follows the airfoil motion using a radial basis function (RBF) mesh deformation approach. Initially, MaPFlow predictions are compared to experimental and numerical results available in the literature, where reasonable agreement is found. Next, one-phase simulations are considered for linearly sheared inflow for various shear rates. Results suggested that foil performance can be enhanced under sheared inflow conditions. Finally, two-phase simulations taking into account the free surface, for both uniform and sheared inflow, are considered. Predictions indicate a significant deterioration in performance of the system when the foil operates under the free surface due to the interaction of the shed vorticity with the free surface.