Jump to content
Geochemist's Workbench Support Forum

Brian Farrell

Admin
  • Content count

    904
  • Joined

  • Last visited

  • Days Won

    4

Brian Farrell last won the day on April 2

Brian Farrell had the most liked content!

Community Reputation

4 Neutral

About Brian Farrell

  • Rank
    Advanced Member

Profile Information

  • Gender
    Male

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Brian Farrell

    ChemPlugin Setting Units

    Hi Erik, Ok, thanks for the additional information. A very simple strategy for that intermediate instance would be to fix pH and charge balance on SO4--. Assuming reaction within the domain increases pH, so that you’re always adding sulfuric acid to the effluent, the program will add enough H+ to achieve the desired pH, along with SO4-- to balance it out. If reaction along the domain were to decrease pH, however, the program would remove H+ and SO4-- from the intermediate instance to maintain the pH. In that case, the configuration is not realistic. I’m assuming here that you’re monitoring pH in the real world as a proxy for sulfuric acid concentration, since that’s an effectively instantaneous measurement, but that may not be the case. If that’s not quite right, a more complex solution might be to do something like the second task in the Time Marching Loops lesson in the ChemPlugin Modeling with Python Academy. In that example, the client titrates NaOH into a fluid and queries ChemPlugin for the pH after each small addition. It stops the titration when the desired pH is achieved. Perhaps you could titrate sulfuric acid into the fluid and query ChemPlugin for whatever you need, then once you reach that target, send that fluid to the inlet of your domain. Hope this helps, Brian
  2. Brian Farrell

    ChemPlugin Setting Units

    Hi Erik, Can you clarify whether you want the fluid that flows out of the last node to loop directly into the first node, or whether it should be transformed in some way? If it’s being transformed, can you please elaborate on how this is done? What’s the process? Thanks, Brian
  3. Brian Farrell

    ChemPlugin Setting Units

    I'm glad to hear it helped. I hope you enjoy using the software. Brian
  4. Brian Farrell

    ChemPlugin Setting Units

    You can find the example ChemPlugin client RTM1.py at https://chemplugin.gwb.com/client_programs.php
  5. Brian Farrell

    ChemPlugin Setting Units

    Hi Erik, You can use a variety of units when configuring a ChemPlugin instance. For example, cp.Config(“Ca++ = 1 mmol/kg”) cp.Config(“Ca++ = 40.08 mg/kg”) You can use a variety of units in retrieving results, as well. For example, cp.Report("concentration aqueous", "mmol/kg") cp.Report("concentration aqueous", "mg/kg") Similarly, you can use a variety of units in setting the links between instances. For example, this code from the Reactive Transport Model lesson on the ChemPlugin Academy is used to set up a link between an inlet fluid and the first node of a 1D domain. The client calculates three variables (flow, trans, and ttrans, representing flow rate, transmissivity, and thermal transmissivity, respectively) and passes them to ChemPlugin using three member functions (FlowRate(), Transmissivity(), and HeatTrans(), respectively). flow = some number trans = some number ttrans = some number link = cp[0].Link(cp_inlet) link.FlowRate(flow, “m3/s”) link.Transmissivity(trans, “m3/s”) link.HeatTrans(ttrans, “W/K”) The simulation parameters you’ve highlighted are from simple example client programs that use ChemPlugin, not ChemPlugin itself. A client could be relatively basic, like these, with no options for choosing units. Or, it could be a full-blown polished program with a GUI to choose units. Either way, ChemPlugin doesn’t care. The client just tells ChemPlugin what unit it used, and ChemPlugin is happy to accept it. If you look at the rest of the two client programs you’ve mentioned, you’ll see that the flow rates and transmissivities calculated by the client are either in cm3/s or m3/s, depending on the simulation parameters you’ve shown, and the units used were passed in the appropriate member functions. The important thing to remember is that you’re building a client, a reactive transport simulator tailor-made to your specifications here. It can be of any geometry, with any connections and feedbacks that you want to incorporate, and the user can interface with it however you’d like. Thanks, we’ll take a look at the website link. Hope this helps, Brian Farrell Aqueous Solutions
  6. Hi Dave, No, you can currently plot only a single Y axis on a Schoeller diagram. You can, however, choose from a variety of units, including mg/kg or mmol/kg, so that you can include uncharged components in your plot. The classical Schoeller diagram, though, uses electrical equivalent units like meq/kg. What is it that you'd like to plot on a second Y axis? Perhaps you can make separate diagrams and overlay them in a graphics program like PowerPoint? Regards, Brian Farrell Aqueous Solutions LLC
  7. You're welcome. Ahh, that makes sense. I hope you enjoy using the software. Regards, Brian
  8. Brian Farrell

    Adding water quality analytes to GSS

    Hi Clint, Glad to hear you're up and running. Regards, Brian
  9. Brian Farrell

    Script for X2t

    Hi Erik, For something this complex, it sounds like you might be better off using ChemPlugin to construct your own reactive transport code, rather than trying to fit your needs to X2t’s capabilities. With a client program that you write to solve the flow problem, you can use ChemPlugin instances to solve the chemical reactions. Your client has fine-grained control over ChemPlugin’s time marching loop, and you’re able to retrieve results and set up sophisticated simulations without too much effort on your part. Hope this helps, Brian Farrell Aqueous Solutions LLC
  10. Hi, You can set most basis entries as bulk or free constraints. For a bulk constraint, the value you set refers to the entire thermodynamic component, whereas for a free constraint, it refers to the particular species only. The HCO3- component, for example, might include the HCO3- species, as well as CO2(aq), CO3--, NaHCO3, etc. If you set 10 “mg/kg” HCO3-, the concentration is for the sum of those species. If you set 10 “free mg/kg” HCO3-, though, the concentration refers only to the individual HCO3- species. An additional amount of carbon exists as the other species. Likewise, for H2O, “free kg” refers to solvent H2O only. If you change the setting to simply “kg”, the mass you specify refers to the sum of solvent H2O plus species composed of water (e.g., Al(OH)4- + 4 H+ = Al+++ + 4 H2O). For more information, please see 7.1 Example Calculation in the GWB Essentials Guide. Log refers to the base 10 log of a number (e.g., 1 free kg H2O = 0 free log kg H2O). A more common use is for setting the CO2 fugacity or partial pressure using logs (e.g. log f CO2(g) = -3.5). In the future, please don’t post topics multiple times. Regards, Brian Farrell Aqueous Solutions
  11. Brian Farrell

    Adding water quality analytes to GSS

    Hi Clint, We can look into the issue of units changing from mg/l to mmol/kg when no mole weight is specified. However, your “Total X” analytes should almost certainly be defined with the mole weight of the appropriate element (e.g. 14.007 for N or 30.974 for P). Even if you’re not sure about the mole weight, you might still add the analyte with mg/l default units and the element’s mole weight, and just not convert to mmol/kg. The undesired unit change only happens when mole weight is set to 0. Alternatively, make the analyte name something like “Total N (mg/L)” and choose “Number” for the dimension and unit. Hope this helps, Brian Farrell Aqueous Solutions LLC P.S. It's best to post on the front page of the GWB forum, not in the archive of old posts.
  12. Brian Farrell

    Two sorbing surfaces for Ni and Zn

    Hi Abel, The GWB apps come installed with example datasets for surface complexation on iron oxyhydroxides, but you can account for any number of different sorbing surfaces in React and the other GWB programs. You simply supply a dataset for each surface. The graphical thermo data editor TEdit can be used to quickly construct surface datasets. To use multiple surfaces in a model, each surface dataset that’s loaded should have a different “surface type”. The surface type is simply a descriptive label that appears in the third line of the surface dataset. For example, the label in FeOH.sdat, which describes sorption to hydrous ferric oxide, is HFO. If you prepare a separate dataset for Mn oxide sorption, you might use “Mn oxide” for the surface type. A separate requirement for using multiple surface datasets simultaneously is that species must have unique names. For example, an uncomplexed site in FeOH.sdat is >(w)FeOH, so you can’t reuse that name in your Mn oxide dataset. Instead, you might use something like >MnOH. That’s really all you need to do. For an example of a model incorporating multiple surfaces, check out Colloid.X1t, installed with the software in the Script folder. The example uses a Kd surface dataset to describe partitioning of Pb++ between the solution and sediments in an aquifer, and a two-layer surface complexation dataset to describe Pb++ complexation with a ferric hydroxide colloid that flows into the aquifer. Hope this helps, Brian Farrell Aqueous Solutions
  13. Hi Jeff, For this kinetic mineral reaction, you'll need to specify a custom rate law instead of using the GWB's Built-in rate law. I think the simplest option, the rate law equation, would work for your purposes, but you can set more complicated scripts or functions if you'd like. The process is described in section 5.1, Setting the rate law form directly, in the GWB Reaction Modeling Guide. After you've added the kinetic Forsterite, change the rate law pulldown from "built in" to "equation", then type in the equation to be evaluated. You can access the Internal parameters in Table 5.1 and the Helper functions in Table 5.2. The latter will be needed to include the H+ ion activity in your rate law. Regards, Brian Farrell Aqueous Solutions LLC
  14. Brian Farrell

    X2t seems to be running but get stuck

    Hi Yuan, A numerical model isn’t guaranteed to handle everything that’s thrown at it. Your simulation with the built-in rate law runs to completion, but it still struggles quite a bit because the problem isn’t especially well posed. The dolomite reacts orders of magnitude faster than any of the other kinetic minerals. This forces really small time steps. And because the mineral dissolves completely, in a moving front as the model marches through time, you have incredibly high reaction rates adjacent to zero rates. Considering these substantial differences, there’s really no point in using kinetics for the dolomite. An equilibrium model should suffice. Your simulation should run faster, too, because the other kinetic minerals don’t require such small time steps. Or, if you really want to continue using kinetics, you should decrease the rate slightly. Decreasing the pre-exponential factor by even an order of magnitude lets the model run to completion. There’s essentially no difference in the output, considering the current course grid, which can accentuate differences. You could even set in your custom rate law a reasonable maximum reaction rate, and take the minimum of that and your calculated rate. The point is that there’s little difference in the output whether you use an amazingly fast or just a really fast rate for dolomite dissolution, apart from the numerical instabilities you introduce with the amazingly fast rate. It might seem wrong to disregard or tinker with the kinetics here, but keep in mind that there are always a lot of variables that go into reactive transport models. Certain conditions make the models very sensitive to some parameters and insensitive to others. The precise value you set for the diffusion coefficient, for example, won’t change your output compared to using the default value because the term is insignificant wherever groundwater flows at an appreciable rate. Sometimes you need to take a step back and determine what is most important. By the way, the values you’ve set for Courant and Xstable are far too large. Their default values, 1, are the largest they should ever be. You should only set smaller values for these parameters as needed. In this simulation the kinetics of dolomite dissolution end up limiting time steps anyway, but in general you shouldn’t ever increase those values. For more information, please see the GWB Command Reference. Hope this helps, Brian
  15. Hi BryanW, The Piper diagram units cannot be changed. Because they’re percentages, though, it doesn’t matter whether you use meq/kg or meq/l. You can see this for yourself by plotting a ternary diagram (these accommodates any unit choice, such as mg/kg or mmol/l, not just electrical equivalent units) or making a quick Excel calculation. If you’d like, you can edit the text in PowerPoint or Illustrator. Just go to Edit > Copy/Copy As and paste special/paste the .emf or .ai file into your desired program. Can you please attach a plot with the text overlapping the legend border? Or your GSS file? It might be that certain characters in the sample name aren’t being accounted for correctly when the legend border is drawn. For now, you can also edit this in PowerPoint or Illustrator. Thanks, Brian Farrell Aqueous Solutions
×