Numerical Solution of 2d Gray-Scott Model

download Numerical Solution of 2d Gray-Scott Model

of 6

Transcript of Numerical Solution of 2d Gray-Scott Model

  • 7/28/2019 Numerical Solution of 2d Gray-Scott Model

    1/6

    Numerical Solution of the 2D Gray-Scott Model

    J AN M ACH

    Faculty of Nuclear Sciences and Physical Engineering, Czech Technical University in Prague, Czech Republic

    Abstract. This work presents the results of J. M. at the High Performance Systems Department of the CINECA Institute in Bologna, Italy. The main goals of the project - tolearn and apply MPI on parallelizing of our numerical solvers for the Gray-Scott model -

    have been achieved. We demonstrate some of our numerical results and parallel scalingon the CLX Linux cluster in CINECA.

    1. Introduction

    Reaction-diffusion systems are a class of systems of partial differential equationsof parabolic type. It includes mathematical models describing various phenomena inthe fields of physics, biology and chemistry. Gray-Scott model is one of these models. Itwas first introduced in an article by P. Gray and S. K. Scott (see 1). It is a mathematical

    description of an autocatalytic chemical reactionU 2V 3 3V

    V 3 P ;(1)

    where U , V are input reactants and P is product of this reaction.

    2. Problem formulation

    Assume that V (0; L) (0; L) is an open square representing the square reactor where the chemical reaction (1) takes place, @ V is its boundary and is its outer normal.Then initial-boundary value problem for the Gray-Scott model (see 1,3,4) we solve is a

    1 P. Gray and S. K. Scott, Autocatalytic reactions in the isothermal, continuous stirred tank reactor:oscillations and instabilities in the system A 2 B 3 3 B, B 3 C , Chem. Eng. Sci. 39 (1984), pp. 1087-1097.

    2 V. Thome e, Galerkin Finite Element Methods for Parabolic Problems , Springer-Verlag Berlin Heidelberg(1997).

    3 P. Gray and S. K. Scott, Chemical Oscillations and Instabilities , Oxford University Press, Oxford (1990).4 J. Wei, Pattern formation in two-dimensional Gray-Scott model: existence of single-spot solutions and

    their stability , Physica D 148 , pp. 20-48 (2001).

  • 7/28/2019 Numerical Solution of 2d Gray-Scott Model

    2/6

    system of two partial differential equations with initial conditions and zero Neumannboundary conditions

    @ u@ t

    a r 2u uv 2 F (1 u );

    @ v@ t

    br 2v uv 2 ( F k)v in V (0; T );

    u (; 0) u ini ; v(; 0) vini ; in V ;

    @ u@

    j@ V 0;@ v@

    j@ V 0 in @ V (0; T ):

    (2)

    Here u , v are unknown functions representing concentrations of chemical sub-stances U , V . Parameter F denotes the rate at which the chemical substance U isbeing added during the chemical reaction, F k is the rate of V 3 P transformationand a , b are constants characterizing the environment where the chemical reactiontakes place.

    3. Numerical scheme

    We use two numerical schemes to solve initial boundary value problem (2).Both of them are based on the method of lines. We use structured numerical grids.In the first case we used finite difference method (FDM) for spatial discretization

    Let h be mesh size such that hL

    N 1 for some N PN

    . We define numerical gridas a set

    v h ih ; jh j i 1; . . . ; N 2; j 1; . . . ; N 2f g ;v h ih ; jh j i 0; . . . ; N 1; j 0; . . . ; N 1f g :

    For function u : R2 3 R we define a projection on v h as u ij u ih ; jh . We introducefinite differences

    u x 1 ;ij u i 1; j u i ; j

    h; u x 1 ;ij

    u i ; j u i 1; j h

    u x 2 ;ij ui ; j 1 u i ; j

    h; u x 2 ;ij u

    i ; j u i ; j 1h

    ;

    and define approximation D h of the Laplace operator D as follows

    D h u ij u x 1 x 1 ;ij u x 2 x 2 ;ij :

    Then semi-discrete scheme has the following form

    dd t

    u ij (t) a D h u ij F (1 u ij ) u ij v2ij ;

    dd t

    vij (t) bD h vij ( F k)vij u ij v2ij ;

    (3)

    NUMERICAL SOLUTION OF THE 2D GRAY-SCOTT MODEL 809

  • 7/28/2019 Numerical Solution of 2d Gray-Scott Model

    3/6

    plus corresponding initial and boundary conditions. The discretization in time is doneby mean of the method of lines. To solve resulting systems of ordinary differentialequations Runge-Kutta-Merson method (see 6) was used. This is modified Runge-Kutta method with adaptive time stepping. For details on the second numerical scheme we

    use based on finite elements method (FEM) see7

    .

    4. Numerical experiments

    4.1. Parallelization

    Parallel implementation of our numerical algorithms was done using the MPIapproach. This enabled us to perform computations on large grids which we needed for the EOC measurements. The idea of parallelization of our numerical algorithms is to

    decompose the numerical grid v h into row blocks. Computations on these blocks canthen be performed in parallel by different processors. The exchange of data betweenneighboring blocks is done by means of the MPI library to complete each step of theRunge-Kutta algorithm. In Table 1 we can see results of our parallelized solver scalingmeasurements for numerical grid size 600 x 600.

    4.2. EOC measurements

    To determine the order of convergence of our numerical algorithm based on theFDM based semi-discrete scheme (3) we use experimental order of convergence(EOC). For our measurements we used formula

    k v vh2 kk v vh1 k

    h2h1

    a

    ;

    5 J. Wei and M. Winter, Asymmetric spotty patterns for the Gray-Scott model in R 2 , Stud. Appl. Math. 110(2003), no. 1, pp. 63-102.

    6 M. Holodniok, A. Kl c , M. Kub c ek and M. Marek, Methods for analysis of non-linear dynamical models(Metody analy zy nelinea rnch dynamicky ch modelu ), Academia Praha (1986).

    7 J. Mach, Computational study of the Gray-Scott model , submitted to the proceedings of the Slovak- Austrian Mathematical Congress, Podbanske (2007).

    T ABLE 1. Parallelized FDM based solver speedup measurement on the CLX.

    nproc ( P ) Runtime (s) Speedup

    1 904 1.002 489 1.844 258 3.508 146 6.19

    16 89 10.16

    810 JAN MACH

  • 7/28/2019 Numerical Solution of 2d Gray-Scott Model

    4/6

    where v is numerical solution computed on the grid of size 2000 2000 and substitutesthe analytical solution, vh2 , vh1 are numerical solutions computed on coarser grids withmesh sizes h2, h1 and a is the EOC coefficient. See Table 2 for one of measurementsresults.

    The question about the EOC is still open. Our results vary between the values of 1and 2. This diversity may be caused be large spatial gradients of solution which aredifficult to approximate. For more of our measurements see [7]. More research intothis problem is needed including EOC measurement for the FEM based numericalalgorithm.

    T ABLE 2. - Table of EOC coefficients. N x N y h EOC L2 EOC LI

    100 100 0.0101010 150 150 0.0067114 0.8225371 0.5550153200 200 0.0050251 0.9222231 0.7584173250 250 0.0040160 0.9995422 0.9052681300 300 0.0033444 1.0667171 1.0124643350 350 0.0028653 1.1237827 1.0727512400 400 0.0025062 1.1754085 1.1689477

    F IGURE 1. Dependence of numerical solution on numerical scheme and grid size.

    NUMERICAL SOLUTION OF THE 2D GRAY-SCOTT MODEL 811

  • 7/28/2019 Numerical Solution of 2d Gray-Scott Model

    5/6

    4.3. Comparison of numerical schemes

    We performed a series of computations to compare our numerical schemes. Initialspatial distribution of concentrations u ,v of chemicals U ,V was chose such thatu 1 v applies in each point of the domain V . Spatial distribution of chemical V concentration over the domain V is visualized. Lighter color means higher concentra-tion. This holds true for all figures in this section. According to our results the GS modelis very sensitive on the numerical grid size when using FDM based scheme (3).Solutions often differ notably. In the Figure 1 we can see results we get using thesame initial conditions and Gray-Scott model parameter values at one concrete timet 1000. FEM based scheme (see [7]) provides results less dependent on the

    F IGURE 2. Results demonstrating diversity of solutions of the GS model.

    812 JAN MACH

  • 7/28/2019 Numerical Solution of 2d Gray-Scott Model

    6/6

    numerical grid size. With further numerical grid refining numerical solutions are moreand more similar. According to our experience, both methods provide similar resultsfor numerical grids of size 400 400 (for L=0.5) and finer in most cases.

    4.4. Diversity of solutions

    In the Fig. 2 we present some of our numerical results, which demonstrate thediversity of GS model solutions. We can see that patterns are changing fromgeometrically simple ones to those which are much more complex.

    5. Conclusion

    We implemented parallel forms of our numerical algorithms for the Gray-Scottmodel based on FDM and FEM methods. Parallelization of our solvers enabled us tocompute a lot of data in a reasonable amount of time which we used for EOC analysisand exploration of diversity of solution of this model. Further simulations and parallelcode improving are subject of current work.

    Acknowledgements. This work was carried out under the HPC-EUROPA project(RII3-CT-2003-506079), with the support of the European Community - ResearchInfrastructure Action under the FP6 ``Structuring the European Research Area''Programme.

    Partial support of the project of ``Necas Center for Mathematical modeling'', No.LC06052 and of the project ``Applied Mathematics in Physics and Technical Sciences'',No. MSN6840770010 of the Ministry of Education, Youth and Sports of the CzechRepublic is acknowledged.

    The author would like to thank to the members of HPC Europa staff at the CINECA HPC center in Bologna, Italy for their help and hospitality during his summer stay. A lotof work on the topic was done and first experience with MPI programming was gainedhere.

    Publications:

    [1] J. M ACH , Computational study of the Gray-Scott model , submitted to the proceedings of theSlovak-Austrian Mathematical Congress, Podbanske (2007).

    NUMERICAL SOLUTION OF THE 2D GRAY-SCOTT MODEL 813