Mehl, ValerieValerieMehlJohannsen, KlausKlausJohannsen2019-08-192019-08-192018-02Journal of Water Supply: Research and Technology - AQUA 1 (67): 1-11 (2018-02)http://hdl.handle.net/11420/3127Of the most commonly used calcium carbonate (CaCO3) saturation indices, the Calcium Carbonate Precipitation Potential (CCPP) most accurately describes CaCO3 precipitation and dissolution. This paper illustrates how to write an OpenModelica programme that calculates the CCPP and other key water parameters starting from total alkalinity and CO2-acidity. It describes the calculation steps of all components of the developed OpenModelica package and explains how the components work together. Underlying chemical principles follow the German standard DIN 38404-10 and are presented along with the OpenModelica code. The developed programme considers 14 different dissolved species, including complex species of carbonate, calcium, magnesium and sulphate. Data of the six phosphate-free example waters from DIN 38404-10 is compared to the results of the developed programme and the results of a programme which neglects complexation. The developed programme reaches required accuracy for four of the six CCPP values; with the other programme, requirements cannot be met. By using OpenModelica, the developed package can be readily integrated into a Modelica model of, for example, a drinking water treatment plant. There, it can help to monitor legal and technical requirements, or to assess the dissolution capacity if neutralizing filters containing CaCO3 are employed for pH adjustment.en1365-2087Journal of water supply20181111Calculating chemical speciation, pH, saturation index and calcium carbonate precipitation potential (CCPP) based on alkalinity and acidity using OpenModelicaJournal Article10.2166/aqua.2017.103Other