When calculating pKa, the main problem is to correctly estimate the solvation energy of all particles involved in the process. You can see a detailed description of how this was done in our work DOI: 10.1007/s00894-018-3726-4 Perhaps this will answer your question.