Conceptual Models > Design of conceptual models

Methanogenic bacteria and Methane formation

(1/2) > >>

stfmtu:
Dear all,

I am trying to generate biomass that should be linked with methane formation, but the biomass doesn't appear in the plot. When I attempt to change the number of days from 10 to 100, it seems that after the 10th day, I only get constant values for all the plotted data. Could someone explain what I am doing wrong?
As my model was partially adapted from this forum, I would also like to ask why, in the kinetics of methane formation, only hydrogen is mentioned and there's no mention of other elements such as oxygen, water, or methane itself.

SOLUTION_MASTER_SPECIES
   Biomass       Biomass          0     Biomass         1
SOLUTION_SPECIES

Biomass = Biomass
   -gamma 3
   log_k 0
   

RATES
    Methane_formation
-start
10 if (m < 0) then goto 70
20 rate = 2.3e-09*(TOT("C(4)")/1e-3 + 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
   40 dB = rate * time
   50 save -dB
-end
End
 
SOLUTION 1
    temp      37
    pH        7 charge
    pe        4
    redox     pe
    units     ppm
    density   1
    -water    1 # kg
END

GAS_PHASE 1
    -fixed_pressure
    -pressure 100
    -volume 1
    -temperature 37
    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       1
    -tol      1e-08
   
Biomass
   -formula       H 0.0
   -m              1.36e-4
   -parms          0.89 5.78E-7   
   
   
-steps       864000 in 100 steps # seconds; 100 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
    -headings               time TDIC CH4(aq) Hdg(aq)  Biomass CO2(g) Hdg(g) CH4(g)
    -axis_titles            "Days" "Mole concentration" "Pressure gas phase [atm]"
    -axis_scale y_axis      1e-6 2 auto auto log
    -initial_solutions      false
    -connect_simulations    true
    -plot_concentration_vs  x
  -start
10 GRAPH_X TOTAL_TIME / 86400
30 GRAPH_Y TOT("C(4)"), TOT("C(-4)"), TOT("Hdg"), TOT("Biomass")
40 GRAPH_SY GAS("CO2(g)"), GAS("Hdg(g)"), GAS("CH4(g)")
  -end
    -active                 true
   
 Thank you!

dlparkhurst:
The -formula for biomass is H 0, which is fine. There will be no change in the solution composition from this reaction. However, it implies that the moles of kinetic reactant Biomass is the quantity representing the biomass. As such, a positive value for the SAVE quantity will decrease the biomass, and a negative value for the SAVE quantity will
--- Code: ---increase
--- End code ---
biomass. Therefore the growth rate should be negative and the death rate should be positive. Sorry, maybe it should be the other way, but that is the way it is; it makes more sense if the reaction were dissolving a mineral, where concentrations in solution increase with positive rates.

By converting Hdg to H2, you are adding reductant to the solution. Electron acceptors will be used in the sequence determined by thermodynamics. This is generally the way you expect redox reactions to proceed. In simple terms, O2 will be consumed then NO3- then SO4-2, and finally C(4) will be reduced. If you don't have any other electron acceptors, then you will only see methanogenesis.


--- Code: ---RATES
    Methane_formation
-start
10 if (m < 0) then goto 70
20 rate = 2.3e-09*(TOT("C(4)")/1e-3 + 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      37
    pH        7 charge
    pe        4
    redox     pe
    units     ppm
    density   1
    -water    1 # kg
END

GAS_PHASE 1
    -fixed_pressure
    -pressure 100
    -volume 1
    -temperature 37
    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       1
    -tol      1e-08
   
Biomass
   -formula       H 0.0
   -m              1.36e-4
   -parms          0.89 5.78E-7   
   
   
-steps       864000 in 100 steps # seconds; 100 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
    -headings               time TDIC CH4(aq) Hdg(aq)  Biomass CO2(g) Hdg(g) CH4(g)
    -axis_titles            "Days" "Mole concentration" "Pressure gas phase [atm]"
    -axis_scale y_axis      1e-6 2 auto auto log
    -initial_solutions      false
    -connect_simulations    true
    -plot_concentration_vs  x
  -start
10 GRAPH_X TOTAL_TIME / 86400
30 GRAPH_Y TOT("C(4)"), TOT("C(-4)"), TOT("Hdg"), KIN("Biomass")
40 GRAPH_SY GAS("CO2(g)"), GAS("Hdg(g)"), GAS("CH4(g)")
  -end
    -active                 true

--- End code ---

stfmtu:
The following code is based on the recommendations given. Would you be so kind as to take a look at why the HDG has a negative value and results in an error?

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 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       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

dlparkhurst:
The sign of moles in SAVE moles in the methane_formation rate is positive. The coefficient of Hdg in KINETICS is negative. The combination is trying to remove Hdg from solution, but there is no Hdg to be removed. The rate calculation cannot procede because no matter what time step is used, it will make a negative concentration of Hdg.

stfmtu:
Hello,

I have tried changing the sign of moles or the one for Hdg, but neither way works. I have also tried modifying the KINETICS formula to: H2 -4 CO2 -1 CH4 1 H2O 2, but still no results. My code should consume the available hydrogen and produce methane and a biomass that will decay the moment hydrogen or carbon dioxide is not available.

Any help on identifying my mistakes would be greatly appreciated.

Navigation

[0] Message Index

[#] Next page

Go to full version