Processes > Dissolution and precipitation
Desalination PHREEQpy applications -- ROSSpy
freiburgermsu:
Dear Dr. Parkhurst,
I reply to each of your suggestions, respectively, in the following sections.
1) I just executed your PQI file in iPHREEQC and I see the mole quantities that you cite and the 1:1 ratio of ion exchange during the precipitation of Gypsum. I have a few subsequent questions.
a)
How are the 1.82 moles SO4 and 0.35453 moles Ca calculated? Here is my logic, with the liters of solution that is provided by the PHREEQC output file from your PQI file:
SO4: 9500 (ppm SO4 = mg SO4/L solution) / [(96.04 g SO4/1 mole SO4) * (1000 mg / 1 g)] * (17.67 L solution) = 1.748 moles SO4
Ca: 774 (ppm Ca = mg Ca/L solution) / [(40.08 g Ca/1 mole Ca) * (1000 mg / 1 g)] * (17.67 L solution) = 0.3412 moles Ca
What is incorrect in this calculation?
b)
Why do you believe that "constant flux" or "flux flux" are more suitable for representing RO than "constant constant"? Leakage at the boundaries seems like it could undesirably compromise mass balance, although, the end of an RO module may indeed have some backflow. What is the significance of these boundary conditions upon the geochemical predictions?
2) I executed this PQI file as well, and I see the agreement between the Gypsum and d_Gypsum moles. Thank you for articulating the discrepancy and providing the educational PQI file.
3) Does the data from the SELECTED_OUTPUT of my file depict the change in Gypsum moles at each distance instead of the net accumulation of Gypsum over all preceeding distances? We intend for the latter, where the mineral moles is ever-increasing, albeit at perhaps a diminishing rate. The Gypsum column from your SELECTED_OUTPUT in question (2) depicts an ever-increasing moles, which suggests that our TRANSPORT or SELECTED_OUTPUT blocks are incorrect. What should be changed in these blocks to depict the total accumulation of minerals over the distance?
4) The Exchange Factor parameter is clearly and concisely defined in the 1999 manual, with a mathematical explanation.
The Example 13 input files appear to use the MIX block instead of defining a set of mobile cells [1-12], a space cell [13], and then a set of immobile cells [14-25], which we implement in this example (https://github.com/freiburgermsu/ROSSpy/blob/main/examples/sensitivity_analyses/single_vs_dual_domain/2021-10-27-ROSSpy-red_sea-transport-pitzer-scaling-all_distance-LinPerm-2/input.pqi). Is the MIX method preferential, or more accurate, than our method of the sets of cells?
I greatly appreciate your detailed answers, suggestions, and context in the PHREEQC and BASIC calculations. I can elaborate anything at your request.
Thank you :)
Andrew
dlparkhurst:
No Dr.
(a) What is incorrect in this calculation?
As my high school chemistry teacher Mr. Mullin taught us, "Follow the units". The units must cancel to arrive at the proper final units. If you are working with brines you need to be careful.
9500 (ppm SO4 = mg SO4/L solution) Wrong!
9500 ppm = 9500 mg SO4 per kg solution.
9500 mg/kgs / (1000 mg/g * 96.04 g/mol SO4) = 0.0989 mol/kgs
If you multiply by the number of kilograms of solution you will have the total number of moles in that many kilograms of solution. mol/kgs is absolutely independent of temperature and pressure.
If you have some number of liters of solution, then you need to multiply by the density and the number of liters to get the moles in that many liters of solution. mol/L will vary with temperature and pressure.
PHREEQC uses solutions based on kilograms of water, which effectively independent of temperaure and pressure (you could have a little bit of hydrolosis to create or consume some H2O with a closed-system T/P change). To convert from mol/kgs to mol/kgw, the sum of the solutes are subtracted from 1 kg to arrive at the mass of water.
--- Code: ---1 - (Cl + Na + SO4 + ...) * 1e-6 kg/mg
1 - (24756 + 16417.2 + 9500 ...) * 1e-6 = kg H2O
--- End code ---
As I said in the previous post, knowing the moles of a solute in a kilogram of solution and the mass of water in a kilogram of solution, you can convert concentrations to moles/kgw. When you use -water in the SOLUTION definition, you are defining the mass of water in the solution (not mass of solution, not liters of solution). So, if you multiply molality by the number of kilograms of water in solution, you will get the total number of moles of a solute in a solution with that many kilograms of water.
So, for brines mol/kgs, mol/L, and mol/kgw will be distinctly different. Further, the number of moles of a solute in solution will differ depending if you have 1 kg of solution, 1 L of solution, or a solution with 1 kg of water. You seem to want to use mass of solution, but you will need to make conversions to be consistent with PHREEQC which is based on the mass of water in a solution. Either convert mol/kgs to mol/kgw, convert mol/kgw to mol/kgs, or just use PHREEQC units, which will be moles, moles/kgw, and kgw.
(b) You are modeling advection and dispersion when you use TRANSPORT. Water is flowing out of the column, and there is dispersion within and at the ends of the column. Constant and constant would mean that you have an infinite reservoir at the inlet and an infinite reservoir at the outlet, so that any advection and dispersion at the ends of the column makes no difference in the reservoir concentrations. Flux flux would indicate water flowing into the column at one concentration and out at the concentration determined by the reactions. Figures 2 and 3 show of the 1999 manual show the difference between flux and constant at the inlet. In an advection dominated system, there probably is not much difference between constant or flux at the outlet, but conceptually, flux makes more sense to me for a flow-through reverse-osmosis column.
dlparkhurst:
(3) The selected output gives the total number of moles in each cell at each time interval that is printed. The moles are not summed from different cells.
You can accumulate the moles of gypsum in the column with USER_PUNCH or USER_GRAPH, although you may to post-process the selected output file to get exactly what you want.
Here is an example with USER_GRAPH.
--- Code: ---SOLUTION 0 red_sea
temp 24.5 #average of Al-Taani et al., 2014 and Longinelli and Craig, 1967..
pH 8.22 charge #None
pe 0.2679 #Al-Taani et al., 2014 // 4.00 is the default (?) // 4.00 is the default (?)
units ppm
Mn 0.000306 #Al-Taani et al., 2014 for the Northern Gulf of Aqaba
Fe 0.006281 #Al-Taani et al., 2014 for the Northern Gulf of Aqaba
B 1.344 #Al-Taani et al., 2014
Cl 24756 #https://www.lenntech.com/composition-seawater.htm in the Red Sea, and Longinelli and Craig, 1967
Na 16417.2 #https://www.lenntech.com/composition-seawater.htm in the Red Sea, and Longinelli and Craig, 1967 describes [Na]=15834
S(6) 9500 #Longinelli and Craig, 1967 and Llyod, 1967
Ca 774 #Abdel-Aal et al., 2015
K 301 #Abdel-Aal et al., 2015
Mg 1646 #Abdel-Aal et al., 2015
Sr 8.3 #Bernat, Church, and Allegre, 1972 from the Mediterranean
Ba 0.011 #Bernat, Church, and Allegre, 1972 from the Mediterranean
Li 0.228 #Stoffyn-Egli and Mackenzie, 1984 for the Mediterranean Sea
-water 17.378153556381264
SOLUTION 1-12 Initial solution in the RO module
temp 25
pH 7 charge
-water 17.378153556381264
END
EQUILIBRIUM_PHASES 1-12
Gypsum 0 0
END
REACTION 1
H2O -1; 9.057149147747937
REACTION 2
H2O -1; 8.952016761697115
REACTION 3
H2O -1; 8.846884375646292
REACTION 4
H2O -1; 8.74175198959547
REACTION 5
H2O -1; 8.636619603544647
REACTION 6
H2O -1; 8.531487217493824
REACTION 7
H2O -1; 8.426354831443
REACTION 8
H2O -1; 8.321222445392177
REACTION 9
H2O -1; 8.216090059341354
REACTION 10
H2O -1; 8.110957673290532
REACTION 11
H2O -1; 8.005825287239709
REACTION 12
H2O -1; 7.9006929011888865
#linear_permeate
#Effluent module 1:
#Estimated CF: 1.118E0
#Estimated solution mass: 15.545180409311685
END
USER_GRAPH 1
-headings time Total_gyp
-axis_titles "Time, seconds" "Gypsum in column, moles" ""
-initial_solutions false
-connect_simulations true
-plot_concentration_vs x
-start
10 IF CELL_NO = 1 THEN PUT(0, 1)
20 PUT(GET(1) + EQUI("Gypsum"), 1)
30 IF CELL_NO < 12 THEN GOTO 100
40 GRAPH_X TOTAL_TIME
50 GRAPH_Y GET(1)
100 END
-end
-active true
TRANSPORT
-cells 12
-shifts 24
-lengths 0.08466666666666667
-time_step 3.946329703005324 # this satisfies the Courant condition with a feed velocity of 2.575E-1 m/s
-initial_time 0
-boundary_conditions flux flux
-punch_cells 1-12
-punch_frequency 1
-print_frequency 24
END
--- End code ---
(4) The exchange factor applies to a single stagnant cell for each mobile cell. You will get more numerical accuracy if you use multiple stagnant cells for each mobile cell, but at the cost of considerably more complexity in setting MIX definitions and data handling. I would use the simplified version until you can demonstrate the need for more complexity.
freiburgermsu:
Dear David,
1)
a) I reproduced the proper moles after converting (L of solution) -> (kg of solution) with the solution density from the output of your PQI. I also updated my ICE Table, which revealed a 1:1 ratio of concentration changes. Thank you for your detailed explanation!
b) The comparison of Figures 2 & 3 in the 1999 manual suggests that the inlet boundary condition has a minor influence upon the elemental concentrations. Could a steady stream of feed water through the RO module be conceptually equivalent to an infinite reservoir, since the feed supply is inexhaustible and is assumed to have a constant concentration? I concur with your assessment of flux at the outlet of an RO module.
3) The SELECTED_OUTPUT can then, essentially, print the accumulation of precipitate within a single cell over all time, however, post-processing is required to calculate the accumulation of precipitate over all cells at a single time?
Would the precipitation decrease in the final cells of this example figure(https://github.com/freiburgermsu/ROSSpy/blob/main/examples/scaling/2021-10-27-ROSSpy-red_sea-transport-pitzer-scaling-all_distance-LinPerm/all_minerals.svg) be explained by the rate of precipitation exceeding the concentration rate, thus, the precipitate per cell begins to decrease as the [Ca] and [SO4] concentrations decrease? This interpretation, however, is unsupported by the SELECTED_OUTPUT for this simulation (https://github.com/freiburgermsu/ROSSpy/blob/main/examples/scaling/2021-10-27-ROSSpy-red_sea-transport-pitzer-scaling-all_distance-LinPerm/selected_output.pqo), where only the [Ca] decreases, while the [SO4] increases over these final cells of the transport column. What explains this diverging of the ionic concentrations?
4) We -- and likely our reviewers -- certainly prefer simplicity. We will continue to troubleshoot the dual porosity calculations.
My mentors and I are primarily Civil Engineers, thus geochemistry is slightly beyond our knowledge domain. Would you like to be a co-author in the publication of this software in 1-2 months? We would benefit from your geochemical expertise and perspective, particularly through understanding the fundamentals of PHREEQC and the geochemical reactive transport of RO desalination that may not be completely captured by my 4 inquiries. I can share the manuscript package with you in a few weeks, at your discretion.
Thank you for your assistance :)
Andrew
dlparkhurst:
(3) Yes, you have to either write a USER_PUNCH script to accumulate among cells or post-process cell-by-cell selected output results.
As for the diverging concentrations, maybe this is a better explanation (or not). Equilibrium with gypsum requires the ion activity product to be constant [IAP = a(Ca+2)a(SO4-2)a(H2O)^2]. Not correct in detail, but if you assume activity of water of 1, and activity equals concentration, then Ca*SO4 = K.
The concentration of SO4 is larger than Ca, so assume that precipitation of gypsum has little effect on the SO4 concentration. Then if the solution is concentrated by 1 percent, about 2 percent of the resulting Ca concentration must precipitate IAP ~ (1.01SO4)*[0.98*1.01Ca] ~ K, where 0.98 (1/1.01^2) is the fraction of Ca remaining in solution after precipitation. Regardless of the details, the idea is that the precipitation of gypsum is approximately proportional to the Ca concentration. As the concentration of Ca decreases through the cells, the amount of gypsum precipitation also decreases.
Concerning authorship, I have responded by message.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version