Jump to content
Geochemist's Workbench Support Forum

Mineral dissolution not converging

Recommended Posts


I'm having difficulty with a simple mineral dissolution model and was hoping to get some advice. Attached is the REACT file. As you can see, I've set up a solution of essentially pure water (all concentrations of ions are very low) in which I'm trying to dissolve a few minerals, as entered under Reactants. The model runs fine when 'reactant times' is set to 0.015 or 0.008, but it crashes at 0.01. It says, Newton-Raphson didn't converge after 999 iterations, max residual = 0.706, Xi = 0.0000 -- Didn't wake up, abandoning path.

I'm trying to understand what the problem is and why the model works with sligthly larger and smaller mineral amounts but not with the amount that I need. Do you see any obvious problems?

As a second step, I would like to add gases to this model. Specifically CO2 with fugacity 0.1 and O2 with 0.9 (this is for a model of a hypothetical exoplanet ocean). However, it keeps generating this error: Residuals too large, 731-th interation, Largest residual(s):

                      Resid     Resid/Totmol   Cbasis
 Cl-                   0.02433   1.279e+200   1.903e-202

See second attached file. This fails even for the model where 'reactant times' is set to 0.008, which previously worked in the absence of gas.

Again, what is the problem here? Is it related to the previous issue? 


Thanks for any advice!



Orthopyroxene.rea Orthopyroxene_gas.rea

Link to comment
Share on other sites

Hello Eva, 

The software works by iteratively solving numerical schemes to arrive at a solution and sometimes, certain variables can be better optimized to allow the software to achieve convergence. The default values are chosen to optimize computational effort and results for more scenarios. With your initial script (one without the gas fugacities), I was able to get your script to converge when I decreased your maximum step size, basically making the reaction progress take smaller steps. The default maximum step size is 0.01 and when I decreased it to half (0.005) and your script ran without issues. For controlling the step size in the GWB programs, see 6.22, delxi, in the GWB Command Reference. Alternatively, you can instead set a smaller initial step (dx_init) step, since the simulation has issues early on, but then return to regular steps later. 

Typically, the charge balancing ion is selected based on the highest uncertainty and concentration in your system. In this case, the initial fluid is very dilute and with the gas fugacities swapped in, the program is not able to solve for the initial equilibrium state while trying to maintain charge balance. When I turned off charge balancing your script ran without problems.

In general, I suggest troubleshooting your scripts by doing a "go initial" run. This will test if your script will convergence on its initial composition without the complication of the reactants. In your input file with gases, the program was not able to speciate your initial fluid, so that was a helpful starting point. 

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.

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.


  • Create New...