PhreeqcUsers Discussion Forum
USER_PUNCH/USER_GRAPH => BASIC functions => Topic started by: Zhaoyang on November 12, 2020, 08:37:58 PM
-
Dear all,
I have a question for the example attached below.
Since the unit is mol/kgw, I define Bio and Orgc as:
SOLUTION_MASTER_SPECIES
Bio Bio 0 Bio 0
Orgc Orgc 0 Orgc 0
However, it doesn't work. When I change it to
SOLUTION_MASTER_SPECIES
Bio Bio 0 1 0
Orgc Orgc 0 1 0
It works. Does anyone can explain it? Thanks for your help inadvance.
Best regrads,
Zhaoyang
PRINT
-reset false # Turn off printing the the standard output file
SOLUTION_MASTER_SPECIES
Bio Bio 0 1 0
Orgc Orgc 0 1 0
SOLUTION_SPECIES
Bio = Bio
log_k 0
Orgc = Orgc
log_k 0
RATES
Orgc_rate
-start
10 k = PARM(1)
20 rate = -k*TOT("Orgc")*TOT("Bio")
30 PUT(rate, 1)
40 moles = rate*TIME
50 SAVE moles
-end
Bio_rate
-start
10 kd = PARM(1)
20 rate = -GET(1)-kd*TOT("Bio")
30 moles = rate*TIME
40 SAVE moles
-end
SOLUTION 1
units mol/kgw
Bio 2
Orgc 2
KINETICS 1
Orgc_rate
-formula Orgc 1
-m0 100
-parms 0.006
Bio_rate
-formula Bio 1
-m0 100
-parms 0.0006
-steps 500 in 100 steps # seconds
INCREMENTAL_REACTIONS True
USER_GRAPH 1
-initial_solutions true
-axis_scale x_axis 0 500 100
-axis_scale y_axis 0 4.1 1
-axis_titles "Time (s)" "Concentration [molal]"
-headings Orgc Bio
-start
10 PLOT_XY TOTAL_TIME, TOT("Orgc")
20 PLOT_XY TOTAL_TIME, TOT("Bio")
-end
-
The error is as follows:
ERROR: Gram formula wt in SOLUTION_MASTER_SPECIES should not be <= 0.0, Bio.
ERROR: Gram formula wt in SOLUTION_MASTER_SPECIES should not be <= 0.0, Orgc.
The error is generated when PHREEQC tries to calculate gram formula weight for each element. It perhaps should not be an error in the case where all concentrations are given in molal, but the program is not that smart.
As it processes the SOLUTION_MASTER_SPECIES data block, when 1s are used, it finds the gfw for Bio and Orgc to be 1 g/mol; it is not zero, so it thinks things are OK. When Bio and Orgc are used, it looks up the value of the last column, which is zero. It then thinks the gram formula weight should be zero and produces the error.
Logically, the final column should not be zeros in either case. That column defines the gfw of the element , so for example, if SO4 is defined in the fourth column, 32 (gfw of S) is defined in the fifth column, and the gfw of SO4 is calculated by adding gfw(S) (32) and 4*gfw(O), where gfw(O) is the fifth column of the O definition in SOLUTION_MASTER_SPECIES.