top of page

Finite Element Analysis

Diffusion of Heat into a Marshmallow

During the 2019 Spring semester I had the opportunity to incorporate finite element analysis into two of my school projects, as well as into a project during my 2019 summer internship. Finite element analysis encompasses the methods by which problems are solved by breaking them down into small pieces that can then be solved analytically using an appropriate approximation. The more pieces in which the problem can be broken the closer the approximation will be to exact. Finite element analysis is used in a wide range of applications such as solving partial differential equations, heat transfer, stress concentrations in bodies, and other applications.

sw marsh ext.PNG

Fig. 1. Exploded view of the hot plates and cast iron blocks in SolidWorks.

sw marsh com.PNG

Fig. 2. Side view of hot plates and a cast iron block as they would be when heating the marshmallow.

ss dif eqn.PNG

Fig. 3. Finite-difference form of two-dimensional, steady-state diffusion [1]. Each term represents a temperature node. Element size is equal in both the y-direction and x-direction.

Approaching the Problem Statement

During my heat transfer class in the spring semester of 2019, we were assigned a group for the project of devising a method of heating a marshmallow to between 65ᵒC and 70ᵒC at the center and 80ᵒC to 85ᵒC at the surface. Along with this problem statement we were given required parameters such as the choice between a cylindrical or rectangular prism marshmallow, the dimensions of the marshmallow for either case, and the thermal conductivity and specific heat of the marshmallow. For this problem it was necessary to neglect factors such as marshmallow density changing with respect to time and space, varying thermal conductivity and specific heat that can occur from chemical changes in the marshmallow, and thermal resistances between surfaces.

When approaching the problem statement it was important to incorporate my engineering design process. After defining the problem and incorporating research and requirements, our group began brainstorming ideas. After talking through several, we decided to eliminate convection and radiation by making them negligible contributors. To focus on conduction we designed cast iron blocks to encase the marshmallow and used hot plates to heat the cast iron and apply a constant surface temperature to the marshmallow, as seen in Figures 1 and 2. This allowed us to use the time dependent heat diffusion partial differential equation, which can be approximated using the finite difference method.

 

Prior Experience

In class we had learned how to apply the finite difference method to a two-dimensional system at steady-state conditions (independent of time), as seen in Figure 3, using MS Excel. Using Excel for this purpose is intuitive, as the grid lays out the two-dimensional system being solved. The system is broken down into pieces where each cell is an element. Boundary cells hold constant values of surface temperature or surface flux that do not change over time. Each cell within the system contains an equation that references the cells around it and itself. These equations are driven by the boundary cells that set the boundary  conditions

of the system. For steady-state conditions, the system must be solved multiple times until it converges within an acceptable allowance. When a cell references itself it creates the circular reference necessary for the system to loop. Excel is not set by default to solve circular reference problems, and will  give  a circular  reference  error  when  making  the  cell reference itself. Excel has the option of turning on iterative solutions, which allows the system to solve itself a set number of times. The system can then be solved to convergence.

Applying the Solution

Before I could tackle the Excel part of the problem for our four dimensional scenario, I had to address the finite element version of the time dependent diffusion equation, as seen in Figure 4. In studying this equation I found that the stability of the equation was not inherent and that criteria must be met so the that the solution would converge. The time step is directly proportional to the element size, indicating that the element size could not be below a certain size based on the time step. Our time step did not need to be more precise than one second, so adjusting the time step allowed me to adjust the element size based on the criteria given by Figure 5.

 

Using Excel to solve a four dimensional problem is not as intuitive as a two-dimensional problem and required me to expand the way I thought about using Excel. I had to imagine that the Excel grid system went into and out of the page. For example, looking at a stack of paper from directly overhead shows a single piece of paper. Spreading that stack of paper flat shows every piece of paper that was in the stack. Using the same logic I realized the number of elements I had in the third dimension was the number of planes, or grids, I needed to portray in Excel. This included boundary planes, which were grids comprised entirely of the constant temperature boundary condition. Having addressed three dimensions, I turned towards addressing the fourth: time. As described in Figure 4, the system can be thought of in two states, a present state and a future state. After mulling this over, I realized I needed to duplicate the marshmallow in Excel to achieve both a present state and a future state, indicating each grid needed a copy adjacent to it.

As indicated in Figure 4, the future state is the state being solved in the diffusion equation. This indicates that the present state is no more than a set of values used by the future state. Therefore the present state holds the initial conditions of the marshmallow when the cast iron blocks are applied. The cells in the grids of the future state hold the finite element diffusion equation, which references each cell surrounding it in the present state and itself in the present state. The cell in the present state is different than the cell in the future state and no circular reference error is triggered. Once the future state is solved, all the values of the cells of the future state can be copied over to the present state, at which time the future state will automatically update for the next time step. The process can then be repeated for as many time steps as necessary.

Having solved the system, the next matter of importance was determining the number of time steps, or length of time, necessary to cook the marshmallow to the required specifications. To determine this value, I wrote code in MS Excel Visual Basic that would automatically update the present state until the middle of the marshmallow read a temperature that was directly between the high temperature and the low temperature, which allowed room for error in either direction. The number of iterations was recorded and multiplied by our time step of one second to give us our cooking time.

Challenges and Breakthroughs

The biggest challenge to this design problem was visualizing how to model the three-dimensional marshmallow on a two-dimensional plane. Prior to solving this issue,  we decided as

3d diffusion eqn.PNG

Fig. 4. Three dimensional time-dependent finite element version of  diffusion equation with corresponding variable descriptions [1]. Click to magnify image.

criteria.PNG

Fig. 5. Definition of element size related to time step for stability criteria [1].

pres and fut.PNG

Fig. 6. Present and future states for one plane. The present state is color coded and holds the present values. The future state holds the equations that apply the values from the present state. Click to magnify.

Fig. 7. Each slide represents a plane that makes up the marshmallow in the z direction. The slideshow starts at the outside edge of the marshmallow where heat is applied and ends at the mid-plane of the marshmallow where the temperature gradient in the x and y directions is most prominent.

a team to model the marshmallow as a time-dependent two-dimensional system and created several models in Excel to capture heat transferring in different directions and chose the longest cooking time as the limiting case. This solution, however, bothered me and I continued to ponder how one would go about solving the heat transfer in all three dimensions at the same time. It wasn't until I envisioned the marshmallow as a stack of paper that was spread across a desk that I could see how to make all three dimensions interact at the same time.

Determining the best way to heat a marshmallow allowed our group to explore many design possibilities, allowing us as a group to spitball ideas off of each other until we had a design we felt was best suited to the problem statement. The challenges associated with the design process and the development of the design provided a great learning experience that can be utilized for the future.

[1] F. P. Incropera, T. L. Bergman, A. S. Lavine and D. P. Dewitt, Fundamentals of Heat and Mass Transfer, 7th ed., Jefferson City: John Wiley & Sons, 2011.

© 2022 by Isaac Hall. Proudly created with Wix.com

  • LinkedIn - Grey Circle
bottom of page