Conceptual Models > Design of conceptual models
Methanogenic bacteria and Methane formation
dlparkhurst:
Sorry, I was wrong in my previous comment. There is a source of Hdg in the GAS_PHASE. So, the reaction can proceed. However, it only proceeds until the point that Hdg is completely consumed, at which time, the reaction can go no farther without generating negative Hdg concentrations.
I added an inhibitor factor for Hdg in the methane rate equation. Also, the Hdg is consumed in about 4 days, after which the biomass decays for the remaining time of the simulation. I ran for 40 days.
You may need to consider your GAS_PHASE definition. You have defined 1 L of volume at 45 C. PHREEQC calculates the amount of each gas component roughly with the ideal gas law (although Peng-Robinson for phreeqc.dat), for example P(Hdg)*1 = 160 = n*R*318. When the reaction occurs the gases dissolve and reequilibrate with a gas phase with volume such that the volume is adjusted until the sum of the partial pressures of the gas components is 100 atm.As the Hdg is consumed, the gas phase shrinks. Alternatives include using a larger volume of gas by which the moles of Hdg and CO2 in the initial gas are calculated, or specifying a partial pressure of Hdg (and or CO2) with EQUILIBRIUM_PHASES.
--- Code: ---RATES
Methane_formation
-start
10 if (m < 0) then goto 70
20 rate = 1.643e-5*TOT("C(4)")/(1.094e-7 + TOT("C(4)"))*TOT("Hdg")/(1e-10 + TOT("Hdg"))
30 moles = rate * TIME
40 if (moles > m) then moles = m
50 SAVE moles
60 put(rate,1)
70 END
-end
Biomass
-start
1 Y = parm(1)
2 d = parm(2)
10 rate_M = get(1)
20 B = kin("Biomass")
30 rate = -Y*rate_M + d*B # negative rate increases M (biomass)
# positive rate (d*B) decreases M (biomass)
40 dB = rate * time
50 save dB
-end
End
SOLUTION 1
temp 45 #optimal 45degC, max 122degC, min 10degC
pH 7.7 charge #optimal 7.7, max 10.2, min 4.1
pe 4
redox pe
units ppm
density 1
-water 1 # kg
END
GAS_PHASE 1
-fixed_pressure
-pressure 100
-volume 1
-temperature 45 #optimal 45degC, max 122degC, min 10degC
CH4(g) 0
CO2(g) 40
Hdg(g) 160 #In Phreeqc Database is Hdg
END
INCREMENTAL_REACTIONS true
KINETICS 1
Methane_formation
-formula H2 1 Hdg -1
-m0 6.118 #all available moles of Hdg --> see phr.out file in the beginning when reaction starts
-tol 1e-08
Biomass
-formula CH1.8O0.5N0.2 0.0
-m 1.36e-4
-parms 0.03 8.565e-7 # Methanogeic bacteria: Y=0.03, d=8.565e-07
#-steps 8640000 in 100 steps # seconds; 100 Tage
#-steps 86400000 in 100 steps # seconds; 1000 Tage
#-steps 1728000 in 100 steps # seconds; 20 Tage
-steps 3456000 in 100 #34560000 in 100 steps # seconds; 400 Tage
-step_divide 1
-runge_kutta 3
-bad_step_max 500
END
USE solution 1
USE kinetics 1
USE gas_phase 1
USER_GRAPH 1
-chart_title "Gaseous components during methanogenesis"
-headings CO2(g) CH4(g) Hdg(g)
-axis_titles "Days" "Pressure gas phase [atm]"
-axis_scale y_axis auto auto #log
#-axis_scale x_axis 0 400
-initial_solutions false
-connect_simulations true
-plot_concentration_vs x
-start
10 PLOT_XY TOTAL_TIME/86400, GAS("CO2(g)"), color=Black,symbol=Square,symbol_size=0,y_axis=1,line_width=3
20 PLOT_XY TOTAL_TIME/86400, GAS("CH4(g)"),color=Orange,symbol=Triangle,symbol_size=0,y_axis=1,line_width=3
30 PLOT_XY TOTAL_TIME/86400, GAS("Hdg(g)"), color=Blue,symbol=Diamond,symbol_size=0,y_axis=1,line_width=3
-end
-active true
USER_GRAPH 2
-chart_title "Aqueous species during methanogenesis"
-headings CO2(aq) CH4(aq) Hdg(aq) Biomass(aq)
-axis_titles "Days" "Mole concentration of aqu. species" "Moles of Biomass in aqu. phase"
-axis_scale y_axis auto auto #log
-axis_scale sy_axis auto auto #log
#-axis_scale x_axis 0 400
-initial_solutions false
-connect_simulations true
-plot_concentration_vs x
-start
10 PLOT_XY TOTAL_TIME/86400, TOT("C(4)"), color=Black,symbol=Square,symbol_size=0,y_axis=1,line_width=3
20 PLOT_XY TOTAL_TIME/86400, TOT("C(-4)"),color=Orange,symbol=Triangle,symbol_size=0,y_axis=1,line_width=3
30 PLOT_XY TOTAL_TIME/86400, TOT("Hdg"), color=Blue,symbol=Diamond,symbol_size=0,y_axis=1,line_width=3
40 PLOT_XY TOTAL_TIME/86400, KIN("Biomass"), color=Green,symbol=Circle,symbol_size=6,y_axis=2,line_width=1
-end
-active true
USER_GRAPH 3
-chart_title "Total Moles in the System"
-headings CO2 CH4 Hdg
-axis_titles "Days" "Moles" "Moles"
-axis_scale y_axis auto auto #log
-axis_scale sy_axis auto auto #log
#-axis_scale x_axis 0 400
-initial_solutions false
-connect_simulations true
-plot_concentration_vs x
-start
10 PLOT_XY TOTAL_TIME/86400, TOTMOLE("C(4)")+GAS("CO2(g)"), color=Black,symbol=Square,symbol_size=0,y_axis=1,line_width=3
20 PLOT_XY TOTAL_TIME/86400, TOT("C(-4)")+GAS("CH4(g)"),color=Orange,symbol=Triangle,symbol_size=0,y_axis=2,line_width=3
30 PLOT_XY TOTAL_TIME/86400, TOT("Hdg")+GAS("Hdg(g)"), color=Blue,symbol=Diamond,symbol_size=0,y_axis=1,line_width=3
-end
-active true
--- End code ---
stfmtu:
Dear dlparkhurst,
Thank you for the advice. It seems that when I change the volume of the gas phase, the simulation runs until the desired number of days. However, the only issue is that the biomass does not decrease once the hdg and CO2 are consumed. It stagnates at the same value. What can I do in this situation?
I have also tried to add Equilibrium_Phases, but it seems it did not do anything for me. I am most likely doing something wrong. Could you possibly show the right way as reference for my code to consume CO2 and Hdg (or H2) and produce CH4?
Thank you.
dlparkhurst:
Biomass decreases in the code I provided. You must have done something differently. You will have to provide your script, or better yet, look at the output file and figure out what you have done.
stfmtu:
Dear Mr. David,
Thank you for your advice. Yes, I have readjusted the data, and now it is working properly. I also managed to achieve good results without the Hdg inhibitor. However, the issue is that even though the biomass has a decreasing rate, it does not decrease once the hydrogen and CO2 are no longer consumed. Could you please have a look?
Thank you!
RATES
Methane_formation
-start
10 if (m < 0) then goto 70
20 rate = 1.643e-5*TOT("C(4)")/(1.094e-7 + TOT("C(4)"))
30 moles = rate * TIME
40 if (moles > m) then moles = m
50 SAVE moles
60 put(rate,1)
70 END
-end
Biomass
-start
1 Y = parm(1)
2 d = parm(2)
10 rate_M = get(1)
20 B = kin("Biomass")
30 rate = -Y*rate_M + d*B # negative rate increases M (biomass)
# positive rate (d*B) decreases M (biomass)
40 dB = rate * time
50 save dB
-end
End
SOLUTION 1
temp 45 #optimal 45degC, max 122degC, min 10degC
pH 7.7 charge #optimal 7.7, max 10.2, min 4.1
pe 4
redox pe
# units ppm
density 1
-water 1 # kg
END
GAS_PHASE 1
-fixed_pressure
-pressure 250
-volume 8.5
-temperature 45 #optimal 45degC, max 122degC, min 10degC
CH4(g) 0
CO2(g) 62.5
Hdg(g) 187.5 #In Phreeqc Database is Hdg
END
INCREMENTAL_REACTIONS true
KINETICS 1
Methane_formation
-formula H2 1 Hdg -1
-m0 6.000e+01 #all available moles of Hdg --> see phr.out file in the beginning when reaction starts
-tol 1e-08
Biomass
-formula CH1.8O0.5N0.2 0.0
-m 1.36e-4
-parms 0.03 8.565e-7 # Methanogeic bacteria: Y=0.03, d=8.565e-07
#-steps 17280000 in 100 steps # seconds; 200 Tage
#-steps 86400000 in 100 steps # seconds; 1000 Tage
#-steps 1728000 in 100 steps # seconds; 20 Tage
-steps 4320000 in 100 steps # seconds; 50 Tage
-step_divide 1
-runge_kutta 3
-bad_step_max 500
END
USE solution 1
USE kinetics 1
USE gas_phase 1
USER_GRAPH 1
-chart_title "Gaseous components during methanogenesis"
-headings CO2(g) CH4(g) Hdg(g)
-axis_titles "Days" "Pressure gas phase [atm]"
-axis_scale y_axis auto auto #log
# -axis_scale x_axis 0 400
-initial_solutions false
-connect_simulations true
-plot_concentration_vs x
-start
10 PLOT_XY TOTAL_TIME/86400, GAS("CO2(g)"), color=Black,symbol=Square,symbol_size=0,y_axis=1,line_width=3
20 PLOT_XY TOTAL_TIME/86400, GAS("CH4(g)"),color=Orange,symbol=Triangle,symbol_size=0,y_axis=1,line_width=3
30 PLOT_XY TOTAL_TIME/86400, GAS("Hdg(g)"), color=Blue,symbol=Diamond,symbol_size=0,y_axis=1,line_width=3
-end
-active true
USER_GRAPH 2
-chart_title "Aqueous species during methanogenesis"
-headings CO2(aq) CH4(aq) Hdg(aq) Biomass(aq)
-axis_titles "Days" "Mole concentration of aqu. species" "Moles of Biomass in aqu. phase"
-axis_scale y_axis auto auto #log
-axis_scale sy_axis auto auto #log
# -axis_scale x_axis 0 400
-initial_solutions false
-connect_simulations true
-plot_concentration_vs x
-start
10 PLOT_XY TOTAL_TIME/86400, TOT("C(4)"), color=Black,symbol=Square,symbol_size=0,y_axis=1,line_width=3
20 PLOT_XY TOTAL_TIME/86400, TOT("C(-4)"),color=Orange,symbol=Triangle,symbol_size=0,y_axis=1,line_width=3
30 PLOT_XY TOTAL_TIME/86400, TOT("Hdg"), color=Blue,symbol=Diamond,symbol_size=0,y_axis=1,line_width=3
40 PLOT_XY TOTAL_TIME/86400, KIN("Biomass"), color=Green,symbol=Circle,symbol_size=6,y_axis=2,line_width=1
-end
-active true
USER_GRAPH 3
-chart_title "Total Moles in the System"
-headings CO2 CH4 Hdg
-axis_titles "Days" "Moles" "Moles"
-axis_scale y_axis auto auto #log
-axis_scale sy_axis auto auto #log
#-axis_scale x_axis 0 400
-initial_solutions false
-connect_simulations true
-plot_concentration_vs x
-start
10 PLOT_XY TOTAL_TIME/86400, TOTMOLE("C(4)")+GAS("CO2(g)"), color=Black,symbol=Square,symbol_size=0,y_axis=1,line_width=3
20 PLOT_XY TOTAL_TIME/86400, TOT("C(-4)")+GAS("CH4(g)"),color=Orange,symbol=Triangle,symbol_size=0,y_axis=2,line_width=3
30 PLOT_XY TOTAL_TIME/86400, TOT("Hdg")+GAS("Hdg(g)"), color=Blue,symbol=Diamond,symbol_size=0,y_axis=1,line_width=3
-end
-active true
dlparkhurst:
You can use PRINT statements in the RATES definitions to debug your rate expressions.
In this case, you are using PUT(rate), where rate is positive, even though the SAVEd value is zero. In the biomass rate, the rates reach steady state where growth (based on the PUT value) is balanced by death.
Navigation
[0] Message Index
[*] Previous page
Go to full version