Simulation hydrogen combustion rate

This is the content of a burning school course work.

In the hydrogen combustion process, there are concentrations of the three ingredients of concern:

  • Oxygen (representing reactant)
  • Hydrogen atom (representing intermediates, determines the rate of reaction)
  • Water (product)

According to the analysis of each elementary reaction steps, it can be drawn: the overall rate of reaction, the reaction by the slowest step
\ [H + O_2 \ to OH
+ O \] is determined, and therefore concentration of hydrogen atoms is crucial. Considering the proliferation and termination of a hydrogen atom, can list a linear ordinary differential equations characterizing hydrogen atom concentration change:
\ [\ FRAC {\ mathrm C_H} {D} {\ mathrm {D} \} = W_H of tau + fc_H-gc_H \]
wherein \ (W_H \) characterized the initial rate of formation of a hydrogen atom, \ (F \) represents the proliferative effects, and \ (G \) characterized destruction effect.

Analysis of the hydrogen atom concentration

The present formulation problems as follows: a known \ (\ omega_H = 0.01 \) , \ (F =. 3 \) .

  1. Are seeking \ (g = 2.9, 3, 3.1 \) when, \ (C_H \) versus time curve.
  2. \ (F =. 3 \) , and \ (t <30 \) when, \ (2.9 G = \) ; \ (T \ geq30 \) when, \ (G = 0.1 (50-C_H) \) . Seeking \ (C_H \) versus time curve.

Here the two parts into one, the total \ (4 \) curves plotted on the same figure.

solution

It recommended the most simple numerical Euler method to solve the problem of ordinary differential equations class. Here easiest intend to approach this kind of optimization : combining Euler method and backward Euler method to form a prediction - correction formula . For a general first-order linear boundary value problems for
\ [\ begin {cases} y
'(x) = f (x, y) \\ y (x_0) = y_0 \ end {cases} \] are listed as follows iteration:
\ [\ Cases the begin {P_i} = y_i + F (x_i, y_i) \ CDOT \ \\ X Y_ of Delta +. 1 {I} = y_i + F (+ X_ {I}. 1, P_i) \ CDOT \ Delta x \ end {cases}
\] where \ (P_i \) corresponds to the Euler method is by \ (y_ {i + 1} \) do predicted in advance, and then substituted into the backward Euler method to avoid hidden solving equations for.

The following steps will follow to solve this problem.

Program source code and Results

import numpy as np
import matplotlib.pyplot as plt

More than the introduction of the necessary libraries and Numpy Matplotlib library.

def init():
    '初始化各基本参数'
    global t, dt, c, w
    t = [0]
    dt = 0.05
    c = [0]
    w = .01

The above initfunction is used to initialize the simulation prior to each variable used in the calculation parameters.

f = 3  # 增殖因子
g_list = [2.9,3,3.1]  # 销毁因子

for num in range(4):
    init()
    for i in range(750):
        t = t + [t[i] + dt]
        if num == 3:
            if t[i] < 30: g = 2.9
            else: g = 0.1 * (50 - c[i])
        else: g = g_list[num]
        p = c[i] + (0.01 + (f - g) * c[i]) * dt
        c = c + [c[i] + (0.01 + (f - g) * p) * dt]
    if num == 3: plt.plot(t, c)
    else: plt.plot(t, c, linewidth=1, linestyle='--')


plt.title('$c_H$ versus $t$')
plt.xlabel('$t$')
plt.ylabel('$c_H$')
plt.legend(['$g=2.9$', '$g=3.0$', '$g=3.1$', '$g=0.1(50-c_H)$'])
plt.show()

png

From the results, when the \ (g = 2.9 \) higher production rate, hydrogen concentration rises exponentially; when \ (g = 3.0 \) when flat proliferation and destruction, with the initial rate of formation of hydrogen is generated only linear ; when \ (g = 3.1 \) destroyed when the rate is higher than the rate of proliferation, almost no change in concentration of hydrogen atoms.

In particular, when the subject variation on destruction factor (2) set forth, the concentration of hydrogen atoms in the \ (G \) occurs at a turning point mutation, close rapidly to \ (0 \) levels. BACKGROUND input scrutiny proposed such laws, the reactants may come from a sudden stop, the reaction temperature, and many other possible dips. Reflects the total package as an intermediate product of the reaction rate, the concentration of hydrogen atoms directly plunged mean the end of the reaction.

Amendments to the law

Careful scrutiny generated from a hydrogen atom, to destroy all proliferation (Although it is on, it can not be destroyed mathematically) process, it can be seen: in the case where there is no continuous supply of reactants, result in the final bulk hydrogen atom not all of the \ (g \) increase in value, but should be \ (f \) decreased value - further said that the reactants is exhausted, leading to \ (f \) from \ (3 \) is quickly fell \ (1 \) around - flat and consumption, becomes unbranched chain reaction.

In order to simulate \ (f \) values decline, consider the following two rules:

  1. \ (F \) values \ (10 \) from the second (3 \) \ linearly decreases to \ (0 \) ;
  2. \ (F \) values \ (\ tau = \ frac { 20} {\ mathrm {e}} \) of the time constant of the exponential decrease tends to \ (0 \) . (The constant is derived from the attempt, refer to the following results)

The following both procedures were simulated. The first is the linear decline:

g = 1 # 销毁因子固定为 1

# 线性下降规律
init()
for i in range(1000):
    t = t + [t[i] + dt]
    if t[i] <= 10: f = 3 - .3 * t[i]
    else: f = 0
    p = c[i] + (w + (f - g) * c[i]) * dt
    c = c + [c[i] + (w + (f - g) * p) * dt]
plt.plot(t, c)

# 指数下降规律
init()
tau = 20 / np.e
for i in range(1000):
    t = t + [t[i] + dt]
    f = 3 * np.exp(- t[i] / tau)
    p = c[i] + (w + (f-g) * c[i]) * dt
    c = c + [c[i] + (w + (f - g) * p) * dt]
plt.plot(t, c)

plt.title('$c_H$ versus $t$ (with $f$ decreasing)')
plt.xlabel('$t$')
plt.ylabel('$c_H$')
plt.legend(['$f=0.3(10-t)$', '$f=3\exp(-t\cdot\mathrm{e}/20)$'])
plt.show()

png

The results can be seen from the drawing, two carefully taken given law generally produced similar results: the \ (t = \ 10) being less than the time, the hydrogen atom concentration rose quickly, but soon due depletion of the reactants to fall close to \ (0 \) level.

Analysis of product concentration

Intermediate analyzed only above - variation of the concentration of hydrogen atoms. In addition, the product - changes in the concentration of water is also a very important indicator, is worth studying.

According to the analysis of each primitive reactions, the generation rate of water can
\ [\ frac {\ mathrm {
d} c_ {H_2O}} {\ mathrm {d} t} = 2kc_Hc_ {O_2} \] is calculated, where the reaction constant \ (K \) remain unchanged under isothermal conditions; and \ (c_ {O_2} \) is the consumption of one of the reactants, we believe that if an excess of oxygen during the reaction, and the reactants are by an exponential decay - and the last scene when the hydrogen concentration prior to stapling the analysis, it will quickly exponentially decays to a positive number (the remainder of the hydrogen depleted) \ (C_ {O_2, \ RES {text}} \ ) . The following reaction may wish to make this assumption:

  • Concentration of hydrogen atoms in the previous section last \ (F \) by \ (\ tau = 20 / \ mathrm {e} \) results to consider the exponential decay, not included in the interaction between the reactant intermediate ( this effect represents a value enough) with the same decay law;
  • The oxygen concentration in the same decay time constant, the initial value is set \ (10 \) , end value \ (5 \) ;
  • Constant \ (2k = K \) is set to \ (0.002 \) .

Next, according to the above assumptions analog - this simulation can calculate an overall variation of product concentration, no specific numerical reference value.

# 部分参数直接用上面已有的结果

c_w = [0]
for i in range(1000):
    c_o = 5 + 5 * np.exp(-t[i] / tau)
    c_w = c_w + [c_w[i] + .002 * c[i] * c_o]

plt.title('Concentration of water over time')
plt.xlabel('$t$')
plt.ylabel('$c_{H_2O}$')
plt.plot(t, c_w)
plt.show()

png

It can be seen in this assumption, the concentration of water presents "turn fast from slow - stable generation - from fast to slow turn - stop generating" growth rate variation, which is consistent with our expectations. Described above may be previously assumed that changes in the concentration of hydrogen atoms is reasonable, the reaction conditions should match under certain circumstances - only the specific details that need correction and improvement.

Guess you like

Origin www.cnblogs.com/xjtu-blacksmith/p/hydrogen-combustion.html