The appearance of gas bubbles in the fluid flowing through porous medium, i
s described by the kinetic theory of nucleation. Rate of gas exsolution is
inversely proportional to the viscosity of fluid, and it is slow for heavy
oils which are of interest. The foamy state is interpreted as a metastable
state which starts developing at pressures below the bubble-point of a gas-
fluid phase diagram. The amount of gaseous phase is determined kinetically,
that is, by the rate of nucleation. Mass balance analysis for the compound
foamy fluid gives the spatio-temporal evolution of the foamy zone which st
arts growing around the wellbore. Fluid pressure in the foamy zone exhibits
a steeper gradient, compared to the nonfoamy flow. The conditions of sand
production instability via tensile failure at the foamy front are also dete
rmined, and this constitutes a condition for liquefaction and loss of effec
tive stress in the granular medium.