PhreeqcUsers Discussion Forum

Beginners => PHREEQC basics => Topic started by: Charlie on November 26, 2020, 09:43:25 AM

Title: Easy solution speciation plots
Post by: Charlie on November 26, 2020, 09:43:25 AM
This input should be of use for those wishing to make solution speciation plots. This example is for Cu, but it can be edited easily for other purposes.
Quote
TITLE Cu speciation with increasing pH

#### Define solution ####
SOLUTION 1
     -units  mg/l
     #pH      8.0
     Cu   100 
     Na      100.    charge 
     N(5)    100.

SELECTED_OUTPUT
     -file CuHNO3
     -reset false

USER_PUNCH

  10 FOR i = 2 to 10 STEP 0.25 #### define the loop conditions here. from pH 2 - 10, step size of 0.25

  20 a$ = EOL$ + "USE solution 1" + CHR$(59) + EOL$
  30 a$ = a$ + "EQUILIBRIUM_PHASES 1" + EOL$
  40 a$ = a$ + "   Fix_H+ " + STR$(-i) + " HNO3 10.0" + EOL$
  50 a$ = a$ + "END" + EOL$
  60 PUNCH a$
  70 NEXT i
END



#### Model definitions ####
PHASES
   Fix_H+
   H+ = H+
   log_k  0.0

   NaNO3
   NaNO3 = Na+ + NO3-
   log_K -20

END

 

SELECTED_OUTPUT
   -file loop.xls
   -reset true
   -molalities         Cu+2 CuNO3+ Cu2(OH)2+2 CuOH+ Cu(OH)2
USER_PUNCH
 10
USER_GRAPH 1 Example Cu speciation
   -headings         Cu+2 CuNO3+ Cu2(OH)2+2 CuOH+ Cu(OH)2
   -axis_titles      "pH" "Fraction of Cu(2)"
   -chart_title      "Cu speciation (dissolved)"
   -axis_scale x_axis         2 10 0.5
   -axis_scale y_axis         0 1 0.5
  -start
   10 graph_y  MOL("Cu+2")/TOT("Cu"), MOL("CuNO3+")/TOT("Cu"), MOL("Cu2(OH)2+2")/TOT("Cu"),MOL("CuOH+")/TOT("Cu"),MOL("Cu(OH)2")/TOT("Cu")
   60 graph_x   -LA("H+")
  -end
INCLUDE$ CuHNO3
END


USER_GRAPH 1
     -detach
END