Simulation of reactive precipitation in a semi-batch crystallizer