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