4.5.2 Modifying the Reaction Physics

In this exercise we're going to make a simple change to the model implemented by Reaction component. Instead of the temperature ( \bgroup\color{Green}$ \phi_{{0}}^{}$\egroup ) being constant, it will increase with time. Heat is produced in a localized area, and diffuses away from the source.

  1. Go to the top of the Bocca project for the PDE exercises:

    $ cd $PDE_STUDENT_SRC

  2. Edit the implementation of the compute method of the Reaction component:

    $ bocca edit -i Reaction compute

  3. Scroll down to the line

    double r0 = 0.0 ; // Temperature does not change in a BZ reaction
    

    and comment it out with a  // at the beginning of the line. Insert a new definition for r0 after r1 and r2 are defined:  double r0 = sqrt(r1*r2);.

  4. Recompile the project and verify that the modified component passes the basic instantiation tests:

    $ make && make check

  5. Use the procedures of Section 4.4 to run a simulation with the new initial conditions and view the results. Now the $ \phi_{{0}}^{}$ field should show structure. Remember that you can plot this field in gnuplot with the triplet 1:2:3 at the end of your splot command. Note that you've been working in the $PDE_STUDENT_SRC, while for the Section 4.4 procedures you need to be in $PDE_STUDENT_SRC/components.

David E. Bernholdt [bek] 574-3147 2009-08-21