Karen Johannesson Posted October 25, 2023 Posted October 25, 2023 Dear Jia and/or Brian, I am looking for some hints about how to make a simple BASIC script for React that can account for different rate constants as a function of pH following the pH ranges described in Palandri and Kharaka (2004). I have simple BASIC scripts for forsterite and anorthite dissolution kinetics that assume constant pH and 25 degrees C. However, the script I have for K-feldspar attempts to use the Arrhenius equation to compute rate constants for different pH ranges and also temperature. I realize the K-feldspar script I am including is wrong, because the terms r1, r2, and r3 are not the rate constant at different pH, but actually the rate expression for acidic, neutral, and basic pH. I am wondering if you have any hints for me to make such a script that will work. I am including my simple React script too. Best wishes, Karen Basalt Dissolution3.rea K-feldspar_Rate2.bas Anorthite_Rate.bas Forsterite_Rate.bas
Karen Johannesson Posted October 25, 2023 Author Posted October 25, 2023 Just a quick example of a re-configured version of the K-feldspar rate script and a plot showing that the script returns a rate of 0. This script does work better, maybe, than the previous one as some of the K-spar reacts in this slightly modified version. K-feldspar_Rate2.bas
Jia Wang Posted October 26, 2023 Posted October 26, 2023 Hello Karen, Thank you for your explanation and the relevant files. To start, I looked at your latest rate law script for K-feldspar and noticed that the variable for pre-exponential factor 1 was initially named "pre-exp1", but later in the script "pre_exp1" was called. You may want to double check variable names and values in your script to make sure that they are correct. If I run your script, I can see that the dissolution rate for the K-feldspar changes with time. If I plot rate constant, the value remains zero throughout the simulation. The reason for this is because no value or script was entered to calculate the rate constant explicitly. Your rate law script includes the rate constant calculation within and React can't extract that value out from the rate law script. By default, the rate constant is reported as zero. This method is completely valid for a custom rate law but if you would like for the program to calculate explicitly rate constant change over time to plot, I think a simple solution is to provide a basic script for the program to calculate the rate constant (instead of the rate law) and use either the built-in rate law or a custom equation for the rate law. This should be an easy modification with your current script. Instead of returning "rate", alter the return statement to return "R" after the line "R = r1+r2+r3" and then remove everything after that statement. After you attach the script for the rate constant calculation, you should also check the transient box so that the rate constant is evaluated at every time step. For the rate law, you can enter a custom equation "rate_con * surface *(1-Q/K)" or use the built-in option, as they are the same. For more information on field variables, please see the Heterogeneity appendix to the GWB Reactive Transport Modeling Guide. Hope this helps, Jia Wang Aqueous Solutions LLC
Karen Johannesson Posted October 26, 2023 Author Posted October 26, 2023 Hi Jai, Thanks again! Typos are so easy to make and also so easy to miss. I was thinking about this last night and on my drive this morning into campus. All of the rate scripts seem to specifically identify the rate constant and as you say above, React cannot extract the extract the value from a rate law script. I was thinking that having the Arrhenius equation version of the rate constant would make my scripts more robust. However, as I am chiefly working in groundwaters systems with temperature variations from are between 25 and 50 C (mean +/- 1sigma = 30.4 =+/- 7.5 Celsius), and perhaps even more importantly, when I eventually try to link these scripts to lanthanide cycling for which I have no enthalpy data, it probably makes sense to just assume a temperature of 25 Celsius. That allows me to compute a rate constant for each of the three pH ranges, and scale the rate constants as acid and basic pH by a correction factor multiplied by the slowest rate, which occurs in the circumneutral range. This approach returns a rate that is not zero and that varies with pH and time. The React script that I attached has the rate constant computed for the circumneutral pH range. I will also read your suggestion very carefully and think about it some more. My next question will be in regards to precipitating minerals. I have come across the "nucleus" command in my reading and re-reading... Best wishes, Karen Basalt Dissolution3.rea K-feldspar_Rate.bas
Jia Wang Posted October 27, 2023 Posted October 27, 2023 Hi Karen, I am not exactly sure what you are asking. With a custom rate law, you can additionally account for temperature dependence in your reactions if you desire. You can always repeat the simulation with different rate laws to see which one best describes your observation? I am not sure what would be the best fit for your work. Best regards, Jia
dirk Posted January 18 Posted January 18 Hi Karen, I have put together scripts for a wide range of minerals mostly based on the Palandri and Kharaka paper. Dissolution is TST and precipitation is nucleation and crystal growth based on Helge Hellevang's work. Let me know if you want to try them out. Cheers Dirk
Karen Johannesson Posted September 10 Author Posted September 10 Hi Dirk, I was great to see you at Goldschmidt. I am definitely interested in these scripts. Do you know my email here at UMass? Karen
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now