Skip to content

Commit

Permalink
Merge pull request #87 from dlparkhurst/mix_error
Browse files Browse the repository at this point in the history
Mix error
  • Loading branch information
scharlton2 authored Dec 6, 2024
2 parents 0cd7521 + 0c20180 commit 85a8348
Show file tree
Hide file tree
Showing 6 changed files with 114 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.3)
cmake_minimum_required(VERSION 3.10)

project(phreeqc)

Expand Down
2 changes: 1 addition & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 3.9)
cmake_minimum_required (VERSION 3.10)

SET(phreeqc_EXAMPLES
co2.dat
Expand Down
4 changes: 3 additions & 1 deletion mytest/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 3.9)
cmake_minimum_required (VERSION 3.10)

set(TESTS
NH4_2_SO4
Expand Down Expand Up @@ -408,6 +408,7 @@ set(TESTS
str_f
stuyfz
surf_check
surf_error
surf_kin_related
surf_kin_related_pz
surf_related
Expand Down Expand Up @@ -498,6 +499,7 @@ set(FAILS
pitzer_fail
punch_stream
raw
surf_error
surf_related_warnings
Syn1_acidbase
wjAs2
Expand Down
40 changes: 40 additions & 0 deletions mytest/surf_error
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
DATABASE ../database/wateq4f.dat

SOLUTION_SPECIES
CaCO3 +1.0000 H+ = + 1.0000 Ca++ + 1.0000 HCO3-
log_k 1.8487
#FeS2 +1.0000 H2O = + 0.2500 H+ + 0.2500 SO4-- + 1.0000 Fe++ + 1.7500 HS-
# log_k -24.6534
Hfo_sOH + Ca+2 = Hfo_sOHCa+2
log_k 4.97
Hfo_wOH + Ca+2 = Hfo_wOCa+ + H+
log_k -5.85
12.0000 H2O + 11.0000 UO2++ + 6.0000 HCO3- = (UO2)11(CO3)6(OH)12-2 +18.0000 H+
log_k -25.7347
3.0000 H2O + 2.0000 UO2++ + 1.0000 HCO3- = (UO2)2CO3(OH)3- +4.0000 H+
log_k -11.2229
6.0000 HCO3- + 3.0000 UO2++ = (UO2)3(CO3)6-6 +6.0000 H+
log_k -8.0601
1.0000 UO2++ + 0.5000 H2O = UO2+ +1.0000 H+ +0.2500 O2
log_k -20.0169
3.0000 UO2++ + 3.0000 H2O + 1.0000 HCO3- = (UO2)3O(OH)2(HCO3)+ +4.0000 H+
log_k -9.7129

SURFACE_MASTER_SPECIES

HCO3-

SURFACE 1
Hfo_sOH 2.7e-4 500 0.05
Hfo_wOH 1000
HCO3- 100

SOLUTION 1

temp 25
pH 7
units mmol/L
U 250 ug/L
Ca 1.0
C 2
-water 0.1
60 changes: 60 additions & 0 deletions mytest/surf_error.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
Input file: surf_error
Output file: surf_error.out
Database file: ../database/wateq4f.dat

------------------
Reading data base.
------------------

SOLUTION_MASTER_SPECIES
SOLUTION_SPECIES
PHASES
EXCHANGE_MASTER_SPECIES
EXCHANGE_SPECIES
SURFACE_MASTER_SPECIES
SURFACE_SPECIES
RATES
END
------------------------------------
Reading input data for simulation 1.
------------------------------------

DATABASE ../database/wateq4f.dat
SOLUTION_SPECIES
CaCO3 +1.0000 H+ = + 1.0000 Ca++ + 1.0000 HCO3-
log_k 1.8487
Hfo_sOH + Ca+2 = Hfo_sOHCa+2
log_k 4.97
Hfo_wOH + Ca+2 = Hfo_wOCa+ + H+
log_k -5.85
12.0000 H2O + 11.0000 UO2++ + 6.0000 HCO3- = (UO2)11(CO3)6(OH)12-2 +18.0000 H+
log_k -25.7347
3.0000 H2O + 2.0000 UO2++ + 1.0000 HCO3- = (UO2)2CO3(OH)3- +4.0000 H+
log_k -11.2229
6.0000 HCO3- + 3.0000 UO2++ = (UO2)3(CO3)6-6 +6.0000 H+
log_k -8.0601
1.0000 UO2++ + 0.5000 H2O = UO2+ +1.0000 H+ +0.2500 O2
log_k -20.0169
3.0000 UO2++ + 3.0000 H2O + 1.0000 HCO3- = (UO2)3O(OH)2(HCO3)+ +4.0000 H+
log_k -9.7129
SURFACE_MASTER_SPECIES
HCO3-
ERROR: Reading surface master species name.
ERROR: HCO3-
SURFACE 1
Hfo_sOH 2.7e-4 500 0.05
Hfo_wOH 1000
HCO3- 100
SOLUTION 1
ERROR: Surface area not defined for H.

temp 25
pH 7
units mmol/L
U 250 ug/L
Ca 1.0
C 2
water 0.1
ERROR: Element or valence name in SOLUTION_MASTER_SPECIES should include only one element, HCO3-.
ERROR: Species pointer is null for, HCO3-. Check your _MASTER_ and _SPECIES definitions.
Stopping.
9 changes: 9 additions & 0 deletions src/tidy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2312,6 +2312,15 @@ tidy_species(void)
}
/* store sequence number in master structure */
master[i]->number = i;
if (master[i]->s == NULL)
{
input_error++;
error_string = sformatf(
"Species pointer is null for, %s. Check your _MASTER_ and _SPECIES definitions.",
master[i]->elt->name);
error_msg(error_string, STOP);
}

if (strcmp(master[i]->elt->name, "Alkalinity") != 0)
{
if (master[i]->primary == TRUE)
Expand Down

0 comments on commit 85a8348

Please # to comment.