Roles of oxygen vacancy and ferroelectric polarization in photovoltaic effects of BiFeO3 based devices