possibly bug in viscosity calculation in TOUGH3_EWASG
Dear developers,
First of all, I would like to say thank you for developing this excellent codes.
Here I am reporting a tiny bug I found in viscosity calculation in TOUGH3 EWASG, as I could not find any relevant report in other posts. I'd be sorry if here is not right place to report a bug, or the issue is already solved.
When I set IE(3)=0 and IE(4)=6 (Driesner 2007), TOUGH3 calculated viscosity values are very small (order of 1E-5) while fluid is in liquid phase and expected value is order of 1E-4.
After quickly checking the code, I found that fluid density (DW0) is probably not correctly updated before calculating water viscosity if IE(4)=6. I guess the density variable remains its initial value of zero and this causes the low viscosity.
Kind regards,
Norihiro
6 replies
-
Hi Norihiro,
Thanks for reporting the potential bug. I am very interested in investigating this problem. If you can provide your input files, it will be a great help.
Kenny
-
Hi Norihiro,
You are absolutely correct. The problem is caused by not updating the DW0 for the case IE(4)=6.
This problem can be fixed by insert following two lines into (bold lines) the subroutine COBRI in file thrmb.f90 (at around line 290):
IF(IE(4).EQ.6) THEN
CALL DRIESNER(TX,PX,XS,DB,HB)
PL=MAX(PX,PSATW)
CALL COWAT(TX,PL,DW0,UB)
RETURN
ENDIFThanks for your contributions making TOUGH more robust.
Kenny