Algorithms for activity correction models for geochemical speciation and reactive transport modelling