pH calculations and adjustments