Jump to content
Geochemist's Workbench Support Forum

Recommended Posts

Posted

Hi- 

I am trying to ensure that I understand the process occurring with GWB. I have attached a script that I am using. I want to take my initial fluid and react it with minerals commonly found in a komatiite; that would be my weathered solution at the end of this reaction. I would then pick that fluid up and rehydrate it (i.e., react with 950 g of H2O) and then allow for reaction with the komatite and allow for evaporation to occur (e.g., remove 950g of H2O), which would give me a brine solution.  I would continue this wet, dry cycling for 10-15 cycles and see what minerals and the elemental composition in the fluid would be after the reaction. So first, I want to understand if I have this setup right, and then I would like to know if there is a way to set this up in one complete reaction/script instead of having multiple files. I am using React. I have GWB professional.

Cheers,

Jaxon

4_Kom_5PCT_0,05atmCO2_50mgOHAP.txt

Posted

Hello Jaxon,

Thanks for attaching your scripts. Regarding your initial system, it seems like you have some units that include "total". Is that supposed to denote a bulk concentration for that component? The program by default assumes the concentration is set for the bulk component unless "free" is specified. In your case, "total umolal" has the same effect as just "umolal". If you want to set a free quantity, for example for the amount of HPO4-, then you would use:

"HPO4--       = 1 free umolal"
For more information on bulk vs. free quantity, please see section 7.2 Equilibrium models in the GWB Essentials Guide.

I think you can try adding in pickup and go statements to perform the cycles that you described. In your current script, you can add commands like below:
go
pickup fluid
react 950 g H2O
go 
pickup fluid
react [desired minerals and their masses here in separate lines]
go
pickup fluid
react -950 g H2O
go

The "go" statement triggers React to make the calculation. "pickup fluid" takes the fluid at the end of your simulation and sets it as a starting point. Add "react" statements to specify reactants that you want in your new simulation and repeat the cycle. You can try a couple of cycles in React's GUI to see if it is performing the simulations like you desire. Once you are ready, you can create one long script, like your existing file with all the cycles you want to simulate and run the script in React. If you change the file extension from .txt to .rea, it should automatically run when you double-click to open it.

You can also find all the commands accepted by GWB programs in the GWB Command Reference.

Hope this helps,
Jia Wang
Aqueous Solutions LLC

 

  • 5 months later...
Posted

Hi Jia,

I have attached an updated script with wet-dry cycles and a re-hydration step in between weathering and evaporation. The way we have been doing this has been taking the weathering script (EW) run it, then pickup the system fluid, change the H2O back to 1, delete the pH (i.e., pH = ,so that it balances on this and save that file as the re-hydration script. (RH). Next we reopen the EW1 script run it, save the output file as the end of weathering solution (EW1), then take a simple evaporation script which picks up the system fluid, react -950 g H2O fix the fugacity of CO2(g) and H2S(g) and balance on pH. This then gives us the end of evaporation solution (EE1), which we save the output, and that is for 1 wet-dry cycle. Now we take the RH script open it up in a text file, copy the script in to the command window and run it to rehydrate the fluid that is in contact with our original 5% weathering of a rock, then save this output file as RH1. We then open a different text file for the evaporation script (the change from the first evaporation script is a full -1000 g H2O instead of -950 g H2O) and  run this in the command window to get the second wet-dry cycle, save the output as EE2, then re-hydrate, save output, evaporate, save out put....till we get ten wet dry cycles. Now the script I have provided does all of this in on go, but only gives me the last cycle for the data when try to export solution chemistry(element concentrations in fluid and or select aqueous species) it from gtplot as a tab delineated spreadsheet. Now this is quite tedious and if I mess up in any of the cycles I have to start over in the process. So my questions are:

1. Can I save each output file automatically as the wet-dry script runs? I sorta have this figured out but cant get the subsequent cycles to save.

2. Is there a way to extract the data at each evaporation cycle instead of just seeing the final solution. (We are interested in the change in element concentrations at the end of each evaporation cycle).

Essentially I want to make this work more efficiently and be less time consuming, but also since I have a physical disability with limited dexterity in my hands that make it hard to have to constantly copy and paste things as well as constant mouse clicks for many hours of running and saving scripts. So I am curious if there are any steps to be made to make the GWB more inclusive and open to those that are not able-bodied. Currently it is suited for able bodied individuals.

Cheers,

Jaxon

 

1_EW-EE cycles.txt

Posted

Hello Jaxon,

Thank you for attaching your script. Here are some suggestions that I think will help.

1. It sounds like what you want here is the "suffix" command. With the "suffix" command you can save each run with a different string of text appended to filename so new runs do not overwrite the results. For example, "suffix _evap1" would append "_evap1" to the name of the React output text and plot file. You would want to put this before each "go" statement in your script.

2. Using the suffix command, you can save each run result separately and open the plot files to extract the result. If you save a configuration file (should end in .gtc), then you can drag and drop to apply the .gtc file with the same set of x-y variable configurations to different plot files. This can help you from reconfiguring every time in a new plot.

Another option to further automate the retrieval of data is to write your own script in a programming language that calls the GWB plugin to do the calculation. The software provides wrapper classes for C++, Fortran, and Python that handle loading the DLL, binding to the needed functions, and conversion to C data types. You can retrieve specific results from the GWB plugin with the "results" function. Please see the GWB Plugin chapter from the GWB Reference Manual for more details.

Also, please note that setting "pH =  " simply resets the pH to no value. If you want to balance on H+, you should still add the statement "balance on H+". I was having issues running your script as it was written. I also noticed that the first save statement does not have an enclosing double quote for the file path. Additionally, I am not sure that you need two save statements, especially if you are specifying the name of the file. Please see the "save" command in the Command Reference for details.

Hope this helps,
Jia

  • 2 weeks later...
Posted

Hi Jia,

Thanks for explaining things. It is hard to know what some of the commands mean and actually do. I am using GWB10 and want to know if the GWB plugin will work with this old version of GWB. If it does, then it will be great to write a simple python scripts to extract the data more efficiently.

Cheers,

Jaxon

Posted

Hello Jaxon,

You're welcome. In GWB 10, you can find all commands accepted by the GWB applications and information on the Plug-in in the GWB Reference Manual. This is installed with your software and should be in your Gwb folder unless it has been moved.

Hope this helps,
Jia

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...