Jump to content
Geochemist's Workbench Support Forum

Running GWB from a program


Dino

Recommended Posts

I want to be able to carry forward values that are calculated from the output of React forward to the next iteration of React.  For example, I would like to calculate the depth of material dissolved in one iteration of React forward to the next iteration.  This is essentially calculating the diffusion of an element from the solid where the solid surface is retreating.  Is there a way to carry values forward in a script and use them in the next iteration of React?  Or, do I need to run React as a subrouting within an external C++ or fortran program?

Denis 

Link to comment
Share on other sites

Hello Denis,

I think you would be interested in trying the Pick up feature in React. Using this feature, you can conveniently use the results of a simulation as a starting point for a new calculation or as a new set of reactants. You can choose to pick up entire system (fluid + minerals) or just the fluid as a new starting point. You can set this configuration in React by going to Run --> Pick up --> System --> Entire or Fluid, or you can use the command pane.  Please see section 3.10 in the GWB Reaction Modeling User Guide for more details and examples.

Hope this helps,
Jia Wang

Link to comment
Share on other sites

Thanks, Jia

I hadn't thought of the pick-up option.  There are a few parameters that I need to carry forward from one simulation to the next.  These are the ending time, the mass of material dissolved, and one or two similar parameters.  The ending time is needed so that I can vary the length of time of the simulation.  If the reactions have high rates, I'll need to decrease the length of time of the next simulation; if the reactions are slow, I can increase the simulation time.  Are these parameters available through the pick-up file.  I've used the pick-up option more to obtain a solution after some initial reactions, but I have not tried to harvest information to be used in a script that iterates React and changes the input parameters as needed.

Thanks for you help.  I really appreciate your and Brian's knowledge and help.  BTW, please say 'hi' to Brian.

Denis

Link to comment
Share on other sites

Hello Denis,

Thank you for the greeting! I'll make sure Brian knows. The pickup system command will retain the end time of the simulation, if you had set one, and uses that as the start time for the new simulation. For example, if your previous simulation had started at 0 and ended at 10 days and you used the pick up command to set the fluid composition in the basis pane (i.e. Pick up --> System --> Entire or Fluid), then React will set the start time at 10 days and end time at 20 days for the new simulation. Youcan adjust the length of the new simulation in the basis pane or command pane as needed. In this case, the kinetic reactions and rate laws you designated previously should also be carried over to the new simulation but not other reactants. There's an example for chaining kinetic simulations in section 4.8 of the GWB Reaction Modeling User Guide and that might might be a good start for you. 

FYI, if you pick up the results as a new set of Reactants (e.g. Pick up --> Reactants--> Entire), the basis pane will be reset and you will need to add in the system's initial composition and start and end time for the simulation..

Hope this helps,
Jia Wang

Link to comment
Share on other sites

Jia,

Thanks again for the help.  I think this should work well.  We will still have to do some calculations within the script, but those should be possible by accessing the information passed to the next iteration of React.  Now down to the work at hand.  I'll let you know how it comes out.

Denis

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