General Productivity Models for Wells in Homogeneous and Layered Reservoirs