In deep sea oil exploitation, offshore platforms will move periodically in the water under the combined effects of waves, currents and winds. The relatively oscillatory flow is generated between the riser connected to the platform and the water. Vortex-induced Vibration (VIV) features of a single cylinder in the oscillatory flow are more complicated than that in the uniform flow. In this paper, numerical investigations on VIV of a flexible cylinder with different aspect ratios exposed to the oscillatory flow are carried out by the in-house CFD solver viv-FOAM-SJTU, which is developed based on the open source toolbox OpenFOAM. The flexible cylinder is forced to oscillate harmonically in the in-line direction in the still water and is allowed to freely vibrate in the cross-flow direction. Firstly, comparisons on referred experiments and simulations are conducted to verify the validity of the solver. Then, the modal decomposition analysis method and the Fast Fourier Transform (FFT) method are used to obtain the dominant vibration modes and frequencies of the cylinder in the following simulations.