Biogeochemistry of acid mine drainage and a method to control acid formation