Scott Charlton d5345a7aee Add 'phreeqc3-examples/' from commit 'e977363da4c1ae1708ebddca38d5312b6813a337'
git-subtree-dir: phreeqc3-examples
git-subtree-mainline: 8de0e98ed90bb2b639659c820168ab18c1062992
git-subtree-split: e977363da4c1ae1708ebddca38d5312b6813a337
2018-07-31 16:55:50 -06:00

172 lines
5.8 KiB
Plaintext

Input file: ..\examples\ex12a
Output file: ex12a.out
Database file: ..\database\phreeqc.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.
------------------------------------
TITLE Example 12a.--Advective and diffusive transport of heat and solutes.
Constant boundary condition at one end, closed at other.
The problem is designed so that temperature should equal Na-conc
(in mmol/kgw) after diffusion. Compares with analytical solution
for 20-cell and 60-cell models.
EXCHANGE_SPECIES
Na+ + X- = NaX
log_k 0.0
gamma 4.0 0.075
H+ + X- = HX
log_k -99.
gamma 9.0 0.0
K+ + X- = KX
log_k 0.0
gamma 3.5 0.015
SOLUTION 0 Fixed temp 24C, and NaCl conc (first type boundary cond) at inlet
units mol/kgw
temp 24
pH 7.0
pe 12.0 O2(g) -0.67
Na 24.e-3
Cl 24.e-3
SOLUTION 1-19 24.0 mM KNO3
units mol/kgw
temp 0 # Incoming solution 0C
pH 7.0
pe 12.0 O2(g) -0.67
K 24.e-3
N(5) 24.e-3
EXCHANGE 1-19
KX 0.048
SOLUTION 20 Same as soln 0 in cell 20 at closed column end (second type boundary cond)
units mol/kgw
temp 24
pH 7.0
pe 12.0 O2(g) -0.67
Na 24.e-3
Cl 24.e-3
EXCHANGE 20
NaX 0.048
PRINT
reset false
status false
COPY solution 20 58-60 # for 60-cell model
COPY exchange 20 58-60 # for 60-cell model
END
TRANSPORT # Diffuse 24C, NaCl solution from column ends
cells 20
shifts 1
flow_direction diffusion
boundary_conditions constant closed
lengths 1.0
thermal_diffusion 3.0 # Heat is retarded equal to Na
dispersivities 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
WARNING: Cell-lengths were read for 1 cells. Last value is used till cell 20.
WARNING: Dispersivities were read for 1 cells. Last value is used till cell 20.
file ex12a.sel
high_precision true
reset false
distance true
temperature true
USER_PUNCH
heading Na_mmol K_mmol Cl_mmol error_Cl error_Na
10 PUNCH TOT("Na")*1000, TOT("K")*1000, TOT("Cl")*1000
20 x = DIST
30 if (x > 8.5 OR SIM_TIME <= 0) THEN END
40 IF (ABS(x MOD 0.5) > 1e-3) OR (TC <= 0) THEN END
50 DATA 0.254829592, -0.284496736, 1.421413741, -1.453152027, 1.061405429, 0.3275911
60 READ a1, a2, a3, a4, a5, a6
70 REM calculate error in Cl
80 z = x / (2*SQRT(3e-10 * SIM_TIME / 1.0))
90 GOSUB 2000 # erfc(z)...
100 erfc_Cl = erfc
110 REM calculate error in Na, 3 times retarded
120 z = z * SQRT(3.0)
130 GOSUB 2000 # erfc(z)...
140 erfc_Na = erfc
150 REM punch results
160 error_Cl = 0.024 * erfc_Cl - TOT("Cl")
170 error_Na = 0.024 * erfc_Na - TOT("Na")
180 PUNCH error_Cl, error_Na
190 REM store results
200 j = x - 0.5
210 PUT(error_Cl, SIM_NO, j, 1)
220 PUT(error_Na, SIM_NO, j, 2)
500 END
2000 REM calculate erfc...
2050 b = 1 / (1 + a6 * z)
2060 erfc = b * (a1 + b * (a2 + b * (a3 + b * (a4 + b * a5)))) * EXP(-(z * z))
2080 RETURN
END
SELECTED_OUTPUT
user_punch false
SOLUTION 1-57 24.0 mM KNO3
units mol/kgw
temp 0 # Incoming solution 0C
pH 7.0
pe 12.0 O2(g) -0.67
K 24.e-3
N(5) 24.e-3
EXCHANGE 1-57
KX 0.048
END
TRANSPORT # no need to redefine parameters that don't change from 20 cell model
cells 60
lengths 0.33333333333333333
punch_cells 1-60
SELECTED_OUTPUT
WARNING: Cell-lengths were read for 1 cells. Last value is used till cell 60.
WARNING: No dispersivities were read; disp = 0 assumed.
user_punch true
END
SOLUTION # Initial solution calculation for pure water
PRINT
reset false # Initial solution calculation not printed
user_print true
SELECTED_OUTPUT
high_precision false # Controls precision for USER_PRINT too.
USER_PRINT
10 PRINT " Error in Cl concentration Error in Na concentration"
20 PRINT " ------------------------- -------------------------"
30 PRINT " Distance 20-cell 60-cell 20-cell 60-cell"
40 PRINT " "
50 FOR j = 0 TO 8
60 PRINT j + 0.5, GET(2, j, 1), GET(4, j, 1), GET(2, j, 2), GET(4, j, 2)
70 NEXT j
END
----------------------------------User print-----------------------------------
Error in Cl concentration Error in Na concentration
------------------------- -------------------------
Distance 20-cell 60-cell 20-cell 60-cell
5.0000e-001 4.3817e-006 9.0009e-008 5.0683e-004 3.9986e-005
1.5000e+000 1.7304e-005 1.0407e-006 5.1271e-004 5.7063e-005
2.5000e+000 3.5613e-005 3.2028e-006 9.1860e-005 1.6175e-005
3.5000e+000 4.9599e-005 5.2170e-006 -3.6825e-005 -3.3665e-006
4.5000e+000 5.0063e-005 5.6393e-006 -1.9684e-005 -2.4769e-006
5.5000e+000 3.8208e-005 4.4560e-006 -4.0513e-006 -4.9123e-007
6.5000e+000 2.2627e-005 2.6979e-006 -4.8731e-007 -4.8141e-008
7.5000e+000 1.0547e-005 1.2626e-006 -3.9008e-008 -2.6645e-009
8.5000e+000 3.8231e-006 2.9867e-007 -2.2212e-009 -8.8983e-011
-------------------------------
End of Run after 2.401 Seconds.
-------------------------------