Setting up initial water chemistry


I am trying to set up a TOUGHREACT model of reactive transport during upwelling of CO2 and salt, starting by emulating the chemistry presented by Zhang et al., 2016 (attached). The code reads in my flow and solute input information, but crashes when trying to read in the chemical.inp file. It gets stuck at the initial and boundary waters section, as is shown in the attached chemical input and output files.

Can someone please help me get the code to run? I don't quite understand what the difference between the "guess" and "tot" concentration columns in the initial water chemistry section should be. How do I find appropriate numbers to put in that won't cause the error that I'm getting? Any help would be greatly appreciated.

Thank you in advance,


7replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • Hey Mike,

    Could you send all of the input files (flow.inp, solute.inp, chemical.inp, thermodynamic database), so I can give it a go on my machine?

    • Mikey,

      Thanks for offering to help. The attached zip folder contains all of the input files. By the way, I am running it with treactv332omp_eco2n_pc.exe.


    • Woops, it didn't like the zip folder. Sorry about that. Here are the additional input files (beyond the chemical input that I sent earlier). I had to change them to .txt format for the forum to not automatically convert them to .zip

  • Check that your chemical.inp file is free of invisible special characters.  When I try to open it, it shows the Cl charge and some of  the "+" characters in the exponent fields as "?" and I get a message about non AINSI characters.  These appear about where where input crashes.  

    About the "guess" values, these are trial values needed to initialize Newton Raphson iterations.  They affect convergence (and more so if far from the solution), but not the solution of the chemistry equations (i.e., they do not affect the results if the NR iterations converge).   Typically, using the same values as the CTOT's or one order of magnitude smaller works well, however for species like Al+3 and Fe+3 at circum-neutral pH and above, it is best to make these values much smaller (I typically make them 10 orders of magnitude smaller) than the CTOT's, because their concentration is very small (essentially nil) as Al and Fe hydroxides largely dominate.  

    Like 1
  • Nic,

    Thank you for your help, but unfortunately I am still having trouble.

    All the negative signs within the initial and boundary waters section appeared to be non-ASCII symbols, so I replaced them with regular negative signs and tried again to run the simulation. This time it read in the entire table of initial aqueous concentrations, but then crashed immediately afterward, saying "error in number of primary species in zone=1". I don't understand why it says this, because the 11 lines that it read in for this section list the exact same 11 species that were listed above when I first defined the aqueous species.

    Do you have another suggestion on how to get the code to run? I have attached the updated chemical.inp and chemical.out files.

    Thank you in advance for your continued assistance,


      • Nic
      • Nic
      • 2 yrs ago
      • Reported - view

      Michael Plampin 

      Hi Mike, in the water composition block, there is a typo, change mg+1 to mg+2, and it should work.  Cheers   - Nic

    •  Nic,

      That worked! Thank you so much!


Like Follow
  • 2 yrs agoLast active
  • 7Replies
  • 111Views
  • 3 Following