Using Spreadsheets Transfer Equations to Show Diffusion ...



Using Spreadsheets to Emulate Diffusion and Thermal Conductivity

Harvey F. Blanck

Department of Chemistry, Austin Peay State University, Clarksville, TN 37044; blanckh@apsu.edu

Introduction

Visual methods that emulate physical processes are valuable teaching tools. Davenport used water flow through a variety of cleverly designed containers to emulate kinetic reactions (1). In a recent article, this author described how water flowing through a series of cells in a plastic model visually and quickly emulates planar diffusion and thermal conductivity under a variety of conditions (2). In this article, emulation of diffusion and thermal conductivity will be accomplished using Microsoft’s Excel and PowerPoint software.

Theory

Diffusion is described by Fick’s first and second laws (eq 1& 2)

[pic] (1)

[pic] (2)

where J is the flux, which is the amount of mass transported per unit time per unit area; D is the diffusion coefficient; c is the concentration; x is distance and t is time. Similar equations (Fourier’s laws) describe thermal conductivity.

Differential equations are often solved by a numerical process called the method of finite differences in which the initial conditions are changed in small increments (3). The explicit increment approach is the most straight-forward of the various numerical methods of finite differences. The large spreadsheets that may be produced do not present a problem for present day microcomputers. By determining the spreadsheet equations from the operation of the plastic model, the same incremental equations can be obtained as those derived from the second order differential equation. The spreadsheet results obtained using these incremental equations for the changes of concentration (or temperature) with time can often be used with a curve fitting program to generate an equation such as a Gaussian curve to describe these changes.

Spreadsheet equations for planar diffusion and thermal conductivity

In the plastic model emulation, water flows from cell to cell through a small connecting tube near the bottom of the partition between the cells (Figure 1). The water transfer rate depends on the pressure

[pic]

Figure 1. Liquid flow in the plastic model.

generated by the difference in water height in adjacent cells. If the flow is laminar rather than turbulent, the flow rate is directly proportional to this hydrostatic head. The change in liquid height for a given cell depends upon the amount of water flowing in compared to the amount flowing out.

A spreadsheet may be constructed in which columns represent liquid height in model cells and the rows show changes with time. In all examples, line 4 of the spreadsheet contains the initial conditions.

Consider a system in which diffusion from a source at a constant concentration occurs through a glass frit into a region at zero concentration of the diffusing substance. The initial conditions entered into line 4 are an arbitrary value of 100 for the first cell and a 0 for all the remaining cells in this row. For additional rows, the first and last columns require special treatment since they represent the boundaries. In line 5, a 100 is entered into spreadsheet cell A5 because the first model cell water height remains constant, and a 0 is entered into the last spreadsheet cell because the water height after exiting is constant as well. The remaining spreadsheet cells in row 5 will use an incremental transfer equation. The incremental transfer equation for spreadsheet cell B5 is:

B5 = B4+(A4-B4)*0.05-(B4-C4)*0.05 (3)

The first term on the right is the amount (height) that is presently in cell B. The second term is the amount input from the cell to the left (cell A) calculated from the height difference (pressure head) times a flow proportionality factor. The third term is the amount output to the cell on the right (cell C) calculated as in the second term. Although these two terms may be mathematically simplified to (A4-2*B4+C4)*0.05, it masks the concept of input minus output and makes it more difficult to write boundary condition equations. After copying this equation to the remaining cells in this row, the entire row may then be copied to additional rows until there is no longer a significant change in cell values, which shows that a steady state has been achieved. The number of cells per row determines the size of the x increment while the factor size (0.05 in this case) determines the number of rows required in the spreadsheet and hence the time increment. If this factor is too large the calculations become unstable as evidenced by values in the spreadsheet that either oscillate or are changing in the wrong direction. Once it is low enough to provide smoothly changing quantities, the factor should continue to be lowered until consistent results are obtained. If the factor is satisfactory, a smaller value should not alter the results other than slowing down the process, which requires more rows to achieve a particular state. An instructive way to check both the x and time increment sizes to see if any unexpected effect occurs is to halve the x and time increments. Halving the x increment (i.e. doubling the number of cells) should increase the number of rows for similar progress toward steady state by a factor of four and halving the time increment (i.e. halving the factor in the transfer equation) should double the number of rows. Halving both increments should increase the corresponding number of rows by a factor of eight. This is to be expected since concentration in eq 2 is second order in distance and first order in time. It appears that only the factor size (time increment) can generate incorrect results for planar systems while both can generate incorrect results for radial systems. In this case 0.05 works well and results in the expected linear steady state after about 2500 rows (Figure 2). Several rows have been plotted using an Excel bar graph to show the progress toward a steady state. Using bar graphs in a PowerPoint display provides a nice visual display to show the progress of diffusion or thermal conductivity. PowerPoint slides will transition smoothly if the first graph is adjusted to the desired font characteristics and then copied to another graph. The source in this copied graph can then be changed to a different spreadsheet row.

|A[pic] |B[pic] |

|C[pic] |D[pic] |

Figure 2. Diffusion using spreadsheet calculations and bar graphs. A. initial row. B. row 50. C. row 200. D. row 2500.

Moving data from the spreadsheet to a curve fitting program may be easily accomplished by copying the row values into a blank Excel spreadsheet sheet using ‘paste special’ in the edit drop down menu and checking ‘values’ and ‘transpose’ so that the row copied is now in a column format. After all the desired rows have been copied in this way, the set may then be copied into the curve fitting software.

As another example, consider a system where diffusion starts from a plane and spreads in one direction such as concentrated CuSO4(aq) layered below water. The spreadsheet equations remain the same except for cell 1 and the last cell. The equation for cell 1 is changed by eliminating the input part of eq 3 to give eq 4.

A5 = A4-(A4-B4)*0.05 (4)

And the last cell’s equation is changed in a similar fashion to eliminate the output. The spreadsheet emulation result is shown in Figure 3. Data from row 10 fit a 1-error function curve (2). The data from rows 100 and 200 using curve fitting software fit half of a Gaussian curve. A simple Gaussian equation

[pic]

Figure 3. Diffusion of CuSO4(aq) solution. (The left side is the bottom of the container.)

curve fit to the solute distribution is lost whenever a significant amount of solute diffuses to the top of the solvent. The results using a spreadsheet are the same as the plastic model results. (See the supplementary material for spreadsheet equations for several other common diffusion and thermal conductivity systems.)

Radial Diffusion and Thermal Conductivity

The spreadsheet transfer equation method for planar systems can be adapted to radial systems. For planar systems flux works very well because the area through which the transport occurs remains constant. However, for cylindrical or spherical systems, flux (flow), J, should be separated into rate and area and Fick’s first law rewritten in the form

[pic] (5)

where A is the area available for mass transport. For cylindrical and spherical systems as the radius increases the area of each shell partition increases. Since, when a steady state condition is reached, as much mass (or thermal energy) must enter a cylindrical or spherical cell as leaves, the rate of transfer is constant. As a consequence, at steady state the absolute value of the gradient dc/dx (or dT/dx) must decrease as the radius and, hence the area, increases.

For radial diffusion the volume between partitions also changes as the radius changes. Therefore, the concentration change in the cell must be calculated by dividing the change in amount by the volume of the cell. For a radial cylindrical system the incremental transfer equation for cell B5 is

B5 = B4+[(A4-B4)*2(r1h – (B4-C4)*2(r2h]*0.4/[h((r2)2 - h((r1)2] (6)

where r is the radius of a given cell and h is the total ‘height’ within the cells. The equation may be simplified since ( and h cancel out of the numerator and denominator.

This equation is also valid for thermal conductivity in a cylindrical system. Consider a 1 inch radius pipe with liquid flowing at 100 oC surrounded by 4 inches of insulation with an external temperature of 0 oC. The radial increment used in this example is 0.05 inches (20 cells per inch). (Radial system spreadsheets produce incorrect results if the radius increment is too large.) After setting the first 20 columns to 100 and the last column to 0 for the entire spreadsheet, setting all other initial values to

zero, and setting all the remaining interior spreadsheet cells to a simplified equation 6, the spreadsheet results are shown in Figure 4. Since there is little difference between the values for row 5000 and row 10,000, the system is almost at steady state by row 5000.

[pic]

Figure 4. Temperature profile for a hot liquid in a one inch radius pipe surrounded by 4 inches of insulation using radius increments of 0.05 inches. (20 cells/inch.)

Incropera and deWitt (4) show that the relationship between the steady state temperature, T, and the radius, r, is given by

T = T2 + (T1-T2)[ ln (r/r2) / ln (r1/r2) ] (8)

where r1 is the pipe radius not including insulation; T1 is the temperature of liquid and insulation at r1; r2 is the exterior radius; and T2 the exterior temperature at r2. At steady state calculated T values using eq 8 are nearly identical to steady state values in the spreadsheet. It is worth noting for comparison, that if the pipe liquid is colder than the surroundings, the temperature profile curve at steady state will be convex rather than concave.

Spherical diffusion or thermal conductivity may be treated in a similar fashion. Sala et al (5) and McHugh et al (6) developed an equation for Ca2+ diffusion associated with a spherical model of a biological cell. The spreadsheet equation for spherical radial diffusion and thermal energy transport may be obtained by using an equation similar to eq 6 but with the spherical area and volume yielding eq 9.

B5 = B4+[(A4-B4)*4(r12 - (B4-C4)* 4( r22]*0.2 /[(4(r23/3) - (4(r13/3)] (9)

As an example, the steady state thermal conductivity from a central core of one inch radius maintained at constant temperature surrounded by insulation results in a set of curves similar in appearance to those in Figure 4 but at steady state fit the equation of Incropera and deWitt (4) for spherical systems.

T = T1 - (T1-T2)[(1- r1/r)/(1- r1/r2) ] (10)

In another example, spherical radial thermal conductivity from a sphere initially at uniform temperature into surroundings of constant temperature is shown in Figure 5. The equation for cell 1 has no input term. Since the core temperature does not remain constant, no steady state will occur. The results are related to Lord Kelvin’s estimation of Earth’s age. England et al in a recent American Scientist article discuss this topic (7).

[pic]

Figure 5. Thermal conductivity from a sphere of initially uniform temperature. Interior is on the left.

Concluding Comments

Spreadsheet calculations using the explicit increment numerical method of finite differences are fast, accurate, and relatively easy. The spreadsheet incremental transfer equations emulate diffusion and thermal conductivity processes in planar and radial systems. Spreadsheet results are readily incorporated into a PowerPoint program to visually show how these systems change with time. Spreadsheet results for planar systems are the same as the results using water flow in the plastic model.

Diffusion and thermal conductivity systems are encountered in all areas of science and engineering. Since determination of the equations for use with this explicit increment method is done in a rather intuitive way, it may encourage introduction of quantitative aspects of all types of diffusion earlier in the chemistry curriculum in addition to benefiting advanced classes as well.

WSupplemental Material

A complete Excel spreadsheet including charts for constant input planar diffusion; ten short Excel spreadsheets that are readily expanded into full spreadsheets for other diffusion and thermal conductivity systems; a PowerPoint file showing how rapid slide changes give the effect of diffusion in progress plus many other slides; and a text file describing how an acrylic model was constructed are all available in this issue of JCE Online.

Literature Cited

1. Davenport, D. A. J. Chem. Educ. 1975, 52, 379-381.

2. Blanck, H. F. J. Chem. Educ. 2005, 82, 1523.

3. Rosales, R. R., Powell, A.; Ulm, F-J.; Beers, K. MIT, from Continuum Modeling and Simulation, OpenCourseWare MIT spring 2006. (last accessed March 27, 2008)

4. Incropera, F.; DeWitt, D. Fundamentals of Heat and Mass Transfer, 3rd ed.; John Wiley & Sons: New York, 1990; p 107.

5. Sala F.; Hernández-Cruz A. Biophysical Journal , 1990, 57, 313-324.

6. McHugh, J. M.; Kenyon, J. L. Am. J. Physiol. Cell Physiology, 2004, 286, C342-C348.

7. England, P. C.; Molnar, P.; Richter, F. M. American Scientist, 2007, 95, 342.

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download