Jump to content
Geochemist's Workbench Support Forum

Jia Wang

Admin
  • Posts

    724
  • Joined

  • Last visited

  • Days Won

    29

Everything posted by Jia Wang

  1. Hello, Thank you for providing the input file and your dataset. I noticed that the issues seem to arise with your lower concentration anion components. I think the issue here is that the free concentration of the aqueous species for AsO4-- and SeO4-- is in a very small concentration given the condition of your fluid. When this is the case, the program may have difficulty converging in its Newton-Raphson iterations. For more information on this, please see section 4.3.7 Optimizing the Starting Guess in the Geochemical and Biogeochemical Reaction Modeling textbook. When I removed both components from your basis pane, SpecE8 had no issue converging. I returned to your input file and added both components back into the Basis at very small amounts (1e-5 mg/l) and then ran the calculation to find the most abundant arsenic and selenium species, which is calculated to be NiHAsO4 and FeSeO3+ respectively. Then I returned to the Basis and swapped them in for AsO4-- and SeO4-- with the same concentration you had in your original file. When I ran the calculation this time, SpecE8 was able to converge successfully. By the way, your input script was using the default thermo_nea.tdat dataset and not the customized version you attached. I also noticed that you had decoupled the UO2+/U+++ redox couple. This allows you to set the component concentration for U+++ independently from UO2+, but looking at thermo_nea.tdat, there are no species or minerals that are in the redox form of U+++. If uranium speciation is your interest here, I am not sure how useful this would be. If you expect uranium to speciate across different redox state, then you would need to allow UO2+/U+++ remain in equilibrium. For more information on redox disequilibrium and examples, please see section 7.3 in the GWB Essentials User Guide. Hope this helps, Jia
  2. Hello, From your description, it doesn't sound like your fluid is really out of the ionic strength range. I am not sure what might be the exact issue without seeing the input file though. Was there any additional information provided regarding the error in SpecE8? In some cases, other users have run into this error when they choose an aqueous species in the basis species that's very small in concentration. In that case, it would help the program to converge on a solution if a more abundant species is chosen to represent the component concentration in the basis. Hope this helps, Jia Wang Aqueous Solutions
  3. Hello Helge, This is a strange issue. I ran your python input file and didn't have problems with the run ending automatically when the calculation was completed. My output file agrees with the output file you provided (0081_GWB.log) and the results from 0081.rea, so I do think your script is running to completion. Perhaps the issue is related to how your python scripts are run? Are you encountering any of these issues with your other GWB plugin scripts as well? Do you use the windows command prompt to run the script? With some GWB programs, you can limit the maximum computing time by setting the variable "cpu_max". You can find more information about this in the GWB Command Reference guide. Could you try setting this in your script to see if python will terminate at the allotted time? You shouldn't need to set this to end a regular run, but it can be a good temporary solution for the issue at hand. With regards to epsilon, I tested by resetting the python and react script to the default values and the run would not run to completion. I do believe the change in epsilon input is being accounted for. Hope this helps, Jia Wang Aqueous Solutions LLC
  4. Hello, Thanks for the additional information. I apologize for the sentence getting cutoff. I was going to refer you to section 2.3 for React examples in the GWB Reaction Modeling user guide. You can plot various results in Gtplot on one axis vs. the mixing fraction between two fluids on the other. The mixing fraction is only available when you use the flash configuration. You can find "Mixing Fraction" in Gtplot under the Variable type. To find dissolved species concentration, you can select the "Species concentration" variable type for one of the axes. FYI, you can export all numerical data from your Gtplot. To do so, go to the "Edit" tab -> "Copy as" -> "Spreadsheet" or "Tab" depending on where you are pasting your information. See more information on Gtplot in the GWB Essentials user guide. I am not sure that you need to set reactant times here. Enabling the flash configuration will have React gradually remove the original fluid from the equilibrium system as it titrates in the reactant fluid. If you plot a flash diagram (i.e. with mixing fraction as one of the axis), then you can see the corresponding variable type (e.g. Minerals, Species concentration, etc) at each mixing proportion. For more information on the flash setting, please see section 3.8 "Flash Diagrams" in the GWB Reaction Modeling user guide. You may also find the "Fluid scaling and mixing" on the GWB Academy (https://academy.gwb.com/mixing_and_scaling.php) useful. If you do not enable the flash setting then you would be just titrating in amount of reactant specified into your system incrementally. In that case, you would want to make sure that the total amount of reactant to your basis is in the correct proportion. If any mineral precipitates in your system, you can plot it under the variable type "Minerals". If no minerals are present, then this option would not appear in Gtplot. Swapping is used to set your fluid in equilibrium to a mineral or gas in your basis constraint for that component. Typically this is done when you have information that allows you to make those assumptions. An example would be swapping CO2(g) fugacity for H+ to constraint the pH. You can certainly swap HCO3- for dolomite but is it in equilibrium with the fluid along with calcite for Ca++? Please see section 2 Configuring programs in the GWB Essentials user guide for more information about how the basis in GWB programs are configured. Hope this helps, Jia
  5. Hello Andrew, React solves a multicomponent system to determine the system's equilibrium state. In your example, it looks like you swapped in Calcite to set it in equilibrium with the fluid and then looked at the dissolved constituent concentrations as CO2(g) varied. The sliding reaction path feature makes it a very convenient to view the solubility of your reaction of interest against one changing variable. In Act2, the set up is much more simple compared to React. Unlike React, Act2 calculates equilibrium equations based on the reactions provided in the thermo database and then assembles them into a diagram. It does not calculate speciation and solve a multicomponent system at each node to account for pH in the same way that a reaction path in React does. Act2 would need a constraint on H+ separately in order to include Calcite in your diagram calculation. If you would like a more complex solubility diagram and supply constraints like you would in React, you may be interested in Phase2. Phase2 works by solving the multicomponent system for each node in a 2D grid according to the reaction paths set in the x and y axis, and determine the dominant phase present based on the amount calculated to be present. You can think of each node in a Phase2 diagram as its own React simulation. Another advantage of Phase2 is that you can constrain variables in concentrations like molal and mg/l instead of activities. An example that may be similar to what you may be looking for is the AlSolubility.ph2 example that comes installed with your GWB files. For more examples and information on Phase2, please refer to section 7 in the GWB Reaction Modeling user guide. Hope this helps, Jia Wang Aqueous Solutions LLC
  6. Hello, Thank you for providing more details. I am guessing from your post above that you are creating a flash diagram, where the basis pane is the chemical constraint for native groundwater and the reactant is the fresh surface water. Based on plots of mineral saturation indices (from two simulations with different native groundwater fluid), From your plots, I am also assuming that you have turned off precipitation to not allow any minerals from forming. Based on your plots alone, the more H2O is reacted, the saturation indices for each mineral falls. Please note that, this information alone is not sufficient to determine which mineral will precipitate or dissolve and if so, the quantity. The mineral SI only informs the thermodynamic tendency for a mineral to precipitate or dissolve given the current solution composition. If you are mixing a dilute fluid with your brackish groundwater, then the mineral saturations will drop as your overall fluid contains higher portion of the dilute fluid. I am not sure what you mean by " My question is why it takes much water injected to the lower aquifer than the upper aquifer?" If the composition of your starting fluids are different, then they should show different results as your mix in fluid. The extent of their difference would depend on their composition. Could you clarify what you mean with your question? Or provide more context on what you mean? Here are some suggestions that might help: The flash configuration in React is used for mixing all proportion combinations of the fluid specified in the Basis pane and the fluid specified in the Reactants pane. You can plot x-axis (or y-axis if you like) as the mixing fraction between the two fluids. This case, you can see the various results (species concentration, mineral saturation, etc) as a function of mixing fraction and compare it to your existing dataset. This would help you get a general sense of the properties of the mixed fluid. If you wish to investigate mineral precipitation and dissolution with React, you would need to check the precipitation box in the Options dialog in React. Any minerals present in the system would be reported and can be plotted in your results. For more information on this, please refer to If you are interested in dissolution of minerals in the aquifer, you would need to include them in your simulation. Can any mineral be assumed to be in equilibrium? Are there any reactions that need to be kinetically constrained? Hope this helps, Jia Wang Aqueous Solutions LLC
  7. Hello Christophe, Thank you for posting your issue. We have someone looking into the error and will get back to you via email shortly. In the future, please remove your activation code before posting to the forum. Best regards, Jia Wang Aqueous Solutions LLC
  8. Hello Mojtaba, The dataset, thermo.tdat, used in your attached script is a dataset published by Lawrence Livermore National Laboratory. This dataset uses an extension of the Debye-Huckel equation, the Bdot Model, to calculate the activity coefficients for aqueous species. The Bdot equation is widely applied in geochemical models designed to operate over a range of temperatures. This model is reasonably accurate for Na+ and Cl- ions up to about an ionic strength of 3 molal and other species to an ionic strength of ~ 0.3 molal. For modeling high ionic strength solutions, the virial models are almost always more accurate. The thermo_hmw dataset uses the Harvie-Moller-Weare formalism of the Pitzer equations. This method however is not easily extensible and data is often limited at 25C. You can read more about activity coefficients in section 7.4 in the GWB Essentials User Guide. For a deeper dive into the topic, you can refer to chapter 8 Activity Coefficients in the Geochemical and Biogeochemical Reaction Modeling textbook. A good starting point for you may be using the Yucca Mountain Project dataset (thermo_ymp.R2.tdat). This dataset follows the HMW formalism of the Pitzer equation and contains more components than thermo_hmw.tdat. This dataset also includes some provision for extrapolating to higher temperatures. You can find the dataset installed with your GWB software or you can find it on the GWB thermo dataset webpage. Reference for the dataset: Jove-Colon, C., Wolery T, Rard, J, Wijesinghe, A, Jareck, and R, Helean K: 2007. Pitzer database development: Description of the Pitzer geochemical thermodynamic database data0.ypf.R2. Appendix I. In In-Drift Precipitates/Salts Model, Report ANL-EBS-MD-000045 REV 03, DOC.20070306.0037 Las Vegas, Nevada: Sandia National Laboratories. "Components in fluid" and "Species concentration" are not the same thing. This is because in geochemical modeling we separate free species concentration from bulk component concentration. For example, the bulk sodium component concentration is going to be distributed amongst various species containing sodium (e.g. NaCl, Na+, NaCO3-, etc). If you want to find the concentration of the free ion Na+, then you would look under "Species concentration". If you want the total concentration of sodium in fluid, then you would look under "Components in fluid" for sodium. If you would like an example and further explanation, see section 7.2 Equilibrium models in the GWB Essentials User Guide. The ionic strength reported by the GWB program is the true ionic strength, which accounts for the role of complexing in reducing the number of free ions in solution. If you want to check the ionic strength by hand, you would want to use the concentration given under "Species concentration" and not the components. Hope this helps, Jia Wang Aqueous Solutions
  9. Hello, The GWB software distribution includes many thermo datasets, one of which is thermo_minteq.tdat, converted from the standard database distributed with Visual Minteq. However, the dataset distributed with MINTEQA2.v4 is not amongst them. I do believe PHREEQC distributes a dataset derived from MINTEQA2.v4 with its installation. You can convert this dataset from PHREEQC format to use with GWB using the TEdit application in GWB 2021. For more information and examples on the conversion, please see section 9.3 in the GWB Essentials User Guide and the TEdit webpage. Hope this helps, Jia Wang Aqueous Solutions LLC
  10. Hello, You do not have to include Cl- in your basis input if it is not in your system. X1t (also React, Phase2, and X2t) by default looks for Cl- as the balancing component unless otherwise specified. This is typical as chloride is an abundant species where most commercial labs would report its concentration based on a charge balance calculation. You can change to another abundant species for charge balancing in your run. To do so, click on the unit of the component that you want to balance species on and select "Balance species". I am not quite sure what you mean by using the equivalent Cl- to control pH. It sounds like you are adjusting your fluid's pH by adding an initial dose of lime and then progressively more with to meet the target pH. You can add lime as a Reactant to see how the pH changes as it is titrated in your system. Another method to control pH with lime is to swap it in for lime in the Basis. This would tell the program to calculate the pH of the system in equilibrium with the lime. From your brief description, this doesn't sound like it describes the scenario. For more information on swapping in the basis, please see section 2.2 Setting and constraining the basis in the GWB Essentials User Guide. It might be helpful if you set up a React simulation to make sure that pH is behaving as intended before adding transport in X1t. Hope this helps, Jia Wang Aqueous Solutions LLC
  11. Hello Jo, We do not have a specific GWB Plugin example with X1t but here are a few suggestions to help you get started. You can view examples of how to use the GWB Plugin with Python in the GWB Reference Manual. Section 7.5 is specific for setting up scripts in Python. While the example file installed with the software is a good place to start, this section will provide more details on how to configure commands and what they do. All documentations come installed with your software and you can open them by going to the "Doc" pane on the GWB dashboard or going to the "Help" menu on any of the applications. If they are deleted from your machine, you can always download them from our documentation page. You can find a comprehensive list of commands accepted by each GWB application in the GWB Reference Manual. This will be very helpful for you if you're just getting started in scripting with GWB commands. In the same manual, you will find the Report Command section, which list all the available commands for returning results from your run. A trick that is useful for building your first script is to actually build the input script in python and as a regular GWB input file. If I run the regular input file and the python script, I can check if they produce the same results. Another useful tip is that every GWB input file (e.g. freshwater.spec8, pb_contamin.x1t) can by opened up in a text editor. You can then view the commands in the input file, which can be helpful to check if your configuration makes sense in your python script. Hope this helps, Jia Wang Aqueous Solutions LLC
  12. Hello Frank, I am glad to hear that this worked for you. React allows users to set up an initial geochemical system and then alter it by setting up various types of reaction paths. Most of these reaction paths are specified in the Reactants pane, such as titrating in solutes, kinetic reactions, sliding activity/pH paths, and etc. The strategy with adding minerals as kinetic reactants and setting a zero reaction rate effectively sets them as inert minerals to provide a surface for complexation reactions. SpecE8 on the other hand calculates the distribution of mass in solution and on mineral surfaces given component concentrations statically. It does not carry the concept of reaction paths as React does. Therefore, the same strategy with using kinetic minerals wouldn't work in SpecE8. The options to provide mineral surfaces for complexation reactions or sorption would be to either swap the mineral into the basis or designate an inert mineral volume. The latter case would not be useful if you're looking at triple or double layer complexation models since they require a specific sorbing mineral. I have a couple of suggestions that may help speeding up and automating your calculations. If nothing is set to alter your system in React, you may be able to speed up your calculation by running "go initial" instead of "go". This way, React will calculate the initial equilibrium state of your system without running the reaction steps with all the kinetic minerals being essentially inert. If you're performing this type of calculation on a large number of samples, you might consider automating the process with the GWB Plugin feature or a Remote Control control script for Multiple Analyses. These features will also allow you to have more control over the data output from React runs. For more information and example on these features, please see the GWB Reference manual. Another option that may work well, depending on the complexity of your calculations, is to use GSS. You can add your sample analyses into a GSS spreadsheet and launch/run each sample in React. Before doing so, you can also add surface datasets in the Header command box and set the kinetic minerals for SCM in the Trailer command box. For more information on this, please see section 3.5 in the GWB Essentials User Guide. Hope this helps, Jia
  13. Hello Frank, You're welcome. Hope the rest of your project goes well. Best regards, Jia
  14. Hello Helge, You're welcome. I am glad this resolved the issue. Best, Jia
  15. Hello Helge, Thank you for providing the files for your run. I believe the path to the GWB folder is added correctly from your screenshot. A possible issue comes to mind. If you are using python 3.8+, the dll search behavior was changed from previous versions such that python no longer looks in PATH for dlls that modules might need. Please try adding the bolded part below to your python script and try rerunning. # To find the plugin sys.path.append('c:/program files/gwb/src') import os os.add_dll_directory('c:\program files\gwb') from GWBplugin import * It seems to solve the issue when I tried it on my machine (currently running python 3.10). If that didn't help to resolve the issue, could you please double check that you are using the same version of python as the GWB installed (64-bit vs 32-bit)? Are you using any Windows emulator software to run GWB? Is the GWB installed on your work machine that you're remotely connecting or on your home office machine? Hope this helps, Jia Wang Aqueous Solutions LLC
  16. Hello Frank, If you would like to set these minerals for just surface complexation reactions, you can add each as a kinetic reactant and set the kinetic rate constant (and effectively the reaction rate) to 0 so that the mineral will not precipitate or dissolve but the mineral surfaces will be able to form complexes. You might find it helpful to create a surface dataset to describe the complexation reactions for each sorbing mineral. That way you can load each dataset into your simulation as needed. The GWB apps allow multiple surface datasets to be loaded in the same simulation. Best regards, Jia Wang Aqueous Solutions LLC
  17. Hello Wen Qiu, I would like add to the response to my previous post. The best description of thermo datasets is in the Thermo Datasets chapter of the GWB Reference Manual. If you do not find what you need in the GWB Essentials User Guide, please see the Reference Manual. Best regards, Jia
  18. Hello Zixuan, You're welcome. I am glad the suggestions are helpful to you. Best regards, Jia
  19. Hello Ana, With regards to Act2 and Tact, these are diagram generators that calculate simple equilibrium reactions and then assemble them into an activity diagram. The fields displayed show the predominant species at specified range of activities (or temperature in the case of Tact) on the X and Y axes. It sounds like the sliding reaction paths might be what you're looking for. In the React application, users can set the initial composition and temperature of the system and then vary the temperature linearly from an initial to a final value over a reaction path to see how the system changes. The same type of reaction path can be set for varying pH as well.To see specific examples on how to configure a React instance, please section 3.4 Polythermal reaction paths and 3.6 Sliding activity and fugacity of the GWB Reaction Modeling User Guide. The GWB Academy online also offers a variety of self guided courses and examples for beginner and advanced users. In particular, you may be interested in the Geothermometry lesson, an example using the sliding temperature path. Another great resource for leaning the software is the Biogeochemical and Geochemical Reaction Modeling textbook, written by the primary developer of the software. You can find the theory behind reaction modeling and examples tailored for the GWB in this work. We might be able to answer more specific questions about functionality if we know what you're trying to model. If you are troubleshooting a specific issue, please post a description of the problem and the input file along with the thermo dataset so we can take a closer look. Best regards, Jia Wang Aqueous Solutions LLC
  20. Hello Wen Qiu, I don't believe this is an issue with the different software editions. The React input file provided is just a starting point for the user. If you follow the lesson on the GWB Academy further, you can see that running the file as provided is predicting results far from the experimental data. You would need to adjust the rate constant, KD, KA values to get a better fit. Please also note that the simulation in the exercise is set to 60 hours and not days. Also note that the last image posted in your last post is just plotting the experimental data from GSS and not the simulation result. You can superimpose the experimental data from GSS onto the simulation in Gtplot by dragging “As_reduction_scatter.gss” from your desktop folder into your Gtplot window. This way, you can visually assess the fit of the simulation result as you change the parameters and rerun. Hope this helps, Jia
  21. Hello Wen Qiu, In your example, species As(OH)4- and AsO4--- are both arsenic species with different valences. Typically in geochemical databases, one species is chosen as a basis species and the other species of the same element is formed by balancing a redox reaction. In this case, the species As(OH)4- is chosen as the basis species and AsO4--- is written as a redox reaction of the basis. The GWB by default only allows users to add basis species in the Basis pane as the constraints for each component. Please see more details regarding thermo datasets in section 9. TEdit of the GWB Essentials User Guide. You can decouple the redox couple (e.g. As(OH)4- and AsO4---) for a specific simulation such that you can constrain the concentration of each oxidation state separately. Unless you decouple the reaction before the simulation, React will assume redox equilibrium when calculating the distribution of mass to each redox state. For more information on redox disequilibrium, please see section 7.3 in the GWB Essentials User Guide. You can also permanently decouple reactions in your thermo dataset and save it as a custom dataset if you find yourself needing to decouple the same redox reactions all the time. For more information on working with datasets, please refer to section 9.2 in the GWB Essentials User Guide. Basis swapping allows the user flexibility to use other reactions in the datasets to set your chemical constraints. For example, if you can safely assume a mineral or a gas is in equilibrium with your system, you can swap it in for a corresponding basis species. A specific example of this may be swapping in the Quartz for SiO2(aq). For aqueous or redox species, occasionally, you may need to swap in more dominant form of the component to help the program to converge. For example, if you have a really reduced system where you have a large quantity of sulfide but no sulfate, you may want to swap in H2S(aq) for SO4--. You can find more information on how to configure the initial system in the GWB in section 2 of the GWB Essentials User Guide. For more examples on swapping, please see section 7.2 Equilibrium Models in the GWB Essentials User Guide. Hope this helps, Jia Wang
  22. You're welcome. I am glad this helped. Best, Jia
  23. Hello Emma, You're welcome. I am glad you find the comments helpful. Here are a few suggestions to get you started. In your Basis pane, you would want to set a small, insignificant concentration of sulfate in your initial system. The program solves a set of equations by numerical iteration and cannot start with a zero value for component concentration mass. If you're titrating Na2SO4 into the solution, you should check to make sure that it is added correctly with the right unit in the Reactants pane to ensure that your reactants are properly charge balanced. If the titrant is Na2SO4, then for every mole of of SO4-- added, you should also include 2 times the amount for Na+. Is 0.18 molar the concentration of your titrant or is that the endpoint concentration of sulfate you want to titrate to for your simulation? The plot in your original post stops at 10 mM of sulfate, which seems to me you want to only titrate a total of 10 millimoles sulfate per liter. Typically, the "balance on" species chosen has high abundance and low uncertainty. For example, React is set up to use Cl- as the default charge balancing ion since most Cl- is usually abundant and can be calculated from charge balance based on other species concentrations measured in chemical analyses. In your case, I think your system is in excess of cation and choosing NO3- rather than Na+ as your balancing ion seems to help. You can also turn off charge balancing as well. You might consider whether or not the complexation reaction occurring is a kinetic reaction. If it is, you may want to consider implementing a kinetic approach with your reactions. You can refer to section 4 Kinetic Reaction Paths in the GWB Reaction modeling User Guide for more information. You may also want to check the dataset you're using to see if the equilibrium constants are appropriate for your experiment. The default dataset (thermo.tdat) used by the GWB is published by Lawrence Livermore National Laboratory. In particular, you might check if the equilibrium constant for the reaction of CuSO4 is what you expect. There are other datasets installed with the dataset from published from other sources that may vary from the dataset you are using. You can find all the default thermo datasets installed with the GWB in the Gtdata folder. To view the datasets, you can use the GWB thermo dataset editor TEdit. For more information on this, please see section 9 in the GWB Essentials User Guide. Hope this helps, Jia
  24. Hi Zixuan, I am not sure of the type of experiment you have in mind but here are a couple of suggestions that may be helpful. In React, you can chain simulations using the pick up command by setting the ending point of a simulation and an initial state of another. You may be able to set up an initial simulation for the adsorption of B and then pick up the result as a starting point for the adsorption of A. For more information on chaining simulations, please see section 3.1 Picking up the results of a run and 4.8 Changing together kinetic reaction paths in the GWB Reaction Modeling User Guide. If you are simulating a kinetic surface reaction, you can also set a customized rate law script that allows you to specify certain conditions (e.g. time, activity of certain species, etc) are met before adsorption of A begins. For more information on custom rate law scripts, please see section 5.2 in the GWB Reaction Modeling User Guide. Best regards, Jia
  25. Hello, I believe the issue here is that the dissolved solid concentration (mg/kg) used to convert units for each component in GSS is not copied over. The pickup command does not include the dissolved solids concentration from the simulation results. You can add it manually in the basis pane before dragging and dropping the Basis pane into GSS. Alternatively, you can also drop and drag the Results pane before the pick up command, that would automatically include TDS as an analyte to the spreadsheet. Hope this helps, Jia
×
×
  • Create New...