Optimization of batch cooling crystallization