Phase redistribution has been observed to occur in oil, gas, and steam-injection wells during a shut-in test. Two empirical approachesinvolving exponential and error functionsare currently available to analyze field data. However, these methods do not have any mechanistic basis and may lead to erroneous estimates of reservoir parameters, such as skin. More importantly, these methods cannot be used in a forward mode to predict the reservoir and/or well conditions that would cause changing wellbore storage situations. Such predictions are desirable for deciding on the need for expensive downhole shut-in or flow measurement. Phase redistribution is a consequence of the higher relative velocity of the gas phase in a well's production string after shut-in at the surface. The resulting segregation of phases caused by buoyancy of the gas phase may cause wellbore pressure buildup to be quite different from normally expected response before the onset of the middle-time period. Under one scenario, the bubbles may segregate rapidly to the top of the wellbore leading to an increasing storage situation. Conversely, the bubbles may travel slowly without reaching the top to precipitate a decreasing storage situation. In either event, the commonly used constant-storage model cannot be used for test interpretation. A mechanistic approach, based on the physics of migration of a swarm of bubbles, is developed that explains the changing storage phenomenon by incorporating continually decreasing afterflow from the reservoir after shut-in, the variation of void distribution within the wellbore with depth and time, and the combined effect of afterflow and bubble migration on the wellhead and bottomhole pressures (BHP's). The model is used to develop a simulator, and a few cases are examined to illustrate the simulator's capabilities.