Jump to content
Geochemist's Workbench Support Forum

compiled rate law hack


Recommended Posts

Hello,

This is perhaps slightly evil but I'm curious if it will work. Say I want compile a custom rate law for pyrite and I want to keep track of two different types of pyrite with different surface areas. So I define a rate law with various parameters and the instance of the class is sent to the library. I can't really keep node by node variables stored between library calls. Can I use the variables in that reactant class to store things? Could I ignore the intended purpose of the, for example, order1 double to store the fraction of high surface area pyrite? Would this break anything? I think I would have to update the variable at the beginning of each time step to account for the changes in the previous time step, correct?

Perhaps this could be done in a simpler way, but I'm not sure it could. Defining two different pyrites in the thermo database and having kinetic laws for each doesn't really work. Two minerals with matching compositions reacting leads to convergence issues even if they are kinetically defined. Having the library store things in a file would be complicated by the parallel function calls.

Thanks,

Peter

Link to comment
Share on other sites

Hello Peter,

There is theoretically nothing stopping you from overwriting a memory location. However, 'Order1', for example, is defined reactant by reactant in the Reactant class. Based on your description, it appears that you would want to use a member from the Reactant_status class instead of reactants. A member in the Reactant_status class is reported at every nodal block.

Hope this helps,
Jia Wang
Aqueous Solutions LLC

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