Modeling a Periodic Heat Load
One of the more common questions we are asked is about the modeling of periodic, or pulsed, heat loads. That is, a heat load that turns on and off repeatedly at known times. Modeling such a situation accurately and efficiently in COMSOL Multiphysics is quite easy to do with the Events interface. The techniques we will introduce are applicable to many classes of time-dependent simulations in which you have changes in loads that occur at known times.
Editor’s note: This blog post was updated on October 4, 2022, to reflect updated modeling functionality.
A Brief Introduction to Time-Dependent Simulations
First, let’s take a (very) brief conceptual look at the implicit time-stepping algorithms used when you are solving a time-dependent problem in COMSOL Multiphysics. These algorithms choose a time step based upon a user-specified tolerance. While this allows the software to take very large time steps when there are gradual variations in the solution, the drawback is that using too loose of a tolerance can skip over certain transient events.
To understand this, consider the ordinary differential equation:
where the forcing function f(t) is a square unit pulse starting at t_s and ending at t_e. Given an initial condition, u_0=1, we can solve this problem for any length of time, either analytically or numerically.
In the plot of the analytic solution (shown above), we can observe the exponential decay and rise as the forcing function is zero or one. Using the default time-dependent solver for this problem, let’s look at the numerical solution for two different relative tolerances:
The numeric solution (red dots) is shown for a relative tolerance of 0.2 and 0.01 and is compared to the analytical result (grey line).
We can see from the plot above that a very loose relative tolerance of 0.2 does not accurately capture the switching of the load. At a tighter relative tolerance of 0.01 the solution is reasonably well resolved. We can also observe that the spacing of the points shows the varying time steps used by the solver. It is apparent that the solver takes larger time steps where the solution changes slowly and finer time steps when the heat load switches on and off.
However, if the tolerance is set too loosely, the solver may skip over the heat load change entirely when the width of the heat load gets very small. That is, if t_s and t_e move very close to each other, the magnitude of the total heat load is too small for the specified tolerance. We can of course mitigate this by using tighter tolerances, but a better option exists.
We can avoid having to tighten the tolerances by using Explicit Events, which are a way of letting the solver know that it should evaluate the solution at a specified point in time. From that point in time forward, the solver will continue as before until the next event is reached. Let’s look at the numeric solution to the above problem, with Explicit Events at t_s and t_e and solved with a relative tolerance of 0.2, a very loose tolerance:
When using Explicit Events, the numerical solution — even with a very loose relative tolerance of 0.2 — compares quite well with the analytical result. Away from the events, large time steps are taken.
The plot above illustrates that the Explicit Events feature generates a time step whenever the load switches on or off. The loose relative tolerance allows the solver to take large time steps when the solution varies gradually. Small time steps are taken immediately after the events to give good resolution of the variation in the solution. Thus, we have both good resolution of the heat load switching on or off and we take large time steps to minimize the overall computational cost.
Now that we’ve introduced the concepts, we will take a look at implementing these Explicit Events.
An Example from Heat Transfer
We will begin with an existing example from the COMSOL Multiphysics Model Library and modify it slightly to include a periodic heat load and the Events interface. We will look at an example of the Laser Heating of a Silicon Wafer, where a laser is modeled as a distributed heat source moving back and forth across the surface of a spinning silicon wafer.
The laser heat source itself traverses back and forth over the wafer with a period of 10 seconds along the centerline. To minimize the temperature variation over the wafer during the heating process, we want to turn the laser off periodically, while the heat source is in the center of the wafer.
To model this, we will first introduce an Events interface and, within that, define a so-called Discrete State variable. The name of this variable is
ONOFF, and it takes on an initial value of 1, as shown in the screenshot below.
Screenshot of the Discrete States within the Events interface.
We can use this Discrete States variable to modify the applied heat flux representing the laser heat source, as illustrated below.
The settings for the applied heat flux boundary condition use the Discrete States variable.
So far, we are simply multiplying the applied heat load by a unit constant. Next, we can use two Explicit Events that can change the
ONOFF variable. The first of these events will trigger initially at two seconds and set the
ONOFF state variable to zero (turning off the heat load). It will repeat this every five seconds. The second will trigger at three seconds, turning the state variable back to one (turning on the heat load) — this will also repeat every five seconds.
The Explicit Event settings. The first event has the effect of turning off the heat load. The second of these events starts at three seconds, and acts to turn the heat load back on.
No other changes are necessary, but we might want to ensure that we will get results immediately before and after each event is triggered. There are two settings that can ensure this, both shown in the screenshot below. First, you will need to open the Settings window for Time-Dependent Solver. There, in the Output section, you can enable the Store solution before and after events option. Alternatively, you can change the Times to store drop-down setting to Steps taken by solver.
The Time-Dependent Solver settings for the storing of solutions before and after the events.
You can compare the results of this simulation to the original model to see the differences in temperature across the wafer. With a periodic heat load, the temperature rise is more gradual and the temperature variations at any point in time are smaller.
We have looked at using the Events interface for modeling a periodic heat load over time and introduced why it provides a good combination of accuracy and low computational requirements. There is a great deal more that you can do with the Events interface — if you would like to learn more, please see our knowledge base article “Solving Models with Step Changes to Loads in Time”.
- COMSOL Now
- Fluid & Heat
- Structural & Acoustics
- Today in Science