Click here to donate to keep PhreeqcUsers open
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
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 301 times)
Yongqiang
Top Contributor
Posts: 93
PHREEQCRM error
«
on:
April 12, 2023, 08:44:56 AM »
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
Top Contributor
Posts: 3174
Re: PHREEQCRM error
«
Reply #1 on:
April 12, 2023, 03:35:40 PM »
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: 93
Re: PHREEQCRM error
«
Reply #2 on:
April 13, 2023, 04:21:32 AM »
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
Top Contributor
Posts: 3174
Re: PHREEQCRM error
«
Reply #3 on:
April 13, 2023, 03:02:13 PM »
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: 93
Re: PHREEQCRM error
«
Reply #4 on:
April 14, 2023, 01:54:28 AM »
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
Top Contributor
Posts: 3174
Re: PHREEQCRM error
«
Reply #5 on:
April 14, 2023, 03:37:00 PM »
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