PhreeqcUsers Discussion Forum

Conceptual Models => Database selection and modification => Topic started by: jiasg on July 22, 2019, 04:01:48 AM

Title: Error when I add new species
Post by: jiasg on July 22, 2019, 04:01:48 AM
I would like to add NO3 in the Pitzer database. I added NO3 in the master species and solution species. As a trial, I just copy other parameters for NO3. But I got the error message as below. Could anyone help on this issue? Thanks in advance!

Quote
ERROR: Elements in species have not been tabulated, NO3.ERROR: Reaction for species has not been defined, NO3.ERROR: Calculations terminating due to input errors.Stopping.

The input file is shown below
Code: [Select]
#PRINT; -reset false
DATABASE D:\mynutstore\Matlab\PhreeqcMatlab-master\database\pitzer.dat
#DATABASE C:\phreeqc\database\LLNL.dat
TITLE Test
SOLUTION_MASTER_SPECIES
N        NO3            1.0     N               14.0067
N(+5)    NO3-           0.0     N
SOLUTION_SPECIES
NO3- = NO3-
   -dw    2.01e-9  258
   -Vm   6.72  2.85  4.21  -3.14  1.38  0  -9.56e-2  7.08  -1.56e-3  1 # ref. 2
1.0000 NO3- + 1.0000 H+  =  HNO3
   log_k      1.979
   delta_h 4.91    kcal
   -analytic   -5.3585   0.0183412   557.2461
   -dw    1.33e-9
   -Vm 8.2 9.2590   2.1108   -3.1618 1.1748  0 -0.3 15 0 1 # ref. 1
SOLUTION 1 Pure water
        pH      7.0 charge
   unit   mol/kgw
        temp    25.0
   S(6)   2.08
   Na   2.09
   N(+5)   2.09
   Cl   2.09
REACTION_TEMPERATURE 1
        25.0
END
Title: Re: Error when I add new species
Post by: dlparkhurst on July 22, 2019, 05:46:43 AM
It should be NO3-, not NO3.

Code: [Select]
SOLUTION_MASTER_SPECIES
N        NO3-           1.0     N               14.0067
Title: Re: Error when I add new species
Post by: jiasg on July 22, 2019, 11:24:41 AM
Thanks a lot for your help! After correction, it runs correctly for NO3-. But when I further add NH3 in the master species, I got another error message as below.

Quote
ERROR: Could not reduce equation to primary master species, NO3-.
ERROR: Calculations terminating due to input errors.
Stopping.

The input file is shown as blow.

Code: [Select]
#PRINT; -reset false
DATABASE D:\mynutstore\Matlab\PhreeqcMatlab-master\database\pitzer.dat
#DATABASE C:\phreeqc\database\LLNL.dat
TITLE Test
SOLUTION_MASTER_SPECIES
N        NH3            1.0     N               14.0067
N(-3)    NH3            1.0     N
N(+5)    NO3-           0.0     N
SOLUTION_SPECIES
#########################################
NH3 =  NH3
-dw 1.33e-9  122  1.52  3.70
-Vm   2.28  -4.38  -4.1  -0.586  0.09  4  0.3  52  -3.33e-3  0.566 # ref. 1
1.0000 NH3 + 1.0000 H+  =  NH4+
-log_k 6.994
-delta_h -5.30 kcal
-analytical  -11.17  0.02386  3279.0
-dw 2.1e-9
-Vm  7.81  2.96  -0.46 # supcrt
#########################################
NO3- = NO3-
-dw 2.01e-9  258
-Vm   6.72  2.85  4.21  -3.14  1.38  0  -9.56e-2  7.08  -1.56e-3  1 # ref. 2
1.0000 NO3- + 1.0000 H+  =  HNO3
log_k    1.979
delta_h 4.91    kcal
-analytic   -5.3585   0.0183412   557.2461
-dw 1.33e-9
-Vm 8.2 9.2590   2.1108   -3.1618 1.1748  0 -0.3 15 0 1 # ref. 1
#########################################
SOLUTION 1 Pure water
        pH      7.0 charge
unit mol/kgw
        temp    25.0
S(6) 2.08
Na 2.09
N(+5) 2.09
Cl 2.09
REACTION_TEMPERATURE 1
        25.0
END

Then I further added the redox reaction (from NO3- to NH4+) but the error remains. I checked the manual but haven't found out the solution. Could you suggest what shall I do? Thanks again!

Code: [Select]
#PRINT; -reset false
DATABASE D:\mynutstore\Matlab\PhreeqcMatlab-master\database\pitzer.dat
#DATABASE C:\phreeqc\database\LLNL.dat
TITLE Test
SOLUTION_MASTER_SPECIES
N        NH3            1.0     N               14.0067
N(-3)    NH3            1.0     N
N(+5)    NO3-           0.0     N
E        e-             0.0     0.0             0.0
SOLUTION_SPECIES
#########################################
NH3 =  NH3
-dw 1.33e-9  122  1.52  3.70
-Vm   2.28  -4.38  -4.1  -0.586  0.09  4  0.3  52  -3.33e-3  0.566 # ref. 1
1.0000 NH3 + 1.0000 H+  =  NH4+
-log_k 6.994
-delta_h -5.30 kcal
-analytical  -11.17  0.02386  3279.0
-dw 2.1e-9
-Vm  7.81  2.96  -0.46 # supcrt
#########################################
NO3- = NO3-
-dw 2.01e-9  258
-Vm   6.72  2.85  4.21  -3.14  1.38  0  -9.56e-2  7.08  -1.56e-3  1 # ref. 2
1.0000 NO3- + 1.0000 H+  =  HNO3
log_k    1.979
delta_h 4.91    kcal
-analytic   -5.3585   0.0183412   557.2461
-dw 1.33e-9
-Vm 8.2 9.2590   2.1108   -3.1618 1.1748  0 -0.3 15 0 1 # ref. 1
#########################################
e- = e-
        log_k           0.0
NO3- + 10H+ + 8e- = NH4+ + 3H2O
        log_k           119.077
        delta_h -187.055 kcal
SOLUTION 1 Pure water
        pH      7.0 charge
unit mol/kgw
        temp    25.0
S(6) 2.08
Na 2.09
N(+5) 2.09
Cl 2.09
REACTION_TEMPERATURE 1
        25.0
END
Title: Re: Error when I add new species
Post by: dlparkhurst on July 22, 2019, 03:48:19 PM
There must be one and only one master species from which all other redox states can be formed. You must choose either NH3 (or NH4+) or NO3-, but not both, to have an identity reaction with log K of 0. If you choose NO3-, then NH3 must have an association reaction from NO3-. If you choose NH3, then NO3- must have an association reaction from NH3.

phreeqc.dat (and most other databases) has definitions of the nitrogen system with multiple redox states. Use it as an example.
Title: Re: Error when I add new species
Post by: jiasg on July 23, 2019, 04:32:34 AM
Thanks a lot! I will learn from other database.