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
»
Reactive transport modelling
»
PHREEQCRM error
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: PHREEQCRM error (Read 4978 times)
Yongqiang
Top Contributor
Posts: 131
PHREEQCRM error
«
on:
12/04/23 08:44 »
Hi Phreeqc experts,
I am compiling Phreeqcrm to simulate reactive transport. However, I used a simple solution composition with only Na and Cl. It popped out a strange error as the following:
ERROR: Oxygen Mass of oxygen has not converged. Residual: 0.000000e+00
Any comments for this error?
Thanks,
Michael
Logged
dlparkhurst
Global Moderator
Posts: 4211
Re: PHREEQCRM error
«
Reply #1 on:
12/04/23 15:35 »
Hard to say what is wrong.
Possibly you are using a very large volume of water for a cell. PHREEQC works best if the volumes are between 0.01 and 10 liters of water.
Another possibility is that your transport solution is not accurate enough for H and O.
PHREEQC will work better if you use charge balanced solutions.
Logged
Yongqiang
Top Contributor
Posts: 131
Re: PHREEQCRM error
«
Reply #2 on:
13/04/23 04:21 »
Hi David,
Thanks for the instruction. I'll double check my code.
By the way, I carefully checked the case in the Tests folder distributed with the PHREEQCRM. I found that it seems that the variable *volume* and *sat_calc* were create through (double *) malloc((size_t) (nxyz * sizeof(double))); in the void advection_c() function. However, it seems they are not freed at the end of this function. Please see the file advection_c.c
Thanks,
Michael
Logged
dlparkhurst
Global Moderator
Posts: 4211
Re: PHREEQCRM error
«
Reply #3 on:
13/04/23 15:02 »
Yes, you are correct, the arrays should be freed. I'll make the change for the next version.
However, we are working on some enhancements for PhreeqcRM, and I think it is unlikely we will update the C version. There are just too many wrappers to write and documentation to update. If you want to use the new features, you will have to use C++, Fortran, or Python. There really is no advantage to C because it only wraps C++; you might as well use C++ and avoid the mistakes like the one I made not freeing an array.
Logged
Yongqiang
Top Contributor
Posts: 131
Re: PHREEQCRM error
«
Reply #4 on:
14/04/23 01:54 »
Thank you, David.
I used C because C is my first programming language learned in Uni. I'll transfer the C++ for my next version. By the way, you mentioned Python version. Do you mean to run PHREEQCRM with Python or IPHREEQC?
Regards,
Michael
Logged
dlparkhurst
Global Moderator
Posts: 4211
Re: PHREEQCRM error
«
Reply #5 on:
14/04/23 15:37 »
We are working on Python bindings for PhreeqcRM. Not sure whether we will do IPhreeqc or not.
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
PhreeqcUsers Discussion Forum
»
Processes
»
Reactive transport modelling
»
PHREEQCRM error