Jump to content
Geochemist's Workbench Support Forum

Jia Wang

Admin
  • Posts

    729
  • Joined

  • Last visited

  • Days Won

    29

Everything posted by Jia Wang

  1. Hello Arata, Thank you for posting the paper and the files to troubleshoot with. Here are some suggestions for you. Since the amount of metals added to various experiments, in this case cadmium, is the total present, you should enable the "sorbate include" option in your input file (Config -> Options... check "sorbate"). This will distribute the total mass of cadmium between your mineral surface and solution. If not, the software will calculate an additional amount of cadmium sorbed to the mineral surface separate from the fluid. For more information, please see the “sorbate” command in the GWB Command Reference. The React file you have attached didn't include any kaolinite. Perhaps you had previously set 7.8 g/l in the Reactants pane? A minor consideration is that FITEQL uses the Davies activity model to calculate species activity, while the thermo dataset you have attached uses the B-dot method. This may cause some minor differences in your case. The biggest issue here is the ion-exchange convention used in the paper does not match the standard method used in most geochemical modeling software, including the GWB. The exchange species in the mass action expressions for equations 1 and 2 use concentration units, just like aqueous species (as denoted by the brackets). In a typical ion-exchange model, such as Gaines-Thomas, however, the site activities are given in terms of the fraction of the total electrical equivalents of exchange capacity occupied by the ion. Unless you can convert the constants to one of the conventions used in the GWB, you won't be able to replicate those reactions in the GWB (or other conventional modeling programs) using the ion-exchange model. However, the equations shown in the paper for ion-exchange are similar to one of the conventions for a non-electrostatic surface complexation model. Your combined dataset Gu_inout.sdat should work for these purposes, as long as you change the convention for polydentate reactions to “stoichiometric”, to match the method in the paper. For more information, please see section 2.6.8 Polydentate sorption in the GWB Essentials Guide. You should note, however, that the stoichiometric method is considered outdated and is not inaccurate when the amount of sorbing mineral differs from the original experimental conditions. For a more robust surface complexation model, you should convert the equilibrium constants for polydentate reactions (in this case, the ion exchange reaction for Cd) to either the hiemstra-vanriemsdijk or appelo-postma protocol. In the hiemstra-vanriemsdijk model, the mass action equations recast the molal terms in terms of mole fractions of sorbing sites. The appelo-postma model uses site coverage rather than that of mole fractions. For a quick primer on polydentate sorption, please see section 10.2.5 Multidentate Complexes in the Geochemical and Biogeochemical Reaction Modeling text, third edition. Also, the paper "Mass Action Expressions for Bidentate Adsorption in Surface Complexation Modeling: Theory and Practice" paper published by Wang and Giammar, 2013, which is cited in the text, provides much more information on the subject and describes a method for converting log Ks from the stoichiometric to more useful conventions. Hope this helps, Jia
  2. Hi Jerome, I am not quite following your logic here. If you have the pH, TDS, and the chemical composition of your fluid, the most straightforward approach is to set up the fluid in React (Basis pane) and add a strong acid like HCl (Reactants pane) until you get to the endpoint pH. The equivalents of acid needed to reach that endpoint reflects the alkalinity of your fluid. Are you saying that this approach does not work for you? When you say "using HCO3-" to reach charge balance, do you mean you're adding HCO3- to your system or setting HCO3- as the charge balancing ion? Best regards, Jia Wang
  3. Hello Karen, BASIC scripts are very versatile and can be used to return a rate provided the information are in the script. If you would like have pH and temperature affect the reaction rate of the mineral as shown in Fig 1. of the paper, you can specify the pre-exponential factors and activation energy terms as variables in your Basic script and then use those variables in your rate law expression to calculate the overall rate. You do not need to specify the pre-exponential factors or the activation energy in the React input script itself if you are already doing so in the Basic script. Just note that you will want to call the variables you specified in your script in your rate law instead of the internal parameters (i.e. "pre_exp", "act_en") . Hope this helps, Jia Wang Aqueous Solutions LLC
  4. Hello Arata, Thank you for the additional information and files. We are taking a closer look. Best, Jia
  5. Hello Qingping, Just to follow up with some additional thoughts regarding your question. The pressure command is used for drawing the water stability limits in Act2/Tact, but it does not correct the log Ks defined in the thermo dataset to the pressure of interest. The Log Ks need to be provided specifically at those specific temperature and pressure conditions. In addition to the information in the paper, the GWB thermo webpage also provides a list of some programs that can be used to generate thermo datasets at arbitrary temperature/pressure conditions. Hope this helps, Jia
  6. Hello Qingping, The limitation here is not with the software. To create a diagram like this, or really to make any type of geochemical calculation, the software draws its thermodynamic information from the dataset loaded. The default dataset, thermo.tdat, has a prescribed range of 0-300C. Also, note that not every reaction within the dataset need to have equilibrium constant data across the full range. The software can create diagrams at any temperature range provided that reactions have information at that temperature range. Does the author of the paper provide the thermodynamic dataset they used? That would be a good starting point. You can open and view GWB datasets using the TEdit application. To open the thermodynamic dataset loaded in a current GWB app, go to the File menu -> View -> open the dataset. The GWB apps will also allow you to extrapolate reaction equilibrium constants beyond the prescribed range for the dataset. This option is disabled by default. You can enable it under Config -> Options... In general, I would advise caution when extrapolating log K's for temperature beyond the range of validity prescribed. The further you extrapolate outside the range, the less accurate the values may become. For more information regarding thermodynamic datasets installed with the software, please see section 2.3 of the GWB Essentials Guide. Information regarding dataset structure, see the GWB Reference Manual. Access the guides from the "Help" menu from any GWB app or the Docs pane on the GWB Dashboard. Hope this helps, Jia Wang Aqueous Solutions LLC
  7. Hello Qingping, Thank you for providing the example and input file. A couple of suggestions to help you get started with troubleshooting. You should check if the dataset you are using to generate the diagram is the same as the one used to generate the published figure. For example, I see that the diagram includes the species HAlO2(aq). The default thermodynamic dataset, thermo.tdat, does not include this species. You may want to check in the paper for more information regarding the thermodynamic data used to generate the diagram. You should also check that the equilibrium constants for the reactions in the dataset you are using are also the same as the ones used in Figure 1. The GWB program installs a set of default thermo datasets that you can find in your Gtdata folder or download again from our webpage. Also note that the GWB programs consider all reactions in the dataset. The mineral fields that appear shows the most stable minerals. If minerals that appear are not considered in your system, you set the program to exclude those minerals in the Suppress dialog (Config menu -> Suppress…). Hope this helps, Jia Wang Aqueous Solutions LLC
  8. Hello again, With regards to the thermodynamic dataset, I do not have any additional information regarding the smectite-reykjanes clay but perhaps someone else can help. If you are working with thermo.tdat, you can find the data sources, as cited by LLNL, at the bottom of the file. If you are opening the dataset using TEdit, GWB's thermodynamic dataset editor, you can view the sources listed in the "Header" pane under the Bibliography section. Hope this helps, Jia
  9. Hello Beth, I think there are a couple of factors here that can explain your observation. The first being that the speciation calculation in React (and other GWB apps) accounts for complexes. Assuming that you have a very simple system, containing only water, calcium, and sulfate, the program will calculate the distribution of mass in solution. Complexes that form will reduce the amount of free ions in solution. When I tried with the three component system above and titrated in gypsum, Ca++ and SO4-- complexes strongly and formed a relatively large quantity of CaSO4 in solution. This falls in line with your observation that more gypsum need to be added to the system before it becomes in equilibrium, since there are not as much free ions in solution as you think. If you suppress CaSO4 in the run, you will see that gypsum begins to accumulate in your system earlier, after about 2.25 g have been titrated into 1 liter of solution. You can find the Suppress... dialog under the "Config" menu in React. Perhaps the more important consideration here is that the mass action law accounts for the activity of species, not concentration. Assuming that you are using the default thermo dataset, thermo.tdat, React will use the bdot method, a variation of the Debye-huckel equation, to calculate the activity coefficient of various species. You can plot variable type "Species activity" to see values for Ca++ and SO4--. If you multiple them at the point at which gypsum starts to accumulate (i.e. gypsum becomes in equilibrium with your fluid), you will find that it is equal to the equilibrium constant. If you had assumed that the concentration is equal to activity and the solution deviates away from ideality, you will see very different results than expected. If you would like more details regarding activity models compatible with the GWB, please see section 7.4 in the GWB Essentials Guide. You might also find the Equilibrium models lesson on the GWB Academy helpful. Hope this helps, Jia Wang Aqueous Solutions LLC
  10. Hello Anith, I apologize for the delayed response. I have looked at the file in detail and I believe there are a couple of contributing factors. As you have observed, the program converges with no issue if you turn off charge balance. When you do that and run the calculation, a small but positive charge imbalance was reported. In this case, you would ideally choose an anion component for charge balance. Another complication here is that the carbonate component can dissociate into many things and form complexes with many of the cations in your fluid. This adds further difficulty when chosen as the charge balancing ion. I also noticed that at the given pH, a majority of the carbonate component will exist in fluid as CO2(aq) and a very small amount remains as HCO3-. When you have such a drastic difference in species concentration, it will help the program by swapping the more abundant species, CO2(aq) for HCO3-, into the Basis. However, your fluid contains only one negative component and swapping in CO2(aq) means that I won't be able to charge balance on this species. In general, the charge balancing ion is best to no affect how other species behave. I tried adding F- as charge balancing and SpecE8 was able to converge. Hope this helps, Jia
  11. Hello, I do not have access to the paper linked so I am not able to see more information on selectivity coefficients or equilibrium constants for these exchange reactions. Unlike a reaction in the thermodynamic or a two-layer surface complexation reaction database, the ion-exchange type dataset ask users to provide a selectivity coefficient that is a linear value. The selectivity coefficient should not be a negative value. The selectivity coefficient serves as an equilibrium constant for the mass action equation corresponding to the ion exchange reaction. Perhaps the authors published values for Log K instead of linear values? Perhaps double check the paper for more details. Additionally, I should also note that the GWB carries mass action equations for ion exchange reactions in terms of activities rather than molalities of the aqueous species. When taking coefficients from literature, you should double check units and convert from total molality to free activity as needed. Please see section 2.6.4 in the GWB Essentials User Guide for more information on how The GWB models ion-exchange. If you still are encountering issues with this, please provide more context to the studies and details with regards to what you are trying to model. Hope this helps, Jia Wang Aqueous Solutions LLC
  12. Hello Anith, Thank you for your patience. We are still currently looking into the issue with your example files. Best regards, Jia Wang
  13. Hello Reza, A few suggestions to help you start troubleshooting: Kinetic models are best for modeling reactions that are slow but observable in the time span of your simulation. In X1t, you can perform a "Go initial" run to calculate the initial equilibrium state before any time steps take place. If you do so and plot the Dissolution rates under Reactant Properties for all minerals, you will see that Wollastonite has a very high initial dissolution rate compared to other minerals. Having a much faster rate is going to force the program to take smaller time steps for one but also may make it much more difficult to converge. If you have reactions that are occurring really fast, you might consider just constraining it as an equilibrium reaction instead of using kinetics. Once I removed Wollastonite, X1t failed later in the simulation. I tried decreasing the step size, delxi, in the Stepping dialog to 0.001. Since there are only three nodes in your model, a smaller time step in general seems to have helped. If you want to use the nucleus density for precipitation calculations where there is no mass for kinetic minerals present initially, you would want to include the nucleus density in your rate law scripts. If you don't, the nucleus density won't be considered for calculating a surface area for nucleation. Since you are using a script, you can add a simple IF statement that looks something like: IF surface < nucleus * soln_volume THEN 20 ELSE 40 20: rate = -nucleus * [rest of your equation here] GOTO 60 40: rate = -surface*[rest of your equation here] 60: RETURN rate In general, I would suggest you start by simplifying your simulation. You might want to remove the minerals and start with one reaction interval to see how far you get. You should also double check the values in the rate law to make sure they are correct. Hope this helps, Jia Wang Aqueous Solutions LLC
  14. Dear Anoop, The Academy disabled precipitation to keep the system entirely in the fluid phase for simplifying the example and allowing direct comparison of titration to alkalinity. In reality, precipitation can absolutely affect alkalinity as species from solution are removed. As for the second part, I think it makes more sense to think about them in reverse. A quick explanation regarding how the software calculates the initial equilibrium state. Before any reaction takes place, the GWB software will calculate the equilibrium state of the fluid with the given composition. If precipitation is enabled in React, the program will first calculate the equilibrium state and output a results block to the text output file. If there are minerals that are oversaturated, the program will iterate to solve for the true equilibrium state and precipitate minerals until there are no longer any minerals saturated with respect to the fluid. Running your attached example and opening the output text results file, I can see that several minerals are precipitated at true equilibrium. Two of which are carbonate minerals, dolomite and strontianite, which will affect the total amount of carbonates in fluid and reduces the carbonate alkalinity in solution. This falls in line with your observation of the initial carbonate alkalinity reported when precipitation is checked vs not. I am not entirely sure what you mean by this: "I find that irrespective of titrant (HCl or H2SO4), the prediction of carbonate alkalinity is the same for a given option (either Allow Precipitation or No Precipitation).". When I look at your slides, I see that carbonate alkalinity ultimately depletes to near zero at the same amount of acid added but the curve on the plots are not the same. Just focusing on the HCl titration experiments, you can see that in the case where no precipitation is allowed, the alkalinity starts at 1800 mg/kg and drops linearly as HCl is titrated in. In the plot where precipitation was enabled, the carbonate alkalinity is held relatively stable until approximately 25 mmol of HCl was added. This effect is due to the carbonate minerals that precipitated in the initial equilibrium calculation that is now dissolving back into the fluid. If you plot Minerals (under Variable type), you will see they are completely dissolved when 25 mmol of HCl was added. Hope this helps, Jia Wang Aqueous Solutions LLC
  15. Hello, If you would like to determine alkalinity, one way to go about it is to set up a titration path system in React, with your initial fluid composition set in the basis. You can titrate an acid like HCl until the pH reaches the designated endpoint and determine the alkalinity based on the equivalents of acid added. For an example of this, please see the acidity and alkalinity unit on the GWB Academy. Note that the GWB programs (SpecE8, React, Phase2, X1t, X2t) will calculate carbonate alkalinity based on the speciation of carbonate species when they are present in your system. You can find carbonate alkalinity in the output text file or under variable type Chemical parameters in Gtplot. Hope this helps, Jia Wang Aqueous Solutions
  16. You're welcome Karen. I hope the rest of your project goes smoothly.
  17. Hello, A few suggestions to help you start troubleshooting. The software can only consider reactions that are present within the thermodynamic database loaded into the calculation. The script attached uses thermo.tdat, the default database used in the GWB and is a good quality dataset published by Lawrence Livermore National Lab but it doesn't contain the solid Fe(s) reaction. You can add in the desired reaction from literature or take a look in other databases that might contain Fe(s). If appropriate, you can copy over the reaction to thermo.tdat and save the new dataset under a new name or switch over to another dataset entirely. You should also check the Log Ks for reactions in the database and see if they are appropriate to model conditions of the experiment that you are conducting. Reference information regarding each dataset installed with the GWB can be found when you open the dataset in TEdit and go to the Header pane. For more information on TEdit, the GWB thermodynamic and surface dataset editor, please see chapter 9 of the GWB Essentials User Guide. GWB programs consider all reactions available in the thermodynamic dataset with the given composition of your system. In some cases, when performing a calculation, you will need to suppress more stable minerals so that meta-stable phases that are observed are allowed to appear. The suppress option is under Config -> Suppress. You might want to experiment with trial and error to see what reduced Fe species that are appearing that might be more stable but not necessarily expected in your calculations and suppress them. Also note that the program by default denotes the water stability limits using dashed lines and truncates the diagram to show the region in which the water is stable. Water is not stable outside of these boundaries. You can turn off the truncation to extend the diagram over the full plot by going to Format -> Quick toggle and uncheck water stability limit. Hope this helps, Jia Wang Aqueous Solutions LLC
  18. Hello, I believe the hardness is determined based on the magnesium and calcium concentrations in the fluid. The program follows the method described in the Standard Methods for the Examination of Water and Wastewater for the its specific calculation. Hope this helps, Jia
  19. Hello Huan, Glad to hear that your model is up and running. I hope the rest of your project goes smoothly. Best regards, Jia
  20. Hello Karen, The Goethite seems to be set up correctly. You can perform a Go -> Initial run and then verify the percentage of Goethite along the domain quickly by plotting Mineral (Goethite) volume% vs X position. Best regards, Jia
  21. Glad to hear that was helpful. Hope the rest of your project goes smoothly. Best, Jia
  22. Hello Huan, Thank you for providing more information about your conceptual model. Here are some answers I hope are helpful. The "normal" boundary conditions in the Flow pane are what is described as the default "inlet/free outlet" conditions in the user guides. This means that when fluid is entering the domain, that bound set as an "inlet", where mass is allowed to advect, diffuse and disperse across the boundary. On the other hand, where flow is exiting the domain, the bound is set as a "free outlet", where mass can only cross the boundary by advection. When a boundary is set for "normal" conditions, it can vary from being an "inlet" to a "free outlet" throughout the course of the simulation depending on the flow direction. In your case, I think you are correct in that you should set boundaries with the "outlet" condition since you do wish to diffuse or disperse across and to set the discharge to zero. In X2t, the open flow boundary uses the potential drop across your domain to calculate the flow field and discharge. It sounds like you should be able to set both boundaries to closed and select "outlets" for your left and right bounds. Setting the boundary as "closed" should set the discharge automatically to 0. On the other hand, you can set both left and right boundaries to open and set the potential drop to be 0, keeping the "outlet" condition for both sides and see if that helps? Hope this helps, Jia
  23. Hello, Additionally, I also noticed that you had set your O2(aq) as a total concentration instead of a free quantity, which is commonly is. A free quantity means that the amount inputted by the user represents the quantity of that species alone, which O2(aq) almost always is when measured. If you do so, you should be able to run the calculation without swapping basis as mentioned above and still converge with your calculations. Hope this helps, Jia
  24. Hello, The custom thermo dataset was not attached, but I manage to open your GSS file with thermo.tdat. To investigate the issue with convergence, I launched a SpecE8 instance using the sample composition from the attached GSS file. I noticed that your system is relatively oxidized (with an O2 concentration of 4 mg/kg) and at this pH, the dominant species for your arsenic component is going to be the more oxidized form. It would help the program to solve the equilibrium state when a more dominant form is swapped in. In this case, I tried swapping in AsO4--- for As(OH)4-, making sure to convert the concentration in GSS (I did equivalents of As in mmol/l) and use that value, and SpecE8 converged without issues. If you have only a few samples, it might make sense to launch SpecE8 and perform the swap and run your calculation. If you wish to carry out the calculation in GSS for a large number of samples, you can edit your dataset and use the exchange feature to swap the position of AsO4--- and As(OH)4- and AsO4-- will be a basis species. This way, you can add the total concentration of As in the spreadsheet by adding AsO4--- to the GSS spreadsheet and maintain equilibrium calculation between arsenic redox species. Alternatively, you may consider adding the total concentration of As in under the analyte AsO4--- without editing your dataset. This case, you would be decoupling the redox couple AsO4---/As(OH)4-. I am not sure what would be more appropriate for your consideration. Hope this helps, Jia
  25. Hello, When GSS is asked to calculate an analyte value, it actually calls SpecE8 to do the calculation. When SpecE8 cannot solve the equilibrium system with the given conditions (composition of your sample, temperature, etc) in your GSS sample, the calculation will fail. There can be a variety of issues that cause SpecE8 to fail an equilibrium state calculation and it's not clear based on the screenshot. If you scroll down in the Calculation Error Report pane, you should be able to learn more details regarding the error. I suggest launching a SpecE8 instance with your sample so that you can investigate more closely. For more information on launching GSS samples in SpecE8, please see section 3.5 in the GWB Essentials User Guide. If you require additional assistance with troubleshooting, please attach the input and thermo file so we can take a closer look. Hope this helps, Jia Wang Aqueous Solutions LLC
×
×
  • Create New...