Model of crystallization in a confined space applied to iron uptake and release by ferritin