A 3D model for mechanistic control of drug release