Jump to content
Geochemist's Workbench Support Forum

Recommended Posts

Posted

I am trying to use the rate law attached in GWB react. I tried to define a custom rate law and wrote a script. However, calculated rate is not correct and does not change through time. I would be happy if you could help me with this. The script I wrote is below. Here is the publication I used for rate law https://pubs.usgs.gov/of/2004/1068/ . I would also be happy if you could let me know if there is any way to put three different k and E values without defining a custom rate law.

Thank you!

image.png.dd145da60d7edbb03c27efe68d5be10c.png

LET kacid = 5.012 * 10^(-1)   * 10^(-4)
LET kneut = 1.549 * 10^(-6)  * 10^(-4)
LET kbase = 3.311 * 10^(-4)  * 10^(-4)
LET Eacid = 14.4    * 10^(3)
LET Eneut = 23.5   * 10^(3)
LET Ebase = 35.4   * 10^(3)
LET nacid = 1
LET nbase = 1
LET m1 = 1
LET m2 = 1
LET m3 = 1

x = kacid * EXP ((-Eacid / 8.314) * ((1/TK)-(1/298.15))) * (activity("H+")^(nacid)) * (1-(QoverK)^(m1))^(m1) 
y = kneut * EXP ((-Eneut / 8.314) * ((1/TK)-(1/298.15))) * (1-(QoverK)^(m2))^(m2) 
z = kbase * EXP ((-Ebase / 8.314) * ((1/TK)-(1/298.15))) * (activity("H+")^(nbase)) * (1-(QoverK)^(m3))^(m3)
rate = surface * (x + y + z)
 

Posted

Hello Ozan,

I think the problem with your script is that you don’t have a return statement at the end. Can you try again with the statement

“RETURN rate “

at the bottom? For more examples, please refer to section 5.2 Rate law scripts in the Reaction Modeling Guide. If you would like for someone to take a closer look at the issue, please attach your model input file and the basic script file.

If you want to prescribe different k and E values in the same rate law, then you would need to implement a custom rate law. The built in format will only allow one value of each.

Hope this helps,

Jia Wang

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...