Mathematical model of oil generation, degradation and expulsion