Jump to content
Geochemist's Workbench Support Forum

All Activity

This stream auto-updates     

  1. Last week
  2. Jia Wang

    Co-precipitation

    Dear Christophe, The maximum sorbed capacity for each metal is calculated outside of React. From Gtplot or the text output file of the simulation, you can see that there are 0.89 mmoles of Fe(OH)3ppd precipitated. Then in the surface dataset (FeOH+.sdat) you can find the sorbing density, which is 0.005 mol of strong sites and 0.2 mol of weak sites per mole of Fe(OH)3ppd. Then you look at each metal and see if they sorb onto weak, strong, or weak and strong sites. To calculate the maximum capacity for each metal, assume that there is only one metal sorbing to the mineral surface at a time. Just multiply the mineral mass by the site density of each appropriate site and convert to mg/kg. For As(OH)4-, it's 0.00089 mol/kg * .2 mol sites/mol * 142.951 g/mol * 1000 g/kg = 25.4 mg/kg. For metals that include strong sites, include those as well. The ‘in solution’ component concentrations are reported directly by React under ‘Components in fluid’. You can select to plot ‘Components in fluid’ vs. pH in the XY Plot Configuration dialog in Gtplot and export the numerical data using the method described in my previous response. Alternatively, you can also open the text output file and look for the concentrations of the desired components at each time step listed under ‘Original basis’ text block in the column ‘in fluid’. Hope this helps. Best, Jia Wang
  3. Christophe Simbo

    Co-precipitation

    Thank you for your reply Dear Wang. If I have asked that question it's because I did as you described up here based on the graph pH versus sorbed fraction.May be it's not the appropriate XY plot. If so, could you enlighten me what XY plot that can yield the maximum sorbed and in solution components of the solutes . Thank you
  4. Hi Brain , Thanks for your feedback. I have thoroughly read GWB documentations (Essentials, React and x1t ) and forum questions, but I must be missing something. I am trying to reproduce acidic core flooding experiment of fresh water saturated carbonate rock using x1t to match the produced Ca++ ions (ICP ) and estimate diffusion coefficient and reaction rate constant. the chemical equation is as follows : CaCO3 + 2HCl ---> CaCl2 + CO2 + H2O Here are the summary info of the fluid -rock system and the core flooding experiments : Cylindrical Carbonate rock (97% Calcite (CaCo3), radius 2.5 cm ,length 5 cm, rock weight ( 58 g), Porosity ( 16% ) , Permeability (9 md) , Bulk volume ( 25 cm3) Carbonate rock was saturated and flooded with Fresh Water Then saturated carbonate rock was flooded with HCl as intel fluid ( pH=2) at injection rate ( 7 cm3/min) till wormhole channel was formed and pressure drop fall to near zero value. I have tried to mimic the fluid-rock properties into the model, but I am not sure. My concerns are the following : How can I add the rock mineral ( carbonate calcite (CaCo3) ) and at what units (97 vol% or 58g , 58g/kg ) to the fluid system?I tried 2 methods. Method 1 (Aziz Model file) : I added calcite in the kinetic reactant pane (meaning calcite is not in equilibrium with the fresh water ) , but I couldn’t add calcite in 58 g unit as its weighted (97% of core sample weight ) which will be reflected in calcite specific surface area . Method 2 (Calcite swapped with Ca++ file) : I swapped calcite with Ca++ ( stating equilibrium condition with fluid) in the initial fluid pane plus adding the calcite in the kinetic reactant pane, but calcite concertation appeared to start producing from 350 mg/l instead from 0 mg/l . Do I need to equilibrate the fluid and the rock in the initial pane ? I did try Calcite mineral swapped with Ca++ in the fluid pane with React script ( Ca++_3 file). Sometimes I get this Error: -- Error: Porosity of node 0 is too small: -0.269011 . I can’t change much in the domain pane that semi-represents cylindrical core sample ( dimensions ) . Any help with setting this up would be much appreciated. Please see attached files. Regards Abdulaziz Ca++_3.rea Aziz Model.x1t Calcite swapped with Ca++.x1t
  5. Jia Wang

    Co-precipitation

    Dear Christophe, In the React app, the results file output a dataset in tabular form. You can scroll down and see the concentrations of various basis species sorbed and in fluid and more information(e.g. mineral saturation state, reactants, gasses, etc..) at each reaction step. However, another way to retrieve numerical data is to use Gtplot and copy and paste the data onto an excel spreadsheet. You can select ‘Plot Results’ in the Results pane and Gtplot will open up. Double-click in the plot to open the XY Plot Configuration dialog. Select the desired X and Y axis parameters and click apply to modify the plot. For example, you can plot one or many components in fluid as the Y-Axis parameter and Rxn progress on the X-Axis. To obtain numerical data for this data, you can click Edit --> Copy as --> Spreadsheet and the paste the data in an excel spreadsheet. For more detailed instructions, you can refer to the ‘How do I retrieve numerical data from my plots?’ on the GWB Tutorials webpage and section 6.7 in the GWB Reaction Modeling Guide. The number of moles regarding strongly and weakly binding surfaces refers to the sorption site density available on the sorbing mineral. In this case, for every mole of ferric hydroxide precipitated, there is 0.005 moles of strongly binding surface sites and 0.2 moles of weakly binding surface sites available. Hope this helps. Best, Jia Wang
  6. OK, I have tried the other route that I put all files in the installation file of GWB and re-do everything. It now works. Thanks, Dan!
  7. Hi Dan, Thanks. You are right that I was generating 32 bit DLL since I was using "Developer Command Prompt" However, I have just tried to re-compile the DLL using X64 Native Tools Command Prompt for VS 2019. After generating DLL, I also used command 'dumpbin' to verify it is is 64 bit DLL. As I load FeRB.x1t into x1t, the x1t program crashed (window disappeared) without giving any error information. Need help on this. FYI, my Windows OS is x64. Tao
  8. dan saalfeld

    Script in Chemplugin

    Hi Johan, 1) The surface data one happens to work because \P \C \G and \F are not special escape sequences in Python. However in the thermo database path you have a \t which is a special escape sequence that represents a "tab" character. Here is one list of special escape sequences https://docs.python.org/2.0/ref/strings.html . However it is usually easiest if you are using backslashes to just always escape them if you want a literal backslash character in the string - that way you don't need to remember which letters are special. Also some versions of Python will throw an error if you use an invalid escape sequence. You may also use forward slashes when specifying thermo and surface data paths (linux style paths) for ChemPlugin e.g. 'data = "C:/Program Files/Gwb/Gtdata/thermo_wateq4f.tdat" verify' 2) There are a couple different issues I see in the script, but still mostly Python string related. For your rate law instead of having 'rate = (expression) RETURN rate' you can instead just have it return the expression directly without setting that temporary variable. e.g. 'RETURN (expression)'. Alternatively you could also add newline "\n" before the RETURN rate part since that should be on a separate line. a) return value directly: "kinetic Calcite .1 volume% rate_law = script 'RETURN (1.49e-02*EXP(-29000/(8.3144598*TK))*activity(\'H+\')^0.75 + 1.00e-02*EXP(-34800/(8.3144598*TK))*activity(\'H2CO3\')^0.75 + 2.20e-07*EXP(-52200/(8.3144598*TK))*activity(\'H2O\')^0.75) * surface * (1 - QoverK) RETURN rate' pre-exp = ??? act_eng = ??? surface = 200", b) properly separate the lines of script with newline \n: "kinetic Calcite .1 volume% rate_law = script 'rate = (1.49e-02*EXP(-29000/(8.3144598*TK))*activity(\'H+\')^0.75 + 1.00e-02*EXP(-34800/(8.3144598*TK))*activity(\'H2CO3\')^0.75 + 2.20e-07*EXP(-52200/(8.3144598*TK))*activity(\'H2O\')^0.75) * surface * (1 - QoverK) \nRETURN rate' pre-exp = ??? act_eng = ??? surface = 200", To get a better feel for Python strings I would recommend opening an interactive Python session and just try things out interactively with the print command. Here are the dataset examples: >>> print('surface_data = "C:\Program Files\ChemPlugin\Gtdata\FeOH.sdat"') surface_data = "C:\Program Files\ChemPlugin\Gtdata\FeOH.sdat" >>> print('data = "C:\Program Files\Gwb\Gtdata\thermo_wateq4f.tdat" verify') data = "C:\Program Files\Gwb\Gtdata hermo_wateq4f.tdat" verify >>> print('data = "C:\\Program Files\\Gwb\\Gtdata\\thermo_wateq4f.tdat" verify') data = "C:\Program Files\Gwb\Gtdata\thermo_wateq4f.tdat" verify One last thing that may also help with Python strings that contain nested single and double quotes is that instead of using one single or double quote to mark string start/end Python also allows you to use three single or double quotes to start and end a string which allows you to then use the same type of quote inside the string without escaping it. >>> print("""can now freely use unescaped double quotes like these " " inside the string""") can now freely use unescaped double quotes like these " " inside the string >>> print('''can now freely use unescaped single quotes like these ' ' inside the string''') can now freely use unescaped single quotes like these ' ' inside the string Hope this helps, Dan
  9. Hi Tao, It looks like the DLL was built correctly, but it is a 32-bit DLL. As such it will only work with the 32-bit version of GWB. I am guessing you are running the 64-bit version of GWB and that is why it is unable to load it. To get it to work please either install the 32-bit version of GWB or build the DLL as a 64-bit DLL. If you are using a recent version of Microsoft Visual Studio to build the DLL you should be able to just change the platform dropdown from "x86" to "x64" to change the DLL to a 64-bit build. Instead of : You want : Hope this helps, Dan
  10. JohanFourie

    Script in Chemplugin

    Hi Brian I have not come right with this yet and would appreciate if you can help. To make the problem more tangible I have edited the chemplugin example: Flowthrough1.py and attached it here. 1) The thermo database does not seem to need the escape character. In the attached python script I can run the 'surface data' without any escape character: 'surface_data = "C:\Program Files\ChemPlugin\Gtdata\FeOH.sdat"', However, if you deactivate it with # and activate the wateqdatabase (for instance), with or without the escape character it does not work: 'data = "C:\Program Files\Gwb\Gtdata\thermo_wateq4f.tdat" verify', or 'data = "C:\\Program Files\\Gwb\\Gtdata\\thermo_wateq4f.tdat" verify', I have tested it by changing a mineral name in the database i.e. calcite --> calcite2, however chemplugin couldn't read the database. 2) Then I also cant get the script to run. I have tried different ways but cant get it to run. I dont know where is the problem. It is not maybe at the "….RETURN rate" part? # "kinetic Calcite .1 volume% rate_law = script 'rate = (1.49e-02*EXP(-29000/(8.3144598*TK))*activity(\'H+\')^0.75 + 1.00e-02*EXP(-34800/(8.3144598*TK))*activity(\'H2CO3\')^0.75 + 2.20e-07*EXP(-52200/(8.3144598*TK))*activity(\'H2O\')^0.75) * surface * (1 - QoverK) RETURN rate' pre-exp = ??? act_eng = ??? surface = 200", My problem is that my real model have temperatures up to 220 C and I need to include to higher kinetic rate in some way or other. I have come right with the sliding temperature question I had in the other post and now my model can run at different temperature scenarios. I think chemplugin works great as it surely gives you a lot of flexibility to work with. Regards Johan FlowThrough_JF2.py
  11. Christophe Simbo

    Formation Damage

    So sorry I just find out that it was a problem of units in X axis.
  12. Jia Wang

    Initial System_SpecE8 versus React

    Hi Christophe, You can most certainly change the species for charge balancing. To change to a different species, add the species into the basis pane and in the drop arrow next to the units and select ‘Balance species’. Typically, the balance species chosen has high abundance and low uncertainty. For example, React is setup to use Cl- as the default charge balancing ion since most Cl- is usually abundant and can be calculated from charge balance base on other species concentrations measured in chemical analyses. Hope this helps, Jia Wang
  13. Christophe Simbo

    Formation Damage

    So sorry to ask one more question on the "waste injection well" topic..I went through all steps but on graph Volume=f(dolomite reacted), the dolomite function cannot be plotted. Can some one guide me on this issue(see attached image)?
  14. Hi, I am new to GWB. Our lab has GWB version 9.09 profession. I am simply trying to reproduce results from Bethke et al. (2018) "Origin of microbiological zoning in groundwater flows". All codes were provided by Bethke et al in their SI file: https://www.geosociety.org/datarepository/2008/2008185.pdf I could successfully ran and reproduced results using SRB.x1t. As to FeRB.x1t, I could compile FeRB.cpp and link it with x1t.lib to generate FeRB.dll. However, I kept getting error information " -- Error: Can't open rate-law library: FeRB.dll" when I hit 'go' to run FeRB.x1t. I have running GWB 9.09 on windows 10. I am the administrator account of my computer. What might be the reason? Thanks. P.S., All related files for FeRB.x1t are attached. Tao FeRB.x1t AquiferBaseModel.x1t FeRB.cpp FeRB.dll thermo-aquifer.dat x1t.lib
  15. Christophe Simbo

    Co-precipitation

    In acide drainage and buffering in Task3 "Co-precipitation", I cannot understand where some figures were found and to make my question more clearer, I attach the part that difficult to understand on there. Where can I find the sorbed and in solution quantities of species? I tried to click on "view results" I did not find them nor are they found in graphs. Does 0.005 moles of the strongly binding surface/mole of precipitate refer to As(OH-)4 as 0.2/ 25.4 = 0.007 and that of 0.2(weakly binding surface) refer to Na+ and Ca2+? Thank you
  16. In GWB Reaction Modeling (page 19), Could you explain how to choose or select one ion to set a charge balancing. An example to this case has been applied on the topic "Acid drainage and buffering", and Ca2+ as been chosen for "Balance species". Can other ions be chosen instead of Ca2+? Thank you
  17. Jia Wang

    Something wrong with my GSS

    Dear Koitoliver, In the screenshot you provided, the analyte HCO3- is already added to the spreadsheet and therefore you cannot add it again when you select “+ analyte”. The hardness of the fluid sample is a result of calculation; it cannot be used as a constraint. Only the HCO3- concentration (typically the HCO3- component, but you can alternatively constrain the free HCO3- ion) or the carbonate alkalinity can be used as constraints. I quickly did a charge balance calculation with a few of your samples and I am seeing slightly different results from your calculations. The charge imbalance error from my quick calculation did not match the value in your row 1 sample calculation. However, my calculations for the row 19 and row 20 samples did match with your charge imbalance error result. This leads me to believe something is missing (such as a HCO3- constraint) and you haven’t recalculated your analytes for the first group of samples after changing the spreadsheet. To recalculate right click on the charge imbalance column header and select ‘Recalculate Analyte’. Again, is it possible you had HCO3- values entered previously on your old spreadsheet? Maybe the values were accidentally deleted? Did you switch from a different thermo dataset from when you reopened the spreadsheet? The thermo_phreeqc.tdat dataset uses carbonate (CO3--) as a basis species instead of bicarbonate (HCO3-). If you did not allow the substitution of CO3-- for HCO3- when you switched thermo datasets then it will delete the HCO3- component’s column. That could also explain why you can’t find HCO3- in the list of basis entries. With regards to pH, the new GSS spreadsheet defaults to include pH as one of the analytes when a new spreadsheet is created. If it’s already in your spreadsheet, you won’t be able to add it again. Perhaps you hid the analyte? Under the Data menu, you have the option to hide and show analytes or samples. Please try check your spreadsheet according to the suggestions above. If you need further assistance, please attach your script. Best, Jia Wang Aqueous Solutions LLC
  18. Brian Farrell

    ChemPlugin Time Marching Loop

    Hi Erik, If you were writing a simple model that considered only advective transport of a non-reacting solute, you might figure the limiting time step from only the Courant condition. And if the velocity didn’t change with time, you could hard-code that value into your time marching loop. When you construct a reactive transport model that accounts for a variety of other processes, though, such as diffusion, heat transfer, and kinetic reactions, you need to account for the stability of the solution to each of their governing equations. ChemPlugin’s ReportTimeStep() member function in fact does this. The X1t and X2t programs use similar logic, which is described in section 2.20 Time marching in the GWB Reactive Transport Modeling Guide. In your program, it might be ok to set your own time step without querying ChemPlugin, as long as it’s smaller than the largest possible time step that ChemPlugin would allow. But really, you should always have ChemPlugin instances report the stable time step. You can compare with your own desired time step, if you’d like, then use the lowest of the values. Based on a previous conversation, it sounds like you might be worried that kinetic reactions are making the simulation take too long. Simply ignoring the reported stability limits would be a bad idea. Instead, you should consider whether you really need so many kinetic reactions, especially really, really fast kinetic reactions. Use kinetics for the more slowly reacting minerals, and equilibrium for the others. Regards, Brian Farrell Aqueous Solutions
  19. I have a question about time stepping in ChemPlugin. The example scripts provided on the Chemplugin website use the "c.reportTimeStep" command but my script contains time-dependent conditional statements within a WHILE loop. In order to have better control over the time step, "deltat" is set to a fixed integer. As I understand it, the c.reportTimeStep command will use time step criteria established for an instance (i.e. "delxi," "step increase," etc..) to determine an appropriate step. However, based on the explanation of the courant number in the user guide: "The Courant condition requires that a time step not exceed the time required to displace all the fluid from a ChemPlugin instance" Following this rule as a guide, is it appropriate to define a time step as a fixed integer (i.e. 4000 seconds)? while True: deltat = 4000 if current_time >= acid_start and current_time < close_time gw_link.FlowRate(0, "m3/s") gw_link.Transmissivity(0, "m3/s") acid_link.FlowRate(discharge, "m3/s") acid_link.Transmissivity(trans, "m3/s") for c in cp: deltat = (deltat) for c in cp: if c.AdvanceTimeStep(deltat):end_run(0) for c in cp: if c.AdvanceTransport():end_run(-1) for c in cp: if c.AdvanceChemical():end_run(-1) Regards, Erik
  20. Koitoliver

    Something wrong with my GSS

    Also I just noticed that when I create a new spreadsheet I am missing add pH option in the Add Analyte menu.
  21. Hello everyone! There is something wrong with my GSS software. The problem start after I transferred my student client to a new pc. When I opened spreadsheets that i had made in my old pc, at first there was no HCO3- ionic species present in the add analyte selection of the new software. I do not remember If I made a new one or not. Starting from that moment i started getting anomalous behavior from the soft when calculating HCO3- from entered carb hardness values, faulty CBE calculations etc. In the attached image one can see that the software identifies some of the carb hardness values (upper half) and attributes them to calculate HCO3- concentrations and CBEs. But for the lower half of the data, the soft seems not to be able to identify the entered values for some reason. Also all the calculated CBEs seem not to match with the ones calculated manually. And for the lower half of the data, the CBEs indicate missing carbonate data.
  22. Ella Holme

    Activation Transfer

    Thank you!
  23. Jia Wang

    Activation Transfer

    Dear Ella, We have reset your license in our system. You can activate using your original activation code. Best, Jia Wang Aqueous Solutions LLC
  24. Hello, I need to transfer my GWB Student activation to my new desktop, but no longer have access to the old one. I have seen posts that say it is possible to transfer activation without deactivating the old license, can someone please help with this? Thank you, Ella
  25. Earlier
  26. Hi Jeonghwan Hwang Aqueous species, such as the free H+ or OH- ions, must have positive concentrations. Thermodynamic components (the original basis that you see in the text output file), however, can have negative concentrations. For a discussion, please see section 3.2.2 Components with negative masses in Craig Bethke’s Geochemical and Biogeochemical Reaction Modeling text. FYI, the pH is listed at the top of the block of output for each step in the calculation. Keep in mind that the theory of chemical equilibrium does not include any information about time. You’ve set up an equilibrium model, so the time span you’ve set is meaningless. If you set time-dependent processes, such as a rate of simple reactant addition, an internal heat source, a dual porosity model with diffusion into a stagnant zone, or a kinetic rate law, however, the time span will actually have meaning and be used in the calculation. I’m not sure how important it is to your calculation, but if you want to consider how a mineral like montmorillonite dissolves with time, you need to set a kinetic rate law. You might be able to find kinetic rate laws and parameters in the literature, but you should be careful to ensure that they are appropriate for the system you’re modeling. For more information, please see Chapter 16 Kinetics of dissolution and precipitation in the GBRM text, as well as Chapter 4 Kinetic Reaction Paths in the GWB Reaction Modeling Guide. Hope this helps, Brian Farrell Aqueous Solutions
  27. Brian Farrell

    Geothermometryt

    You can start with a delta plot showing all the species in the fluid, then one-by-one hide the species with the largest concentration changes that aren’t due to H+ transfer. For example, the concentration of CaCl+ decreases more than anything else, and the free Ca++ and Cl- ions increase almost stoichiometrically. It's clear there's no H+ transfer involved, so right-click on the curve corresponding to each species and select "Hide this variable". After a few more similar steps, you’ll see that the species we’ve highlighted have the largest change in concentration and thus best explain the pH change in our chemical model. I’m glad to hear you figured out how to overlay the plots outside our software. For anyone else reading, there are a couple different options for using MS Office products to superimpose results from separate calculations together. One method is to export the numerical values from your plots into Excel (Edit > Copy As > Spreadsheet), then plot them together there. A second method is to copy each plot as an enhanced metafile (Edit > Copy As > Enhanced Metafile) into its own slide in PowerPoint. You should make sure that the axis range spans the entire data range of interest (in your case, from 0-12 mg/kg), so that the two plots fit together correctly. Next, ungroup each image, then copy one of the curves and paste it into the other slide. For more information, please see the “How do I retrieve numerical data from my plots?” and “How do I overlay my diagrams?” slideshows in the Using GWB section of https://www.gwb.com/tutorials.php. Regards, Brian
  1. Load more activity
×