PhreeqcUsers Discussion Forum

Welcome Guest
 

  • Forum Home
  • Login
  • Register

  • PhreeqcUsers Discussion Forum »
  • Processes »
  • Reactive transport modelling »
  • Increasing time step for a reactive transport solver
« previous next »
  • Print
Pages: [1]   Go Down

Author Topic: Increasing time step for a reactive transport solver  (Read 2104 times)

SaiP

  • Frequent Contributor
  • Posts: 19
Increasing time step for a reactive transport solver
« on: 24/01/20 15:19 »
Hi,

I am trying to couple OpenFOAM with phreeqcRM. The test case, I chose is simple Calcite dissolution (thermodynamic) in a 1D column having 50 cells.

For the setup, phreeqc takes 30s to simulate for 1 hour. When I use SNIA (sequential non-iterative) OS for the coupling, I notice the solution matches well with the phreeqc solution at small time step (dt = 0.05s, computation time = 1440s) and as I increase the time step (dt = 0.5s, computation time = 240s) the dissolution front smears and the results are unphysical.

I used Strang's OS in anticipation to speed up the computation by choosing larger time steps. So, I used a time step of dt = 0.5s and for this setup, though the front diffuses, the simulation results are fine unlike when I used SNIA. However, the computation time is 260s which is 9 times more than Phreeqc computation time. Considering, I ran a simulation for 1 hour and would like to investigate cases for 300 years this looks not possible with the current scenario for me.

I noticed several warnings (below) during the run, which are hindering the convergence and thereby increasing the computation time:
“
WARNING: Element Ca is contained in Calcite (which has 0.0 mass),
but is not in solution or other phases.
WARNING: Maximum iterations exceeded, 100
WARNING: Numerical method failed with this set of convergence parameters.
WARNING: Trying smaller step size, pe step size 10, 5 ...
WARNING: Maximum iterations exceeded, 200
WARNING: Numerical method failed with this set of convergence parameters.
WARNING: Trying reduced tolerance 1e-16 ...
“

I attched the post-processed results for the above mentioned cases in detail.

Any advice on how to speed things up (by choosing alternate matrix solvers for the chemistry etc)?

Thanks.
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 3996
Re: Increasing time step for a reactive transport solver
« Reply #1 on: 24/01/20 16:43 »
I don't think any slowness is due to numerical issues in PHREEQC. At least some of those warnings apply to the initial calculation when no Ca is in the system. Simple equilibration with calcite should not require much time, and the fact that PHREEQC TRANSPORT is competitive indicates that the chemistry can be run fast enough to attain a good numerical solution. Rather, my guess is that the time spent in PHREEQC is simply proportional to the number of cell chemistry calculations.

You probably need to determine how much time is spent in transport, communication, and chemistry calculations to really determine the number of calls and the time spent in each part of the calculation. If the problem is really the chemistry calculations, PhreeqcRM has either OpenMP or MPI parallelization, so it should be possible to speed the chemistry calculation by taking advantage of parallelization.

As for numerical dispersion, you can look at texts on numerical analysis. There is an analysis in the appendix of the PHAST manual that estimates numerical dispersion due to time and space discretization for implicit transport calculations, and limits on time and space discretization for explicit transport schemes to avoid oscillations.

Just for comparison, you could set up the same calculation in PHAST to see if calculation times are similar. You could also compare times of single processor versus parallelization too. PHAST will give timings for the different parts of the calculation. (Note that PHAST parallelizes the transport by running multiple elements simultaneously, as well as running chemistry in cells simultaneously.)
Logged

  • Print
Pages: [1]   Go Up
« previous next »
  • PhreeqcUsers Discussion Forum »
  • Processes »
  • Reactive transport modelling »
  • Increasing time step for a reactive transport solver
 

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