PhreeqcUsers Discussion Forum

Registrations currently disabled due to excessive spam. Please email phreeqcusers at gmail.com to request an account.
Welcome Guest
 

  • Forum Home
  • Login
  • Register

  • PhreeqcUsers Discussion Forum »
  • Processes »
  • Dissolution and precipitation »
  • Maximum iterations exceeded
« previous next »
  • Print
Pages: [1]   Go Down

Author Topic: Maximum iterations exceeded  (Read 2575 times)

weiwei han

  • Guest
Maximum iterations exceeded
« on: 06/09/21 13:15 »
Hello everyone:
I have a problem with my simulation. When I simulate the reaction of MgO with NH4H2PO4, I add 10 mol MgO to 5mol/(kg H2O) NH4H2PO4 solution in 1000 steps. However, PHREEQC just stop suddenly, and the errors tab just says that:"Maximum iterations exceeded,200...". I do not kown why. Thank you in advance if you have a solution for my problem.
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4030
Re: Maximum iterations exceeded
« Reply #1 on: 06/09/21 15:59 »
You are running up against the limitations of PHREEQC. The program is not completely stable at such high concentrations. The "WARNING" messages indicate numerical problems, but the program will continue and, if the run completes, the results should be correct. If the numerical method fails, there will be an "ERROR" message, and the results are not correct.

The only suggestion I have is to use INCREMENTAL_REACTIONS true when adding the MgO REACTION. This keyword causes the solution to be saved at each increment and then used as the starting point for the next increment. Starting with a solution that is closer to the final solution composition makes the calculation easier than the default, which is to start at the initial solution and add the entire increment, so that the last step starts with the initial solution and adds 10 mol of MgO.

The following worked with phreeqc.dat, but you should attach large uncertainties to solutions that are this concentrated.

Code: [Select]
SOLUTION 1
end
USE solution 1
REACTION
NH4H2PO4 1
5 moles
SAVE solution 1
END
INCREMENTAL_REACTIONS
USE solution 1
REACTION
MgO 1
10 mol in 10
END
Logged

MichaelZ20

  • Top Contributor
  • Posts: 162
Re: Maximum iterations exceeded
« Reply #2 on: 07/09/21 17:01 »
"5mol/(kg H2O) NH4H2PO4 solution" - this is high above NH4H2PO4 solubility (https://en.wikipedia.org/wiki/Ammonium_dihydrogen_phosphate)
Logged

weiwei han

  • Guest
Re: Maximum iterations exceeded
« Reply #3 on: 08/09/21 14:18 »
Thank you, sir,
I have reduced the amount of NH4H2PO4 to 3 mol/(kg H2O) and again conducted the simuation according to your suggestion. There was an error in the last steps of the reaction, and I poste a screenshot of the simulation error.

I want to know how I can solve this problem.I thank you for your time and your support.
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4030
Re: Maximum iterations exceeded
« Reply #4 on: 08/09/21 15:04 »
Again, you are at the limits of the program in terms of concentrations. However, attach your input file (and database if it is not one distributed with PHREEQC) and I will look at your calculation.
Logged

weiwei han

  • Guest
Re: Maximum iterations exceeded
« Reply #5 on: 09/09/21 03:50 »

Thank you Dr Parkhurst f or your help, and I attach my input file and database, I really apreciate for your help!
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4030
Re: Maximum iterations exceeded
« Reply #6 on: 09/09/21 04:15 »
I need to know which database you used.

In general, you only need to define items in SOLUTION_MASTER_SPECIES and SOLUTION_SPECIES data blocks of the input file if they are absent or need to be changed from values in the database.


Logged

weiwei han

  • Guest
Re: Maximum iterations exceeded
« Reply #7 on: 09/09/21 07:12 »
Deat Dr Parkhurst:
Thermodynamic data for ion species are from Thermoddem, and I used Pitzer model to simulate the phase assemblage of manesium ammounium phosphate cement(MAPC). Thermodynamic data for phases come from published papers.

Best Regards,
Weiwei
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4030
Re: Maximum iterations exceeded
« Reply #8 on: 09/09/21 09:57 »
I'm sorry, I do not know how you ran your file. If I use phreeqc.dat, pitzer.dat, or a version of Thermoddem.dat that I have, I get errors in the definitions of SOLUTION_SPECIES or PHASES. I was able to run the file using a database named CEMDATA18 (an ion-association model, not Pitzer), but it ran to completion with this database generating MgO and MgNH4PO4:6H2O. I cannot reproduce your errors unless I have a copy of the database that you used.

I am also confused that you say you used the Pitzer model. To use the Pitzer approach, you must define interaction parameters among the species with a PITZER data block, but your input file does not have this data block. Any interaction parameters (PITZER data block) would need to be in your database file for this to be a Pitzer-type calculation. (Note the Thermoddem database that I have is an ion-association model rather than a Pitzer model.)
Logged

  • Print
Pages: [1]   Go Up
« previous next »
  • PhreeqcUsers Discussion Forum »
  • Processes »
  • Dissolution and precipitation »
  • Maximum iterations exceeded
 

  • SMF 2.0.19 | SMF © 2021, Simple Machines | Terms and Policies
  • XHTML
  • RSS
  • WAP2