Of 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.