An investigation of factors influencing carbonate rock wettability