I recently posted that most engineers don't need to know numerical methods for solving ODEs and PDEs, but I must share this discussion with the few that might be interested. The hopscotch method is an easy to program and very accurate and efficient numerical method for solving parabolic PDE equations. This method was introduced by Gordon (1965) and expanded by Gourlay (1970), but I haven't seen it mentioned frequently. If you want to build a program for a tubular reactor model, the hopscotch method is probably the best available.
The Hopscotch Numerical Game
The method can be classified as semi-implicit because it alternates between explicit steps and implicit steps as the computations proceed forward in either the flow direction for a steady-state model, or in the time direction for a dynamic model.
A checker board may be used to describe the method for the steady-state model. From the inlet row with all state variables known at each square, explicit steps are taken, originating from the black squares. Then implicit steps are taken originating from the red squares in the inlet row. The previous values obtained from the explicit steps are used to calculate the second order derivatives and the nonlinear reaction terms for the implicit equations.
For successive steps to a new row, the explicit steps always originate first from black squares, followed by implicit steps from red squares. In a program, the rows and radial positions are odd or even. By using the row and radial number, the "color" of the initiating square can be determined.
Unlike implicit methods, there is no need to solve a system of linear equations at each row. Each of the unknowns at the implicit nodes are computed explicitly from a single equation for each unknown.
Compare to orthogonal collocation
Finlayson (1980) simulated a tubular, non-adiabatic fixed bed reactor using orthogonal collocation. The steadystate model assumed the reaction rate was a function of the bulk fluid composition and temperature.
The example parameters
The parameters below were those used in Finlayson's second example for the above model.
The hopscotch results
The results below were obtained using the hopscotch method with 11 radial points and 500 axial points. The first two plots use the average temperature and conversion across the reactor radius.
The above curves are almost identical to those in Figure 5-10 of Finlayson that were determined with N=6 collocation points.
The plot below shows the radial temperature profiles at different axial positions. The corresponding plot by Finlayson is Figure 5-11(a).
The hopscotch results again compare very well with the collocation results. The main exception is for the profile at Z=0.5. At that location, the collocation result does not satisfy the center-line boundary condition of a zero slope, whereas the hopscotch method does satisfy the condition.
We may conclude that the hopscotch method was capable of correctly computing results with very steep slopes.
The hopscotch example took 0.36 seconds to solve using an Intel(R) Core(TM) i5 processor (2 x 2.67 GHz) and Mathcad. The collocation example took 4 seconds on a CDC 6400 computer in 1980 using FORTRAN. It would be nice to compare the execution times on one computer and with one language. However, the hopscotch integration method is so simple and produces such good results, that I haven't been inclined to tackle the collocation method.
In my book, I have extended the hopscotch method to include the particle energy balance and to operate with multiple reactions and species. The computation speed is still very fast. The tubular reactor with two reactions and six species computes in less than one second. This allowed me to call the model repeatedly in a catalyst deactivation model.
I have also used the hopscotch method to simulate the dynamics of a tubular reactor. The particle energy balance was included in that model also.
Finlayson, B.A., Nonlinear Analysis in Chemical Eng., p. 192-206, McGraw-Hill (1980)
Gordon, P., "Nonsymmetric Difference Equations," SIAM J.,
13, p. 667 (1965)
Gourlay, A.R., "Hopscotch: A Fast Second Order Partial Differential Equation Solver," J. Inst. Maths. Appl, 6, pp 375-390 (1970)