Foam assisted oil recovery at miscible and immiscible conditions