Optimization and design of reactive crystallization process