A framework for understanding and controlling batch cooling crystallization