Melting Butter Physics

Here is a summary of the governing physics and assumptions used for the melting butter problem.

The stick of butter is assumed to be homogeneous and one-dimensional. Melting occurs uniformly at the plate surface - no tilting or falling over. The heat equation is used to model the temperature as a function of time and distance along the stick.
\begin{align} \frac{\partial T}{\partial t} = \alpha \frac{\partial^2 T}{\partial x^2} \end{align} where T is the local temperature, t is time, x is the distance along the axis of the butter stick, and α is the thermal diffusivity defined by \begin{align} {\alpha} = \frac{k}{\rho c_p} \end{align}
where k is the thermal conductivity, ρ is the density, and cp is the sensible heat capacity. Each of these are physical properties of the butter. In this simulation a finite element approach is taken by dividing the stick into n elements as shown in the following figure.
where A is the cross-section area of the stick, Ai is the area of the element exposed to the room, mi is the mass of the element. The first element (element i=0) is the heated plate/cup held at a constant temperature Tplate. The heat equation can be reduced to an energy balance for each of the elements.
The balance requires that the rate of energy accumulation is equal to the rate of energy entering the element, less the rate of energy leaving the element. Here, thermal conduction of heat, starting at the hot plate, moves along the axis of the butter stick. Since the room is likely to be at a higher temperature, heat will enter the element by thermal convection.
\begin{align} {\dot E} = {\dot E_{in}}-{\dot E_{out}} \end{align} or \begin{align} {\dot E} = \textit{conduction in + convection in - conduction out} \end{align}
This can be written in terms of temperature Ti since the energy, E, is proportional to the mass of the element dm, the sensible specific heat cp, and the temperature. \begin{align} {\dot E} = \frac{\partial E}{\partial t} = m c_{p} \frac{\partial T}{\partial t} \end{align}
In discrete form suitable for computer computation
\begin{align} {\dot E} = \frac{\Delta E_{i}}{\Delta t} = {m_{i}} c_{p} \frac{\Delta T_{i}}{\Delta t} \end{align} where mi represent the mass of the element. The energy rate for conduction of heat along the stick
is \begin{align} {q} = -{k}\frac{\partial T}{\partial x} \end{align} where q is the heat rate per unit area, and k is the thermal conductivity. Accounting for the cross-section area of the element, A, the conductive and convective energy rate into the element is \begin{align} {\dot E_{in}} = -{k} {A} \frac{(T_{i}-T_{i-1})}{\Delta x} + {h}{A_{i}}{(T_{amb}-T_{i})} \end{align} where h is the convective heat transfer coefficient and Ai is the area of the element exposed to the room air. The combined conductive energy rate out of the element (and into the next) is \begin{align} {q_{out}} = {\dot E_{out}} = -{k} {A} \frac{(T_{i+1}-T_{i})}{\Delta x} \end{align} As the heat equation first-order in time (t), and second-order in space (x), there are initial and boundary conditions to be satisfied. The temperature is uniform (Tinit) at t=0. The two boundary conditions are the constant temperature heat plate at x=0 and the convective loss at the end of the stick (x=L) as it relates to the temperature gradient.
Melting begins when the temperature of the element reaches the melting point Tmelt. During melting, the temperature remains constant until the element has absorbed the latent heat of fusion (LF). This is the energy needed for the material to change from solid to liquid phase. Once this occurs, the element becomes liquid and is added to the cup - the length of the stick decreases. As the level in the cup rises, the hot liquid in contact with the remaining solid is assumed to be at the plate temperature. Convective heat gain in the submerged butter increases and accelerates the melting.
For numerical stability, the simulation requires \begin{align} {R} = {\alpha} \frac{\Delta t} {(\Delta x)}^2 > 0.5 \end{align} A few key features of the main screen are shown below.