A new generalized transient-flow model for a three-dimensional (3D) compartmentalized system with n compartments has been developed analytically. Each compartment may have distinct rock and fluid properties and may produce through a number of partially penetrating wells. A partially communicating fault or barrier causing poor hydraulic communication between a pair of adjoining compartments is modeled as a thin skin at the interface. Production rates and conditions at the extreme boundaries are considered to be time variant. The solution was also validated by examining a few limiting cases. An example problem with stacked channel realization was studied. A simple method for detecting the poorly drained compartments from the extended drawdown data was developed. This has also lead to an estimation of hydrocarbon-pore volume in each compartment.