HP2 running so slow

The HP1 code incorporates modules simulating
(1) transient water flow in variably-saturated media,
(2) transport of multiple components, and
(3) mixed equilibrium/kinetic geochemical reactions.
Post Reply
ahmet19
Posts: 5
Joined: Sun Nov 03, 2019 11:35 am
Location: USA

HP2 running so slow

Post by ahmet19 » Tue Dec 03, 2019 5:35 am

Hi,

I trying to model a reactive transport of uranium bioreduction. I wrote bioreactions and their rate laws under the RATES and KINETICS keywords but it is running so slow, and simulations don't proceed after a certain time and just freeze middle of the run. Is there any reason that causes to slows the run and prevent terminating the simulation? I tried to increase the step size and decrease the mesh size but it didn't work. The simulation was fast at the beginning and super slow after a while.

Thanks,

Ahmet

diederik
Posts: 57
Joined: Fri Mar 10, 2006 7:57 am
Location: Belgium

Re: HP2 running so slow

Post by diederik » Tue Dec 03, 2019 3:35 pm

Hi,

one possibility is that your system / rate equations become stiff. Sometimes this can be solved by using the cvode option in the KINETIC data block.
Did you test the rate equations for relevant geochemical conditions in batch mode (phreeqc) or 1D? this might give more insight in the stability of solving the rate equations for your particular problem

Diederik

ahmet19
Posts: 5
Joined: Sun Nov 03, 2019 11:35 am
Location: USA

Re: HP2 running so slow

Post by ahmet19 » Sat Dec 07, 2019 4:40 am

I tried cvode but it is still slow and it doesn't converge after some point.
Also, I tried in HP1 but it is still the same. I am using the Monod type equation for uranium bioreduction and cell growth. I think I should try to modify the step_divide to find a value that runs fast and converge.
By the way, the Phreeqc script that I used in Hydrus doesn't work in Phreeqc GUI. OK keep increasing but the simulation doesn't proceed. The screenshot of the window is below.
run-window.PNG
run-window.PNG (6.34 KiB) Viewed 191 times

diederik
Posts: 57
Joined: Fri Mar 10, 2006 7:57 am
Location: Belgium

Re: HP2 running so slow

Post by diederik » Sat Dec 07, 2019 7:06 am

Can you send the phreeqc script?

diederik

ahmet19
Posts: 5
Joined: Sun Nov 03, 2019 11:35 am
Location: USA

Re: HP2 running so slow

Post by ahmet19 » Sat Dec 07, 2019 9:43 am

Here is the script.

KNOBS
-iterations 450
-convergence_tolerance 1e-08
-tolerance 1e-18
-step_size 10
-pe_step_size 5
-diagonal_scale true

SOLUTION_MASTER_SPECIES

Ethoxide HEthoxide 0.0 46.0605 46.0605 #HEthoxide=Ethanol

SOLUTION_SPECIES
H2O + 0.01e- = H2O-0.01 #for convergence
log_k -9.0

HEthoxide = HEthoxide
log_k 0.0

HEthoxide=Ethoxide- + H+ # F Caldin, B. E., & Long, G. (1954).
log_k -15.5

SURFACE_SPECIES

Hfo_wOH + UO2(CO3)2-2 = Hfo_wOHUO2(CO3)2-2
log_k 5.0
-no_check
-mole_balance Hfo_wOHUO2(CO3)2

SOLUTION 0
temp 25
pH 7.933
pe 4
redox pe
units mol/kgw
density 1
Br 1.22e-06
Ethoxide 0.15
Cl 0.000586
Fe(3) 0.000133
N(5) 0.00119
S(-2) 1.26e-07
S(6) 0.00148
U(6) 1.25e-06
Alkalinity 3.854e-03
Ca 1.41E-03
K 4.79E-05
Mg 1.76E-03
Na 2.84E-03

-water 1 # kg

SOLUTION 1-10
temp 25
pH 7.933
pe 4
redox pe
units mol/kgw
density 1
Br 1e-19
Ethoxide 1e-19
Cl 0.000586
Fe(3) 0.000133
N(5) 0.00119
S(-2) 1.26e-07
S(6) 0.00148
U(6) 1.25e-06
Alkalinity 3.854e-03
Ca 1.41E-03
K 4.79E-05
Mg 1.76E-03
Na 2.84E-03

-water 1 # kg


SURFACE 1-10

-equilibrate with solution 1

Hfo_w 0.018975

-no_edl

END

RATES
u_reduction
# -formula UO2(CO3)2-2 -1 HEthoxide -0.167 H2O -0.833 HCO3- 2.33 H+ 0.33
-start
9 if (TOT("U")< 5e-10 and TOT("Ethoxide")=0.141) then goto 32
10 qm=0.5 #mol/day
11 stoi=0.167 #ethanol stoichiometric coefficient
12 Ks_etoh= 8.683e-07 #half saturation for ethanol
13 Ks_U= 5.000e-04 #half saturation for UO2+2
20 f1= TOT("Ethoxide")/(Ks_etoh + TOT("Ethoxide"))
21 f2= (TOT("U(6)")-(MOL("CaUO2(CO3)3-2") + MOL("Ca2UO2(CO3)3") + MOL("MgUO2(CO3)3-2")))/(Ks_U + TOT("U(6)")-(MOL("CaUO2(CO3)3-2") + MOL("Ca2UO2(CO3)3") + MOL("MgUO2(CO3)3-2"))) #bioavailable U
30 rate = qm*stoi*f1*f2*(1-EXP(-0.510665* KIN("CELL"))) #dUO2+2/dt = (1-exp(-p*X)*qm*X*S(C_etoh/(Ks_etoh+C_etoh)*(bioavailable_U/(Ks_U+bioavailable_U) # p is lag coefficient
31 moles = rate * TIME
32 SAVE moles
40 PUT(rate, 1)
41 PUT(moles, 2)
42 PUT(qm, 3)
-end

CELL #cell growth
-start
9 if (TOT("U")< 5e-10 and TOT("Ethoxide")=0.141) then goto 90
15 moles = -GET(3) * TIME *M
90 SAVE moles
91 PUT(rate1, 21)
92 PUT(rate, 22)
93 PUT(moles, 23)
-end
KINETICS 1-10
u_reduction
-formula UO2(CO3)2-2 -1 HEthoxide -0.167 H2O -0.833 HCO3- 2.33 H+ 0.33
-tol 1e-008
CELL
-formula H 0
-m0 0.00051 #initial cell mass
-tol 1e-008

INCREMENTAL_REACTIONS true

TRANSPORT
-cells 10
-shifts 807.4752986
-time_step 1802.848684
-lengths 10*0.01496
-dispersivities 10*0.1
-print_cells 10
-print_frequency 1000
-punch_cells 10
-punch_frequency 10

END

diederik
Posts: 57
Joined: Fri Mar 10, 2006 7:57 am
Location: Belgium

Re: HP2 running so slow

Post by diederik » Sat Dec 07, 2019 10:26 am

what is database that you use?

ahmet19
Posts: 5
Joined: Sun Nov 03, 2019 11:35 am
Location: USA

Re: HP2 running so slow

Post by ahmet19 » Sat Dec 07, 2019 8:15 pm

I used phreeqcU.dat with adding Ca and Mg uranyl species.

#calcium uranyl carbonates

1.000Ca+2 + 1.000UO2+2 + 3.000CO3-2 = CaUO2(CO3)3-2
#-llnl_gamma 4.7
log_k 27.180 #06DON/BRO, 2014 THO/HUM
# delta_h 0.000 #kJ/mol
# Enthalpy of formation: #kJ/mol
-analytic 2.718E+1 0E+0 0E+0 0E+0 0E+0


2.000Ca+2 + 1.000UO2+2 + 3.000CO3-2 = Ca2UO2(CO3)3
#-llnl_gamma 3.4
log_k 30.700 #06DON/BRO 2014 THO/HUM LOGK=29.22
# delta_h 0.000 #kJ/mol
# Enthalpy of formation: #kJ/mol
-analytic 3.07E+1 0E+0 0E+0 0E+0 0E+0

#magnesium uranyl carbonates

UO2+2 + Mg+2 + 3CO3-2 = MgUO2(CO3)3-2
log_k 26.11 # Dong and Brooks, 2006

Post Reply