A cavitation algorithm for arbitrary lubricant compressibility