titration.ppi

SPECIATION
  calculationType                      custom
  calculationMethod                    1
  selectedOutputLines                  auto      # get as many lines as there are -> out file

PLOT
  plotTitle                            "Acid titration of 50 mL of groundwater<br>(using REACTION keyword)"
  xtitle                               "ml 0.16M HCl"
  ytitle                               pH
  customXcolumn                        ml
  pxmax                                3
  lines                                pH Gran   # from selected output
  points                               Gran      # from selected output
  labelSize                            0         # suppress curve labels inside plot
  lineColor                            blue
  pointColor                           green
  extraText                            extratexttitration.dat 


CHEMISTRY

SELECTED_OUTPUT
  -reset false

SOLUTION 1 # Groundwater                         # the groundwater to titrate with HCl
  pH    7.05
  units mg/L
#  temp 10.5
  water 0.050 kg
  Na    6
  K     0.6
  Ca    124
  Mg    1.6
  Cl    11
  Alkalinity 348 as HCO3
  S(6)  3 as SO4
  Si    5.8

REACTION 1 Add HCl to the soln
# 1 mL of 0.16M HCl                              # this takes into account the dilution since includes water
  HCl   0.16e-3
  H2O   55.5e-3
  3 in 50 steps

USER_PUNCH
  -headings ml pH water Gran
10 VT = TOT("water")*1000                        # assumes density = 1
20 V = VT-50
30 pH = -la("H+")
40 Gran = VT*(10^-pH)*30
50 punch V, pH, VT, Gran

GAS_PHASE
  -fixed_volume
  -volume      0.01                              # 10 mL gas + 50 mL solution
  -equilibrate 1                                 # equilibrate with solution 1 to begin with - this leads to some initial degassing
   CO2(g)

END