Jump to content
Geochemist's Workbench Support Forum

Recommended Posts

I thought I had posted this question yesterday, but it seems to be lost. Anyway, I have been trying to model cation exchange in X1t without having to build a dll library in C++. Instead, I was wondering if this could be done with a simple basic script. Again, I am following the approach of Park et al. (2009), and have added the "pseudo-minerals" Na2EX2 and CaEX2 to the thermo-tdat data base. I also wrote basic scripts (example for Na2EX2 rate law) to see if X1t will evaluate them. However, I can't seem to coax X1t to recognize the "pseudo-minerals". Do I absolutely need to instead write a C++ code and compile it as per Park et al (2009) to get this to work?

Na2EX2_Rate.bas.pdf Kinetic Ion Exchange.pdf Park et al._script.pdf

Link to post
Share on other sites

Hello Karen,

I think you can use the basic script files but I am not sure why X1t is not able to recognize the pseudo-minerals without seeing your database. Perhaps the thermo dataset is not properly loaded? This paper was published before kinetic sorption was integrated into GWB and thus the use of the pseudo minerals for ion exchange surfaces. Starting with Release 9, the GWB has added capabilities to incorporate surface complexation and sorption as a kinetic reaction using the species available in the surface dataset loaded. You can load the ion exchange dataset by going to "File" --> Open --> Sorbing surfaces. Once loaded, you can go to the Reactants pane and add in Kinetic sorbed species. You can set the rate law using the basic file in the screenshot you provided. This way, there wouldn't be a need to add the pseudo minerals for the exchange surfaces. For more information on kinetic complexation and sorption, please see section 4.4 in the GWB Reaction Modeling User Guide. 

Best regards,
Jia Wang

 

Link to post
Share on other sites
  • 2 weeks later...

Hi Jia,

I have made pseudo minerals before (e.g., "arsenogoethite" in a paper I published in GCA at the end of 2019), so I was perplexed by the modified thermo.tdat database not seeing it when I tried to run X1t. I like to work from scripts and less so from the GUI, but maybe I'll try this approach you outline above. I wasn't making a surface dataset, because I was following the approach of Park et al. (2009) to add the pseudo minerals Na2EX2 and CaEX2 directly to the thermo.tdat file. I need to be able to "turn on" the cation exchange reaction for only a portion of the flow path because it appears to only begin to become important after about 26 km of flow. This is also why I was following the script of Park et al. Eventually, when I have the model running and doing a good job of simulating the major ion chemistry along the flow path, my final addition to the model will be for simulating the fate and transport along the flow path of a set of trace elements. I have already built the FeOH_trace element.sdat surface database for that. I have done this (make SCM surface databases) before for arsenic species, tungsten, organic matter, and so forth. 

At the moment I am trying to compile C++ dll files, but haven't had any luck. I used to be able to do these things without any problem when I was just using a clunky old Dell PC clone. Something about using Parallels and compiling C++ codes is truly perplexing to me. I should be able to do this as all my other PC compatible software, including GWB, runs fine on my Mac using Parallels. If I can solve this issue, then I am hoping my question above will be answered once and for all. I had a similar issue when I was running microbial respiration for Fe(III) oxides with GWB. I could compile the C++ code on my Dell, but could never get it to work in my Mac using Parallels.

Thanks,

Karen

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...