Simulation of electrical and thermal fields in a multimode microwave oven using software written in C++

Due to multiple reflexions on walls, the electromagnetic field in a multimode microwave oven is difficult to estimate analytically. This paper presents a C++ program that calculates the electromagnetic field in a resonating cavity with an absorbing payload, uses the result to calculate heating in the payload taking its properties into account and then repeats. This results in a simulation of microwave heating, including phenomena like thermal runaway. The program is multithreaded to make use of today’s common multiprocessor/multicore computers.


Introduction
This paper presents the algorithms used and results obtained using a C++ simulation program developed by the author. For experimental validation a thermal imaging (FLIR) camera was used to indirectly measure the electromagnetic field in a multimode microwave oven's payload.
As in any simulation, absolute precision in simulating physical phenomena is unfeasible and some reasonable approximations must be used. For example in our case, electromagnetic field dissipation is considered to take place exclusively in the payload -which is a lossy dielectric -and not inside the cavity which may contain water vapor or cavity walls which are imperfect conductors. Also, since microwave heating is fast and temperature differences relatively small, thermal convection and radiation was ignored. All heat transfer is considered to take place inside the payload and only by conduction.

Principle formulation and algorithm descriptions
The electromagnetic field is calculated by the program using a variant of the finite difference time domain method (FDTD), developed by Kane S. Yee [1][2][3][4]. This is a method for 3D approximation of Maxwell's equations solutions using centered differences. Electric and magnetic fields intensities are interleaved in both space and time.
There are six field components in each Yee cell ( Figure 1). The finite difference equations for the x axis are like: , , where μ is the absolute magnetic permeability and ε the absolute real electrical permittivity The electrical conductivity ζ is specific for conductors, in our case -lossy dielectrics -will consider For the other axes equations are similar.
Exponent notations like n, n+1 and n+1/2 stand for time iteration. Values x, y, z are dimensions of the rectangular parallelepiped and t is the time step.

Figure 1. Yee cell with electric and magnetic fields
For model stability spatial dimensions of the cell must be less than a tenth of the wavelength in the considered material, taking into account that this wavelength is smaller in the payload. The time step must be less than 1/10 of microwave's period [3]. The electromagnetic field calculation should continue until a steady state or a maximum number of iterations is reached, in the latter case the conclusion is that the model is not stable and cell dimensions and/or time step were too large and must be reduced.
Because the heating process is many orders of magnitude slower than EM field stabilization, the latter could be safely considered instantaneous. One time iteration for EM field at 2,45 GHz must be less than 4•10 -11 seconds; for heating a time step in the order of seconds is normal. But since electrical characteristics of the payload material are dependent on temperature, EM recalculation must be done after each temperature iteration. Thermal processes simulation algorithms are described in [5], [6].

Program description, simulation results and experimental validation
The C++ program interface is minimal and most parameters are hard coded, that is written directly into code and changing them implies recompiling the program. This is a CPU intensive application which takes a long time to complete, and such programs are usually designed to run in background, allowing other tasks to take priority. Since most computers today are multiprocessor and/or multicore, calculations must be done in multiple concurrent threads to take advantage of this.
The usual multithreading strategy is to create a number of worker threads that is twice the number of processors/cores and to allow the operating system to make thread-to-processor allocation. This program uses a different technique: the number of worker threads is equal to the number of processors and each is tied to a specific processor using single bit thread affinity masks. A controller thread, which is much less CPU intensive, is feeding small tasks -which could be part of E, H or temperature iterations -to a blocking queue. The worker threads take these tasks from the queue if available, waiting if not. Worker thread priority is set to less than normal, but not idle (minimal).
The 3D graphs resulted in this program are drawn with a software library also designed by the author which relies on OpenGL.

Simulation results
In Figure 3 is shown the electrical field intensity as color gradient in a transitory state. Blue corresponds to zero and red to maximum with green in between, but it is a logarithmic scale because of wide differences in values. This is a middle section that includes both the wave guide and payload, and both are visible in the image. Because high intensities in the wave guide lead to a "blinding" effect, it will be omitted in the next images.  The following graphs are done for a 200x100x40 mm payload, with ε'=4 and ε"=1 at 0°C, density ρ = 830 Kg/m 3 , specific heat capacity 1670 J/KgK, thermal conductivity 1,7 W/mK. Dimensions are scaled to interval [0, 1], the point with coordinates (0, 0, 1) being closest to the cavity feed. The maximum temperature in the payload was 265°C after 120 seconds at 900W microwave power.
(e) (f) Figure 5. Temperature as function of time (a, c, e) and coordinates at end of simulation (b, d, f)

Experimental validation
The microwave field is never measured directly in a resonating cavity, such measurements are always done by heating a payload with well known characteristics. To validate the model described above a payload made from dry pinewood was exposed to microwaves for a determined time. The oven used was a commercial Vortex MG8021TP AP with 800W output power. Payload characteristics are: electric permittivity ε' = 2, loss angle tangent tg δ = 0.1, density ρ = 380 kg/m 3 , specific heat capacity c = 2200 J/kgK, thermal conductivity λ = 0,16 W/mK.
A thermal imaging camera type Fluke Ti-25 was used to measure surface temperature distributions. Measurement were done by taking snapshots with the oven door open when possible, or by extracting the payload and then shooting quickly enough to avoid cooling. The camera takes pictures in both visible and infrared spectrums and saves specific, proprietary format files which contain all the information. Its software, SmartView, is capable of cropping and saving the relevant data in text files. The resonating cavity feed is at x=0 and with y and z coordinates at 50%.
(a) (b) (c) Figure 9. Thermal image (a) for a payload at 25% on x axis (facing the cavity feed), experimental temperature distribution after 60 seconds (b) and simulation temperatures (c)

Conclusions
The simulation methods presented here are relatively simple from a mathematical point of view, less sophisticated than frequency domain or finite element methods but easier to implement. Advanced programming techniques led to program execution times on the order of minutes.
x z y From the simulations resulted that the resonating cavity -payload system reaches steady state after a few thousand periods of the excitation feed. With normal sized payloads this is no more than 5000 periods, which means approximately 2 microseconds. Because the magnetron's response time is also very short we can consider that applying anode voltage on an already warmed magnetron leads instantly to a steady state in the cavity. Which means that pulse modulation cannot be used to limit electric field intensity, in order to avoid unwanted phenomena like dielectric breakdown when the payload is too small and/or non-dissipating. To do so would require using pulse frequencies on the order of MHz but that will cause electromagnetic compatibility problems.