Jump to content
Geochemist's Workbench Support Forum

Brian Farrell

Admin
  • Posts

    1,060
  • Joined

  • Last visited

  • Days Won

    11

Everything posted by Brian Farrell

  1. Hi, In a traditional diagram like this, with Zn++ as the main species, adding Na+ to the “in the presence of” section does nothing. Neither does swapping NaOH in for the Na+. I don’t understand why you’ve swapped HCl(aq) in for the Cl-, either. If it’s just a salt solution you’re dealing with, just add the Cl- directly. HCl(aq) is much less stable than Cl- under the conditions of the diagram, so assuming HCl(aq) is present at the activity you specified is like assuming Cl- is present at a much, much larger activity. Whether you have Cl- in solution or not, metallic zinc is not thermodynamically stable within the area denoted by the water stability limits. Hope this helps, Brian Farrell Aqueous Solutions LLC
  2. Hi Brynn, I’m not too familiar with PHREEQC, but it looks like your PHREEQC input is conceptually different from your GWB input. In PHREEQC you’re defining an initial fluid composition (the SOLUTION block) with a pH of 8.43 and .001 mg/l dissolved Ca++ and F-. The minerals aren’t actually present here, though. As far as I can tell, EQUILIBRIUM_PHASES is used to dissolve enough calcite and fluorite into the solution you’ve already defined to achieve equilibrium with those minerals. There are thus two blocks of output, because you’ve set up a reaction path model. One pre-dissolution (note the pH and concentrations of calcium and fluoride equal your constraints), and one post-dissolution (note the pH has changed to 8.069 and the F- concentration to ~11 mg/kg). In the GWB, you can find the equilibrium state of a water-rock system directly. You swap minerals into the basis to set them as part of the initial equilibrium system. Since you’re limited thermodynamically to one constraint per basis entry, you set mineral masses (arbitrary here) in place of dissolved calcium and fluoride concentrations. The GWB will find the equilibrium system that honors your initial conditions. In SpecE8 (or React with precipitation disabled), you’ll notice one block of output that satisfies your specified system exactly. You can certainly set up the same type of titration in GWB that PHREEQC appears to be doing. You’d use React instead of SpecE8, since this is a reaction path. Your basis would have Ca++ and F- set to the dissolved concentrations used in PHREEQC. Then, you’d add calcite and fluorite as simple reactants. When both minerals dissolve and reach equilibrium with your fluid, your results should match what you get in PHREEQC. The way you described the problem (a water sample of known composition in equilibrium with fluorite and calcite), the swap procedure in GWB seems closer to what you’re after. It honors the fluid composition you’ve specified. Determining the composition of a known fluid after reaction with fluorite and calcite seems like a different process. By the way, since CO3—is the master species in your PHREEQC dataset (and the basis species in the equivalent GWB dataset), I don’t think it is necessary to swap HCO3- into the basis in place of CO3-- Your results won’t be affected too much, but I thought the concentration in mg/l you specify in PHREEQC assumes CO3--‘s mole weight. Hope this helps, Brian Farrell Aqueous Solutions LLC
  3. Hi, I think you’re trying to distill too many complicated processes into a single two-dimensional diagram. They can be quite useful to help you understand certain aspects of a system’s chemistry, but you need to set up some reaction path and reactive transport models to answer most of the questions you’re asking. To see the effects of CaS5 addition on pH and oxidation state, as well as the fate of Cd and other constituents of your fluid, you’ll probably want to use React to titrate Ca++ and S5-- into your contaminated fluid. For more information, please see 3.1 Titration paths in the GWB Reaction Modeling Guide. You could do something similar to vary sulfide concentrations to see when CdS precipitates or remains undersaturated. You could probably use a titration path or a sliding activity path to vary the amount of sulfide in the system, and you might want to buffer certain aspects of the chemistry in this case to keep things simple. A simple log activity of sulfide vs. pH diagram for Cd++ could also help here. To see the spatial zone of influence of the CaS5 amendment, you’ll probably want to set up a reactive transport model. A 1D radial model, for example, with flow diverging from the injection point would help you understand how far the amendment travels, how much it is attenuated by dilution or reaction at any point, and how much Cd remains in solution at any point. As for your redox-pH diagram, Act2 simply reproduces the algorithm you would learn in a geochemistry or aquatic chemistry class to make diagrams by hand. The diagrams work in terms of species activity; they assume species on opposite sides of a reaction line have equal activity along those lines. Species with different charges, then, would have different activity coefficients, which implies that concentration changes along the diagram. A large number of other simplifications go into those types of diagrams, and I don’t think they handle complexing species the way you expect. For a simpler problem it might be ok to take values from SpecE8, as you’ve done, but most of your complexing species in Act2 have little to no effect on the Cd++, and they certainly don’t interact with each other. Computing power and software have improved quite a bit over the years, so more realistic calculations can be used now. Phase2 draws diagrams that look somewhat similar to Act2 in many cases, but the calculation is a complete solution to the equations describing the distribution of mass, just like in SpecE8 and React. You constrain a fluid in terms of concentration, rather than activity. Then you set up simple paths, like in React, to adjust the chemistry. In the staging path, you might slide Eh while holding pH constant to define the left edge of the plot. Then, you trace a series of scanning paths originating from intermediate points along the left edge. For the scanning paths, you might slide pH while holding Eh constant at each of its original values. In this way, mass balance is conserved throughout the diagram. All components in the fluid can interact with each other. And since the calculation is for a fluid as a whole, there’s no “main species” – you can display the predominant form of any basis entry or element. A predominant species is the one that accounts for the most mass of an element or basis species. When constructing diagrams of this sort, though, you should typically work in more restricted Eh and pH conditions. It’s not particularly useful to know conditions far outside the stability limits of water or at extreme pH values. A few other notes: Elemental equivalent units: The mg/l Pb++ as Pb doesn’t hurt anything, but it’s not necessary since the Pb++ ion and the element Pb have the same mole weight. The option is useful for polyatomic species, like the sulfate oxyanion, when the instrument measures the mass of only part of the molecule. If NO3-concentration is determined by actually measuring the amount of nitrogen, for example, you’d use mg/l NO3- as N. For more information, please see 7.1 Example calculation in the GWB Essentials Guide. Free vs. bulk constraints: When setting the concentration of the O2(aq) component with a DO measurement, you almost always want to use the “free” constraint option. For more information, please see 7.2 Equilibrium models in the GWB Essentials Guide. How do you conceptualize redox chemistry in your diagram? Should all redox coupling reactions remain in equilibrium? For example, should ferric iron react to form ferrous iron under reducing conditions, or should it remain stable as ferric iron throughout the calculation, while ferrous iron is ignored? For more information, please see 2.4 Redox couples and 7.3 Redox disequilibrium in the GWB Essentials Guide. If you continue to use Act2, you might want to look into making a mosaic diagram. That way you can account, in a limited way, for the speciation of complexing ligands over the redox and/or pH conditions of your diagram. For more information, please see 5.3 Mosaic diagrams in the GWB Essentials Guide. Hope this helps, Brian Farrell Aqueous Solutions LLC
  4. Hi John, You can’t set zero values for entries in the basis (other than pH, pe, or Eh, since those are logarithmic values). A mineral, for example, can’t have 0 values for concentration or mass. Doing so makes it impossible to solve for the distribution of mass. You can, however, set trivial non-zero concentrations. The initial fluid in this case would still be in equilibrium with the mineral throughout the domain. If the system isn’t in equilibrium with a particular mineral everywhere in the domain, it can be set as a kinetic reactant on the Reactants pane. Hope this helps, Brian Farrell Aqueous Solutions LLC
  5. Hi Zsófia, Thermo_ymp.R2.tdat uses the hmw formalism of the Pitzer equations, just like thermo_hmw.tdat and thermo_phrqpitz.tdat. Thermo_ymp.R2.tdat has some provision for working at elevated temperatures, and is designed to work at high ionic strength, so it could potentially work well for your application. Before using it, though, I recommend that you study the documentation to ensure you're working within the valid range of temperature and ionic strength. Please see 2.3 Thermodynamic datasets in the GWB Essentials Guide, as well as references cited in the dataset, for more information. For future reference, please post new topics to the front page of the forum. The archive is for older posts. It's easy to miss new questions that are added there. Hope this helps, Brian Farrell Aqueous Solutions LLC
  6. I'm glad to hear it helped. Good luck with your modeling. Cheers, Brian
  7. Dear Hiro, I just stumbled across this old thread. For your information, GWB12 released several months ago. It includes the stable isotope transport feature you were interested in. You can learn more about it at GWB.com/gwb12.php, and by reading the Stable isotope transport chapter in the GWB Reactive Transport Modeling Guide. Regards, Brian
  8. Hi Coralie, You're welcome. I'll email you a ChemPlugin SDK demo. Let us know if you have any more questions. Cheers, Brian
  9. Hi, The Kd model implemented in most geochemical modeling software, including the GWB, is what is called the “reaction Kd model” or “activity Kd model”. The Kd approach as strictly defined (as you’d find in a purely hydrologic model) implies, but does not specify, a chemical reaction. In reaction modeling, we write a specific chemical reaction (such as >UO2++ = UO2++) and define Kd’, the apparent distribution coefficient, as the ratio of sorbed mass to the activity of the free ion, rather than the concentration of the entire component. For use in geochemical models, traditional Kd values need to be corrected by the value of the free ion’s activity coefficient, as well as the fraction of the component present as the free species. For more information, please see 9.1, Distribution coefficient (Kd) approach, in the Geochemical and Biogeochemical Reaction Modeling text. The Kd.sdat template, installed with the software in the Gtdata folder, provides a similar explanation in the notes. If you’re referring to the Pb-Kd.sdat file used in our RTM workshop and the GWB Online Academy, the workbook exercise description provides a true Kd value (units of cm3/g) and includes the information needed to convert that to the Kd’ (units of mol/g) specified in the surface dataset. The GWB does not account for changing Kd values with pH. A more robust approach would be to use a surface complexation model, which the GWB does indeed include. You can account not only for pH effects, but mass balance on the sorbing sites, competition of different ions for those sorbing sites, and electrostatic effects. A simple generalized composite approach to surface complexation modeling, if you can parameterize it, would likely be much better than any Kd model. Hope this helps, Brian Farrell Aqueous Solutions LLC
  10. Hi Geoff, Unfortunately GWB8 is no longer supported. We’d be happy to send you a demo of GWB12, our latest release, to get you up and running right away. Our sales staff can help set you up with a quote to upgrade or start a subscription. Regards, Brian Farrell Aqueous Solutions LLC
  11. Hi Coralie, Thanks for your clarification. The GWB plugin wasn’t intended to let a client control time stepping and retrieve calculation results from any stage of a calculation. Rather, it was designed to prompt a client to run a geochemical model (e.g. an equilibrium model with the SpecE8 plugin) and retrieve the end results (e.g. mineral saturation indices) without any need to develop an in-house chemical modeling simulator. With the React plugin, similarly, you can simulate any reaction path model (e.g. precipitating minerals from a supersaturated fluid or acidifying a sample) but the plugin was designed only to retrieve the end results. The GWB plugin is now a legacy feature. ChemPlugin was created to supersede and drastically improve those plugin capabilities. One important capability was the ability to control certain operations, such as figuring the maximum allowable time step, advancing the time level, and solving the chemical reaction equations at a given step, then retrieving results from that step. The application programmer interface (API) is composed of a small number of member functions that enable this fine-tuned control. The ChemPlugin User’s Guide describes how the software works. The Titration Simulator chapter specifically describes how you can set up a time marching loop to control your ChemPlugin instance. It walks you through a client written in C++ to report the concentration of various species at different stages of a pH titration. In the ChemPlugin Modeling with Python Academy, we have an example even closer to what you want. In the Time Marching lesson, a client written in Python is set up to report to the console the pH after various amounts of NaOH have been added to a fluid. The Diffusion and Dispersion lesson similarly walks you through writing results to a text file. An instance is an individual copy of ChemPlugin. A single ChemPlugin instance would suffice for your purpose, since it’s a single batch reactor. However, in tracing a reactive transport model (i.e. in a spatially discretized domain), separate ChemPlugin instances could be very useful. They would operate in different nodes in parallel to share the work, rather than executing the chemistry calculations serially. This can speed up your calculations significantly. Please let me know if you’d be interested in trying out a demo of ChemPlugin. Regards, Brian
  12. Hi, The WaterQualityRegs.dat example file is loosely based on various drinking water regulations implemented in the United States by the USEPA. You are of course free to prepare your own dataset. For more information, visit the USEPA web site, http://www.epa.gov/safewater/contaminants/index.html. Regards, Brian Farrell Aqueous Solutions LLC
  13. Hi Bob, There are a couple methods you might try. One idea is to add the urea and molasses as simple reactants. Simple reactants are field variables, meaning the mass reacted can vary spatially. You might use the node-by-node editor to set the reactant mass everywhere in the domain to 0 except for the node containing the injection well. Keep in mind that simple reactants are added continuously throughout the simulation, though, unless you specify a cutoff value. I think you’d need a cutoff to ensure the urea and molasses are added only during the first 12 days. For more information, please see 3.1 “Titration paths” in the GWB Reaction Modeling Guide, the Heterogeneity Appendix in the GWB Reactive Transport Modeling Guide, and 9.89 “react” in the GWB Command Reference. Alternatively, you could define a new fluid for the urea and molasses solution (with negligibly small amounts of the rest of your basis entries) and add a new injection well. Beginning with GWB11, you can specify any number of wells within a single nodal block. X2t determines from the position you specify the nodal block a well would fall within, then uses the corresponding nodal point as the actual position. You could define two sources of fluid (the direct injection well and the recirculation well) where the mixed fluid is being injected. With wells, of course, you turn pumping on and off whenever you like, so the 12 day injection interval is no problem. I’m glad to hear you enjoyed the workshop at the Goldschmidt Conference. It was nice to meet you in person. Hope this helps, Brian Farrell Aqueous Solutions LLC
  14. Dear Coralie, I'm not exactly sure what you're trying to do, but "im_func" and "im_self" won't be helpful to find out what details you can get from the report command. For a complete description of the report command, including the arguments accepted in each GWB app, please see the Report Command chapter in the GWB Reference Manual. Regarding the GWB's Plug-in Feature and ChemPlugin, they are somewhat similar, but have some important differences. In each, you can write your own program or script (the client or “master program”) that uses the GWB in some form (Rxn, SpecE8, React, X1t, or X2t in the Plug-in Features, or ChemPlugin) to perform calculations for you and pass along the results. For example, a program you write might use SpecE8 to figure the saturation state of Calcite in a fluid, or use ChemPlugin to do the same, then feed the result back to the client. A client could similarly use the Plug-in Feature to have X1t trace a 1D reactive transport model and retrieve certain results from any nodal block of interest. The transport calculation in this case is limited to the flow model implemented in X1t. With ChemPlugin, however, you’re not limited to any conceptual model of flow. You create ChemPlugin instances which self-link into a network of any geometry. The client specifies the rate at which fluid flows across each link (thus controlling advective solute transport and convective heat transport) and can also set at each link transmissivities representing diffusion, physical mixing, and heat conduction. The client then marches forward in time and triggers the instances to perform various steps, such as reporting optimum time step size, transporting mass, transferring heat, and solving the chemical reaction equations. There are a few other key differences between ChemPlugin and the GWB’s Plug-in Feature. With ChemPlugin you can launch any number of instances that will self-link, but you only have 1 instance of the GWB’s Plug-in. Finally, the ChemPlugin API is much easier to use than that for the GWB’s Plug-in Feature. A straightforward API composed of a few member functions makes linking ChemPlugin with your client a simple matter. If you'd like us to try to help further, please provide your Python script. Hope this helps, Brian Farrell Aqueous Solutions LLC
  15. Hi Oleh, One strategy would be to set a simple kinetic rate law for the redox reaction between H2S and sulfite. If kinetic parameters are unknown, or time isn't particularly important, you could just use arbitrary values and ignore the time. If you want to use an equilibrium model, though, you'll probably have to rebalance the coupling reactions in your thermo dataset. Instead of coupling redox species H2S and sulfite to the basis species sulfate, you could set up a dataset with H2S or sulfite as a basis species, and the other two coupled to it. The TEdit app provides a convenient way to do this. It will rebalance any reactions that would be affected. For details, please see section 9.2.8, Exchanging species, in the GWB Essentials Guide. I'd have to see your script and thermo dataset to see why the other species aren't being loaded in your simulation. Finally, it's easy to miss posts in the archive. In the future, please add new topics to the main section of the GWB forum. Hope this helps, Brian Farrell Aqueous Solutions LLC
  16. Hello, The GWB does not currently include a solid solution model. One or more minerals of a composition intermediate between two end-members can be accounted for, however, by adding minerals of discrete composition and known stability to the thermo dataset. Regards, Brian Farrell Aqueous Solutions LLC
  17. Hi John, I don’t quite understand. It sounded like a single React input file was producing different results in GWB8 vs. GWB11. But now you’re saying you’ve changed the Na+ and NO3- concentrations in the input as well? If you want me to see whether the software is behaving differently from one release to the next, I’ll need a consistent input file (.rea) that I can run myself. I need to see what database (and activity model) is used, how the model is set up, the units that are used, the species that are loaded, etc. Thanks, Brian
  18. Hi, Do you have an example input file that demonstrates this behavior? Thanks, Brian Farrell Aqueous Solutions LLC
  19. Hi Fang, You’ll want to disable the redox coupling reaction between acetic acid and HCO3-. When you decouple acetic acid, it acts just like a basis species, so you can add it to SpecE8’s basis directly. You won’t be required to add O2(aq) to your basis, but if you do, the acetic acid won’t break down to other types of carbon species. If you need both O2(aq) and HCO3- in your basis (perhaps O2(g) and CO2(g) are in contact with your solution), you’ll probably want to disable all redox coupling reactions involving carbon. For more information, please see 2.4 Redox couples and 7.3 Redox disequilibrium in the GWB Essentials Guide. By the way, a dissolved oxygen measurement is almost always set as a “free constraint” (8 free mg/kg, referring to the O2(aq) species only, rather than 8 mg/kg, which would constrain the entire O2(aq) component). For more information, please see 7.1 Example calculation in the GWB Essentials Guide and 5.1 <unit> in the GWB Command Reference (or look for the same SpecE8 command in the GWB Reference Manual for older releases of the software). Regarding the charge imbalance, I think you’ll find the value is pretty miniscule. Sometimes it’s possible to calculate the equilibrium pH of a fluid at a specified temperature using SpecE8. Other times you might know the pH at room temperature, so you can use it to constrain the initial condition of a sliding temperature path in React. It’s a really convenient option. For more information, please see section 3.4 Polythermal reaction paths in the GWB Reaction Modeling Guide. Hope this helps, Brian Farrell Aqueous Solutions LLC
  20. Hi Amanda, I'm happy to hear that you're up and running, and that this will save you time. Cheers, Brian
  21. Dear Michael, Thanks for your question. The GWB currently plots Durov diagrams in the strict sense. You can plot the diagram with or without the pH or TDS squares, but you can’t substitute different parameters for either square. Regards, Brian Farrell Aqueous Solutions LLC
  22. Hi Amanda, I took a look at your GSS file and your React script and noticed a few things. The React script was using the default thermo.tdat dataset, not the Phrqpitz dataset. You can check the dataset loaded in any app by going to File -> File Properties -> Thermo Data. It's possible you changed the thermo dataset in the Preferences dialog, but this only applies a preferred setting for every subsequent time you open a blank instance of an app. You need to use File -> Open to actually load a different dataset in an already open app. GSS does not allow supersaturated minerals to precipitate, so you should set up React to be consistent by disabling precipitation. You should similarly disable charge balancing in React to be consistent with GSS (or set GSS to balance on Cl-, to be consistent with React). For more information, please see 2.3 Initial system in the GWB Reaction Modeling Guide. The "flash" configuration is not enabled by default, so you need to turn that on from the Config -> Stepping dialog. Please see 3.7 "Flash diagrams" in the GWB Reaction Modeling Guide. I think the unit for Na+ in GSS is supposed to be mol/kg, not mmol/kg. You also have F- and B(OH)3 components in React, but not in your GSS spreadsheet. Just a tip, you can drag and drop a sample from GSS into React's Basis pane, or from React's basis pane into GSS. That makes it easy to quickly copy chemical data from one app to another. By the way, you can implement polythermal mixing in React by clicking the pulldown next to the temperature unit and changing it to "reactant mixing". Then, set the reactant temperature to the temperature of your reactant fluid. For more information, please see 3.4 Polythermal reaction paths in the GWB Reaction Modeling Guide. Hope this helps, Brian Farrell Aqueous Solutions
  23. Hi, You can't add a reactant to a system unless that system already includes the components that make up the reactant. The components need to exist in the initial definition of the thermodynamic model, even if in a negligibly small concentration. All you have to do is set very small amounts of B(OH)3(aq), Li+, Mg++, etc. in the Basis. Hope this helps, Brian Farrell Aqueous Solutions LLC
  24. You're welcome. I'm glad to hear that you were able to use TEdit to make your dataset. Unfortunately, there is no ultimate dataset that is appropriate for everyone. There will always be tradeoffs between completeness and accuracy. Every user needs to be a judge of what data is appropriate for their specific applications. Cheers, Brian
×
×
  • Create New...