Jump to content
Geochemist's Workbench Support Forum

Implementing Frumkin model in GWB


Recommended Posts

Hello there,

I want to study the effect of surface coverage on adsorption. How can I implement Frumkin model for this purpose?
Frumkin model is defined like this: 
Frumkin equation, the concentration ratio (apparent constant) K defined by the mass-action law is formulated as
K = K0 exp{−rθ/(RT )} ,

where K0 is the “intrinsic” equilibrium constant, θ is the surface coverage, and r is the lateral interaction constant. If the sign of r is positive, Eq. (1) describes that the mass-action relation K decreases exponentially with increasing surface coverage θ ; that is, there is suppression of adsorption with increasing ion loading. In contrast, with decreasing surface coverage, the exponential term approaches 1, and the mass-action relation K becomes equal to K0, a constant.

Link to comment
Share on other sites

Hello Aditya,

The GWB supports many sorption models but the Frumpkin model is not amongst them. The software does not accept variables for surface coverage or lateral interaction constant for surface reactions. Are these variables in the Frumpkin model constant values? If so, you can calculate K using the equation and use that value for reactions directly in your surface datasets.

Hope this helps,
Jia Wang
Aqueous Solutions LLC

Link to comment
Share on other sites

Hey Jia,
Thanks for the response. No, those variables change as the sorption increases. Is there a way I can use some python plugins to iterate over this process and approximate Frumkin Model. 

Few more doubts:
1. If I want to run a simulation in x1T for 5 years and after that add another reactant to it and run for 5 more years how can I do that?
2. I have set HCO3- as charge balance species and I want to fix the CO2 content in system around 4200 pa, how can I do that?
3. While using x1t how can we provide impulse inputs in reactants tab without adding reactant as kinetic species.
4. Please also let me know any alternatives of pickup command function for x1t.


Thanks and Regards,
Aditya 

Link to comment
Share on other sites

  • 2 weeks later...

Hello,

No, the software does not have the Frumpkin model variables implemented such that the Log K changes according to these variables The equilibrium constants for various reactions are drawn from the surface datasets and can't be altered during the run.

About question 1, there are no ways to add new reactants in a middle of a simulation. If you are looking for things like setting a kinetic rate to start after a certain time has passed in the simulation, you can do that with a custom script file. If that doesn't help, could you please provide more detail about what you are trying to do? Please see chapter 5. Custom Rate laws for more information on that. In particular, table 5.1 and 5.2 contain all the variables accepted by the program.

With regards to question 2, I think this is very similar to one your previous post. The important question here is how you would like your CO2 partial pressure to affect the aqueous system. You can specify the partial pressure of CO2(g) in equilibrium with your system by swapping it into a related component. Typically, that would be swapped in either for HCO3- to constrain the components' concentration or can be swapped into the system to set the pH. You have to make a choice about what constraint makes the most sense for your system, for example either swapping in CO2(g) for the component HCO3- or you can swap it for H+ to constrain the pH. The program will calculate mass distribution such that various carbonate components are in equilibrium with each other (HCO3-, CO3--, CO2(aq), etc). 

With regards to question 3, are you asking about setting different boundary fluids at different time intervals? You can also view a tutorial for this on the GWB Tutorials page. Please see section 2.10 Reaction intervals. You can add other reactants other than the kinetic type on the Reactants pane by going to the "add" button -> select the type of reactant you want...

The pickup command is not available in the reactive transport modeling apps. You can plot the data and export the numeric data to set your Basis pane in a new run using the node-by-node feature. I think you are on the right track with this post you found.

Hope this helps,
Jia

Link to comment
Share on other sites

Thanks for the reply Jia,

Item 1. I want to use surface species after some time has passed in simulation (much better if we can do such that, if some other surface species goes below certain amount. for e.g. use species 1 initially and when the conc. goes below 5mmol use species 2.)

Item 2. Apologies for not making it more clear. Basically we can fix the CO2 fugacity in reactants tab but it fixes the fugacity to atmospheric CO2 (~42pa) how can we change that.

It would be very helpful if you could provide a example file for x1t using GWBplugin. I can retrieve results from react app using GWBplugin but not from x1t.
Following is my python code which doesn't yield any output.

# import GWBplugin class
from GWBplugin import *

# create the plug-in object
myGWBrun = GWBplugin()

# start the GWB program
if myGWBrun.initialize("x1t","","-nocd"):
    
    print("Beginning run.")
    
    cmds = ['data = thermo no resin.tdat verify',
"conductivity = conductivity-USGS.dat",
"interval start at 0 day, fluid = fluid_1",
"time end at 10 day",
"length = 10 cm",
"discharge start = 1 cm/hr",
"scope = initial",
"   H2O          = 1 free kg",
"   Na+          = .05 mmol",
"   balance on Cl-",
"   pH           = 7",
"scope = fluid_1",
"   H2O          = 1 free kg",
"   Na+          = .05 mmol",
"   balance on Cl-",
"   pH           = 7",
"scope",
"react .05 mmol of HCl",


    ]
    for cmd in cmds:
        myGWBrun.exec_cmd(cmd)
    
    print("Finished run.\n")
    

    #retrieve results
    pH = myGWBrun.results("pH","",3)[0]
    print(pH)

    

Link to comment
Share on other sites

Hello,

I still am not quite sure what you are trying to do. You can't introduce surface species in the middle of simulation.

When you fix a fugacity in the Reactants pane, it keeps the same fugacity that is set in your initial system throughout the simulation. If you had set the fugacity in the Basis or had provided all the needed components for the software to calculate the fugacity (e.g. pH, HCO3-) in equilibrium with the fluid, then that's the fugacity the program fixes to. You can't choose a different value to fix at the onset or change it during your run. If you want to end your simulation at a different fugacity, you can use a sliding path instead. See section 3.6 Sliding activity and fugacity of the GWB Reaction Modeling Guide to learn more.

I believe you have everything you need to write your own script from the examples installed and using the instructions in the Reference Manual and Command Guide. I can see a few problems with your script.

First, you are not calling the same variable for retrieving the results. You had initialized myGWBrun at the top so you need to call the same thing at the end when retrieving results.

In all the examples given in the guide, you can see that the command "go" is included at the end of the cmd list to trigger the script to run. Otherwise, you are not actually running the simulation and therefore you get no results.

Please review section 7.3.3 Retrieving the results of the GWB Reference Manual, which describes what each argument stands for. If you are running an X1t script, the argument in the spot for the y-node position is ignored.

A couple of useful tips. You can have the Plug-in print out a text output and Xtplot plot file for your run. This will be helpful for troubleshooting, especially as you are learning how to use the Plug-in. Note that you should specify the thermo dataset and any surface dataset for the run when initializing the object. If you like, you can also set up Python to read in an X1t file instead of configuring the commands individually in the Python script. See explanation on how to configure these in section 7.3.1 Initializing the GWB application in the GWB Reference Manual.

Hope this helps,
Jia

Link to comment
Share on other sites

Posted (edited)

Thanks for all the help Jia , I was able to run GWB plugin successfully. But I realize that I cannot get results at specific time steps. So I am implementing ChemPlugin.

Item 1 :

I have successfully implemented  ChemPlugin and I can get the results. But I am not able to produce the gtplot from the code. I couldn't find any thing for plotting results of reactive transport, I am using following code for that purpose:

for c in cp:
    c.PlotHeader("RTm06.gtp")
    c.PlotBlock()
 
while True:
    deltat = 1e99
    for c in cp:
        deltat = min(deltat, c.ReportTimeStep())
    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)
 
    for c in cp:
        c.PlotBlock()
 
 

If I run the file "RTm06.gtp" produced from code it says file is not in correct format. Please tell me how I can get a gtplot for reactive transport.
 

Item 2:

As I was trying to implement the frumkin model following code serves my purpose but results are same as kd approach. Can you please point out the error here and how I can resolve it.
Here for each new time step first I am calculating the concentration of a species, then I am calculating new logk value and then configuring that value to each chemplugin instance.

Please tell me what is wrong here and how I can implement the same.

import math
while True:
    deltat = 1e99
    for c in cp:
        deltat = min(deltat, c.ReportTimeStep())
    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)
 
    for c in range(20,30😞
        conc = 0
        conc += cp[c].Report("concentration surf_species", "mmol")[2]
    print(conc)
    a = 6.947 * 10**-5 * math.exp(-6.164 * (conc/40))
    for c in cp:
        c.Config("alter >(s)FeOAg logK = {a}")
 
 
 
Edited by Aditya-Puru
New doubts.
Link to comment
Share on other sites

Hello,

Thank you for providing the update on your script. The program accepts most of its configuration command prior to the time marching loop. Only some variables can be updated after initialization by sending the Config() command with a new value. These variables are "adjust_rate", "inert", and "adjust_mass" (Appendix: Configuration Commands chapter in the ChemPlugin User Guide). Some variables, like kinetic rate constants, are transient field variables, which can be set to be evaluated and updated during the simulation. The Log K for reactions cannot be updated with Config() after initialization and it is not a field transient variable.

Best regards,
Jia

Link to comment
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...