Skip to content

Commit

Permalink
Merge pull request #90 from dlparkhurst/mix_error
Browse files Browse the repository at this point in the history
Mix error
  • Loading branch information
scharlton2 authored Jan 6, 2025
2 parents 8891a6a + 4bb7b85 commit 0609b6d
Show file tree
Hide file tree
Showing 24 changed files with 66 additions and 48 deletions.
2 changes: 1 addition & 1 deletion database/Amm.dat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# PHREEQC.DAT for calculating temperature and pressure dependence of reactions, and the specific conductance and viscosity of the solution. Based on:
# Amm.dat for calculating temperature and pressure dependence of reactions, and the specific conductance and viscosity of the solution. Based on:
# diffusion coefficients and molal volumina of aqueous species, solubility and volume of minerals, and critical temperatures and pressures of gases in Peng-Robinson's EOS.
# Details are given at the end of this file.

Expand Down
2 changes: 1 addition & 1 deletion database/Kinec.v2.dat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# KINEC.v2.dat - last edited April 18, 2024 by MA and EHO.
# Kinec.v2.dat - last edited April 18, 2024 by MA and EHO.
#
# This database contains the parameters for calculating mineral dissolution rates for primary and secondary silicate minerals using the equations and parameters reported by Hermanska et al. (2022, 2023),
# and dissolution rates for other non)-silicate mineral systems using the equations and parameters reported by Oelkers and Addassi (2024, in preparation).
Expand Down
2 changes: 1 addition & 1 deletion database/Kinec_v3.dat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# KINEC_v3.dat - last edited July 23, 2024 by MA and EHO.
# Kinec_v3.dat - last edited July 23, 2024 by MA and EHO.
#
# This database contains the parameters for calculating mineral dissolution rates for primary and secondary silicate minerals using the equations and parameters reported by Hermanska et al. (2022, 2023),
# and dissolution rates for other mineral systems using the equations and parameters reported by Oelkers and addassi (2024*).
Expand Down
1 change: 0 additions & 1 deletion database/Tipping_Hurley.dat
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# Created 17 May 2024 14:30:44
# c:\3rdParty\lsp\lsp.exe -f2 -k="asis" -ts "Tipping_Hurley.dat"

# $Id: wateq4f.dat 6895 2012-08-21 18:10:05Z dlpark $
# Revised arsenic data from Archer and Nordstrom (2002)

SOLUTION_MASTER_SPECIES
Expand Down
6 changes: 3 additions & 3 deletions database/phreeqc.dat
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# File 1 = C:\GitPrograms\phreeqc3-1\database\Amm.dat, 22/05/2024 19:38, 1948 lines, 55817 bytes, md5=78b3659799b73ddca128328b6ee7533b
# File 1 = C:\GitPrograms\phreeqc3-1\database\phreeqc.dat, 22/05/2024 19:38, 1948 lines, 55817 bytes, md5=78b3659799b73ddca128328b6ee7533b
# Created 22 May 2024 19:55:37
# C:\3rdParty\lsp\lsp.exe -f2 -k=asis -ts Amm.dat
# C:\3rdParty\lsp\lsp.exe -f2 -k=asis -ts phreeqc.dat

# PHREEQC.DAT for calculating temperature and pressure dependence of reactions, and the specific conductance and viscosity of the solution. Based on:
# phreeqc.dat for calculating temperature and pressure dependence of reactions, and the specific conductance and viscosity of the solution. Based on:
# diffusion coefficients and molal volumina of aqueous species, solubility and volume of minerals, and critical temperatures and pressures of gases in Peng-Robinson's EOS.
# Details are given at the end of this file.

Expand Down
2 changes: 1 addition & 1 deletion database/phreeqc_rates.dat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# PHREEQC.DAT for calculating temperature and pressure dependence of reactions, and the specific conductance and viscosity of the solution. Augmented with kinetic rates for minerals from compilations. Based on:
# phreeqc_rates.dat for calculating temperature and pressure dependence of reactions, and the specific conductance and viscosity of the solution. Augmented with kinetic rates for minerals from compilations. Based on:
# diffusion coefficients and molal volumina of aqueous species, solubility and volume of minerals, and critical temperatures and pressures of gases in Peng-Robinson's EOS.
# Details are given at the end of this file.

Expand Down
2 changes: 1 addition & 1 deletion database/pitzer.dat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Pitzer.DAT for calculating temperature and pressure dependence of reactions, and the specific conductance and viscosity of the solution, using
# pitzer.dat for calculating temperature and pressure dependence of reactions, and the specific conductance and viscosity of the solution, using
# diffusion coefficients of species, molal volumina of aqueous species and minerals, and critical temperatures and pressures of gases used in Peng-Robinson's EOS.
# Details are given at the end of this file.

Expand Down
2 changes: 2 additions & 0 deletions examples/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ examplesdir = $(docdir)/examples
dist_examples_DATA = $(EXAMPLES)

EXAMPLES= \
co2.dat \
co2_VP.dat \
co2.tsv \
ex1 \
ex2 \
Expand Down
4 changes: 2 additions & 2 deletions examples/ex11
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ USER_GRAPH 1
END
TRANSPORT
-cells 40
-lengths 0.002
-lengths 40*0.002
-shifts 100
-time_step 720.0
-flow_direction forward
-boundary_conditions flux flux
-diffusion_coefficient 0.0e-9
-dispersivities 0.002
-dispersivities 40*0.002
-correct_disp true
-punch_cells 40
-punch_frequency 1
Expand Down
4 changes: 2 additions & 2 deletions examples/ex12
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ TRANSPORT # Make column temperature 0C, displace Cl
-shifts 60
-flow_direction forward
-boundary_conditions flux flux
-lengths 0.333333
-dispersivities 0.0 # No dispersion
-lengths 60*0.333333
-dispersivities 60*0.0 # No dispersion
-diffusion_coefficient 0.0 # No diffusion
-thermal_diffusion 1.0 # No retardation for heat
END
Expand Down
7 changes: 4 additions & 3 deletions examples/ex12a
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ TRANSPORT # Diffuse 24C, NaCl solution from column ends
-shifts 1
-flow_direction diffusion
-boundary_conditions constant closed
-lengths 1.0
-lengths 20*1.0
-thermal_diffusion 3.0 # Heat is retarded equal to Na
-dispersivities 0.0 # No dispersion
-dispersivities 20*0.0 # No dispersion
-diffusion_coefficient 0.3e-9 # m^2/s
-time_step 1.0e+10 # 317 years, 19 substeps will be used
SELECTED_OUTPUT
Expand Down Expand Up @@ -121,7 +121,8 @@ END
#
TRANSPORT # no need to redefine parameters that don't change from 20 cell model
-cells 60
-lengths 0.33333333333333333
-lengths 60*0.33333333333333333
-disp 60*0.0
-punch_cells 1-60
SELECTED_OUTPUT
-active true # See also PRINT; selected_output false
Expand Down
4 changes: 2 additions & 2 deletions examples/ex13a
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ TRANSPORT
-time_step 3600
-boundary_conditions flux flux
-diffusion_coefficient 0.0
-lengths 0.1
-dispersivities 0.015
-lengths 20*0.1
-dispersivities 20*0.015
-stagnant 1 6.8e-6 0.3 0.1
# 1 stagnant layer^, ^alpha, ^epsil(m), ^epsil(im)
END
Expand Down
8 changes: 4 additions & 4 deletions examples/ex13ac
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ TRANSPORT
-time_step 3600
-boundary_conditions flux flux
-diffusion_coefficient 0.0
-lengths 0.1
-dispersivities 0.015
-lengths 20*0.1
-dispersivities 20*0.015
-stagnant 1 6.8e-6 0.3 0.1
# 1 stagnant layer^, ^alpha, ^epsil(m), ^epsil(im)
END
Expand Down Expand Up @@ -228,8 +228,8 @@ TRANSPORT
-time_step 3600
-boundary_conditions flux flux
-diffusion_coefficient 0.0
-lengths 0.1
-dispersivities 0.015
-lengths 20*0.1
-dispersivities 20*0.015
-stagnant 5
END
SOLUTION 0 # Original solution reenters
Expand Down
4 changes: 2 additions & 2 deletions examples/ex13b
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ TRANSPORT
-time_step 3600
-boundary_conditions flux flux
-diffusion_coefficient 0.0
-lengths 0.1
-dispersivities 0.015
-lengths 20*0.1
-dispersivities 20*0.015
-stagnant 1
END
SOLUTION 0 # Original solution reenters
Expand Down
4 changes: 2 additions & 2 deletions examples/ex13c
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ TRANSPORT
-time_step 3600
-boundary_conditions flux flux
-diffusion_coefficient 0.0
-lengths 0.1
-dispersivities 0.015
-lengths 20*0.1
-dispersivities 20*0.015
-stagnant 5
END
SOLUTION 0 # Original solution reenters
Expand Down
8 changes: 4 additions & 4 deletions examples/ex15
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,12 @@ USER_GRAPH 2 Example 15
-end -end
TRANSPORT First 20 hours have NTA and cobalt in infilling solution
-cells 10
-lengths 1
-lengths 10*1
-shifts 20
-time_step 3600
-flow_direction forward
-boundary_conditions flux flux
-dispersivities .05
-dispersivities 10*.05
-correct_disp true
-diffusion_coefficient 0.0
-punch_cells 10
Expand Down Expand Up @@ -183,13 +183,13 @@ USER_GRAPH 2
-end
TRANSPORT First 20 hours have NTA and cobalt in infilling solution
-cells 20
-lengths 0.5
-lengths 20*0.5
-shifts 40
-initial_time 0
-time_step 1800
-flow_direction forward
-boundary_conditions flux flux
-dispersivities .05
-dispersivities 20*.05
-correct_disp true
-diffusion_coefficient 0.0
-punch_cells 20
Expand Down
8 changes: 4 additions & 4 deletions examples/ex15a
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,12 @@ USER_GRAPH Example 15A
-end
TRANSPORT First 20 hours have NTA and cobalt in infilling solution
-cells 10
-lengths 1
-lengths 10*1
-shifts 20
-time_step 3600
-flow_direction forward
-boundary_conditions flux flux
-dispersivities .05
-dispersivities 10*.05
-correct_disp true
-diffusion_coefficient 0.0
-punch_cells 10
Expand Down Expand Up @@ -156,13 +156,13 @@ USER_GRAPH
-end
TRANSPORT First 20 hours have NTA and cobalt in infilling solution
-cells 20
-lengths 0.5
-lengths 20*0.5
-shifts 40
-initial_time 0
-time_step 1800
-flow_direction forward
-boundary_conditions flux flux
-dispersivities .05
-dispersivities 20*.05
-correct_disp true
-diffusion_coefficient 0.0
-punch_cells 20
Expand Down
8 changes: 4 additions & 4 deletions examples/ex15b
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@ USER_PUNCH
-end
TRANSPORT First 20 hours have NTA and cobalt in infilling solution
-cells 10
-lengths 1
-lengths 10*1
-shifts 20
-time_step 3600
-flow_direction forward
-boundary_conditions flux flux
-dispersivities .05
-dispersivities 10*.05
-correct_disp true
-diffusion_coefficient 0.0
-punch_cells 10
Expand Down Expand Up @@ -147,13 +147,13 @@ USER_PUNCH
-end
TRANSPORT First 20 hours have NTA and cobalt in infilling solution
-cells 20
-lengths 0.5
-lengths 20*0.5
-shifts 40
-initial_time 0
-time_step 1800
-flow_direction forward
-boundary_conditions flux flux
-dispersivities .05
-dispersivities 20*.05
-correct_disp true
-diffusion_coefficient 0.0
-punch_cells 20
Expand Down
1 change: 1 addition & 0 deletions examples/ex20b
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ USER_PUNCH
END
PRINT
-selected_output false
-warnings 0
END
INCLUDE$ ex20_open
END
Expand Down
1 change: 1 addition & 0 deletions examples/ex21
Original file line number Diff line number Diff line change
Expand Up @@ -357,5 +357,6 @@ USER_PUNCH
END
PRINT
-selected_out false
-status false
INCLUDE$ radial
END
2 changes: 2 additions & 0 deletions examples/ex22
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
TITLE Example 22.--Compare experimental CO2 solubilities at high CO2 pressure with
Peng-Robinson calc`ns with fixed-volume gas_phase, 25, 50, 75, 100, 150 oC.
#PRINT; -reset false
PRINT
-warnings 0
SOLUTION 1
GAS_PHASE 1
-fixed_volume
Expand Down
2 changes: 2 additions & 0 deletions examples/ex9
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ Goethite
Fe_triOOH + 3 H+ = Fe_tri+3 + 2 H2O
log_k -1.0
END
PRINT
-warnings 0
SOLUTION 1
pH 7.0
pe 10.0 O2(g) -0.67
Expand Down
12 changes: 9 additions & 3 deletions src/mainsubs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -681,9 +681,15 @@ initial_gas_phases(int print)
if (pr.user_print)
print_user_print();
if (PR /*&& use.Get_gas_phase_ptr()->total_p > 1.0*/)
warning_msg("While initializing gas phase composition by equilibrating:\n"
" Found definitions of gas` critical temperature and pressure.\n"
" Going to use Peng-Robinson in subsequent calculations.\n");
{
std::ostringstream msg;
msg << "\nWhile initializing gas phase composition by equilibrating:\n";
msg << " Found definitions of gas critical temperature and pressure.\n";
msg << " Going to use Peng-Robinson in subsequent calculations.\n";
screen_msg(msg.str().c_str());
output_msg(msg.str().c_str());
log_msg(msg.str().c_str());
}
xgas_save(n_user);
punch_all();
/* free_model_allocs(); */
Expand Down
18 changes: 11 additions & 7 deletions src/transport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -508,13 +508,17 @@ transport(void)
/*
* Now transport
*/
if (implicit)
snprintf(token, sizeof(token), "\nCalculating implicit transport: %d (mobile) cells, %d shifts, %d mixruns, max. mixf = %g.\n\n",
count_cells, count_shifts - transport_start + 1, nmix, max_mixf);
else
snprintf(token, sizeof(token), "\nCalculating transport: %d (mobile) cells, %d shifts, %d mixruns...\n\n",
count_cells, count_shifts - transport_start + 1, nmix);
warning_msg(token);
{
if (implicit)
snprintf(token, sizeof(token), "\nCalculating implicit transport: %d (mobile) cells, %d shifts, %d mixruns, max. mixf = %g.\n\n",
count_cells, count_shifts - transport_start + 1, nmix, max_mixf);
else
snprintf(token, sizeof(token), "\nCalculating transport: %d (mobile) cells, %d shifts, %d mixruns...\n\n",
count_cells, count_shifts - transport_start + 1, nmix);
screen_msg(token);
output_msg(token);
log_msg(token);
}
max_iter = 0;
for (transport_step = transport_start; transport_step <= count_shifts;
transport_step++)
Expand Down

0 comments on commit 0609b6d

Please # to comment.