Heat source for microwave heating

Numerical methods and mathematical models of Elmer
Post Reply
elelel
Posts: 32
Joined: 23 May 2022, 17:37
Antispam: Yes

Heat source for microwave heating

Post by elelel »

Hello Elmer community,
I want to simulate microwave heating potatoes.The heat source has to do with the electric field in the potato.
The temperature equation and the heat source are shown below.
the temperature equation and heat source.png
the temperature equation and heat source.png (25.67 KiB) Viewed 1223 times
The electric field is a complex number, so what should I put in the formula? I don't know how MATC calculates complex numbers.Here's what I did.

Code: Select all

Heat Source = Variable  "Electric Field "
  Real MATC "pi*2.45e9*8.8542e-12*20*(abs(tx))^2/1050"
Should the variable of heat source be electric field, E, or something else?
I simulated microwave heating potatoes in a rectangular waveguide.The temperature results for Elmer and COMSOL are completely different.
Temperature results of Elmer and COMSOL.png
(52.34 KiB) Not downloaded yet
case.sif
(5.63 KiB) Downloaded 80 times
Your help would be much appreciated.
Dustin
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Heat source for microwave heating

Post by raback »

Hi Dustin,

Electric field here has 6 components.

Code: Select all

Electric field[Electric field re:3 Electric field im:3]
So in your expression tx(0) is real field in x-direction and tx(5) is imaginary in z-direction. These are not treated as complex variables so it does not look so pretty as you have treat it by its components.

(It would make sense to add the few lines of code in the CalcFields routine so that it would directly compute the losses.)

I think the heat source in Elmer is per mass (historical choice). You might want to check that also.

-Peter
Rich_B
Posts: 421
Joined: 24 Aug 2009, 20:18

Re: Heat source for microwave heating

Post by Rich_B »

Hello,

The case.sif file doesn't include the keyword
Joule Heat
Take a look in the ElmerModelsManual.pdf for instructions on using that keyword.

Rich.
elelel
Posts: 32
Joined: 23 May 2022, 17:37
Antispam: Yes

Re: Heat source for microwave heating

Post by elelel »

raback wrote: 04 Jul 2022, 16:35 Hi Dustin,

Electric field here has 6 components.

Code: Select all

Electric field[Electric field re:3 Electric field im:3]
So in your expression tx(0) is real field in x-direction and tx(5) is imaginary in z-direction. These are not treated as complex variables so it does not look so pretty as you have treat it by its components.

(It would make sense to add the few lines of code in the CalcFields routine so that it would directly compute the losses.)

I think the heat source in Elmer is per mass (historical choice). You might want to check that also.

-Peter
Dear Peter,
Thank you so much for your advice.The heat source is working.So I ran a bunch of models yesterday.And then I have a new problem.
Potato is the heated material.When I change its heat conductivity from 0.1 to 450, my potato don't get heated.
According to my simulations, the higher the heat conductivity, the less accurate the temperature.
Here are the Elmer and COMSOl temperature results for heat conductivity of 0.1 and 450, respectively.The size of the potato is 0.03m*0.03m*0.02m, and the maximum mesh of the potato is set to 0.0008m.
Elmer and COMSOl temperature results for heat conductivity of 0.1 and 450.png
Elmer and COMSOl temperature results for heat conductivity of 0.1 and 450.png (123.17 KiB) Viewed 1170 times
I don't know what the problem is.Here's what I did with your advice.
I added

Code: Select all

Field Variable = Electric field E[Electric field re E:3 Electric field im E:3]
to CalcFields.
The heat source looks like this.The heat source divided by the density becomes per mass.

Code: Select all

Heat Source = Variable  "Electric Field E"
Real MATC "pi*8.8542e-12*2.45e9*20*((tx(0))^2+(tx(1))^2+(tx(2))^2+(tx(3))^2+(tx(4))^2+(tx(5))^2)/1050"
Is that right?I don't understand your sentence "so that it would directly compute the losses".I don't know what code to add to calculate the losses directly in CalcFields.
Dustin
case.sif
(5.91 KiB) Downloaded 68 times
The 0.0008m grid file is too big, I uploaded a 0.0016m grid.
0016.7z
(851.64 KiB) Downloaded 62 times
Last edited by elelel on 06 Jul 2022, 09:57, edited 1 time in total.
elelel
Posts: 32
Joined: 23 May 2022, 17:37
Antispam: Yes

Re: Heat source for microwave heating

Post by elelel »

Rich_B wrote: 04 Jul 2022, 17:13 Hello,

The case.sif file doesn't include the keyword
Joule Heat
Take a look in the ElmerModelsManual.pdf for instructions on using that keyword.

Rich.
Dear Rich,
Thank you for your suggestion.I've now added joule heat.
But I don't think it will affect my results. Since the electric conductivity of the material is 0, I think there is no joule loss.
Dustin
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Heat source for microwave heating

Post by raback »

Hi Dustin,

My guess is that you apply some Dirichlet BCs for the temperature outside the potato. It seems to be in constant temperature. Maybe this is different than for Comsol?

The part about coding in parenthesis was a note to self. It would require some actual coding, not currently accomplished just with the sif.

-Peter
elelel
Posts: 32
Joined: 23 May 2022, 17:37
Antispam: Yes

Re: Heat source for microwave heating

Post by elelel »

Dear Peter,
Thank you so much for your help!
I don't know how much time I would waste without your help.Elmer's and Comsol's simulations are now very similar.
The default potato boundary in comsol is heat insulation.I wanted Elmer not to transfer heat to the air, so I set this wrong boundary condition.
I have one last question.
The grid must be very small to ensure the accuracy of the results.So is there any way I can get more accurate results with a larger grid?
Dustin
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Heat source for microwave heating

Post by raback »

Hi Dustin

You could try to set "Element = p:2" to the HeatSolver section.

-Peter
elelel
Posts: 32
Joined: 23 May 2022, 17:37
Antispam: Yes

Re: Heat source for microwave heating

Post by elelel »

Dear Peter,
I tried, but it didn't change.My model is a potato heated in a waveguide. The main problem is that if the potato's grid is not small enough, the distribution of the electric field in the potato is not accurate. The electric field is a variable of the heat source.
This is the electric field distribution in potatoes when the maximum mesh size is 0.004m and 0.0008m respectively.
the electric field distribution.png
the electric field distribution.png (135.44 KiB) Viewed 1092 times
Comsol can get good results on larger grids, so is there any way Elmer can do that?
In addition, if the maximum mesh size of the potato is 0.0005m, Elmer will not be able to calculate.

Code: Select all

ERROR:: AllocateElementVector:  Unable to allocate      3377388  element integer array.
ERROR:: AllocateElementVector:  Unable to allocate      3334116  element integer array.

ERROR:: AllocateElementVector:  Unable to allocate      3391020  element integer array.


Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0  0xffffffff
#1  0xffffffff
#2  0xffffffff
#3  0xffffffff
#4  0xffffffff
#5  0xffffffff
#6  0xffffffff
#7  0xffffffff
#8  0xffffffff
#9  0xffffffff
#10  0xffffffff
#11  0xffffffff
#12  0xffffffff
#13  0xffffffff
#14  0xffffffff
#15  0xffffffff
#16  0xffffffff
#17  0xffffffff
#18  0xffffffff
#19  0xffffffff
#20  0xffffffff
#21  0xffffffff

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0  0xffffffff
#1  0xffffffff
#2  0xffffffff
#3  0xffffffff
#4  0xffffffff
#5  0xffffffff
#6  0xffffffff
#7  0xffffffff
#8  0xffffffff
#9  0xffffffff
#10  0xffffffff
#11  0xffffffff
#12  0xffffffff
#13  0xffffffff
#14  0xffffffff
#15  0xffffffff
#16  0xffffffff
#17  0xffffffff
#18  0xffffffff
#19  0xffffffff
#20  0xffffffff
#21  0xffffffff

job aborted:
[ranks] message

[0-3] terminated

[4] process exited without calling finalize

[5-7] terminated

[8] process exited without calling finalize

[9] terminated

---- error analysis -----

[4,8] on COFFEE
ElmerSolver_mpi.exe ended prematurely and may have crashed. exit code 3

---- error analysis -----
I'm working on a bigger model now. I have an embarrassing situation. When the grid is too small, Elmer reports an error and does not calculate. When large grids are used, the results are not accurate.
Regards
Dustin
elelel
Posts: 32
Joined: 23 May 2022, 17:37
Antispam: Yes

Re: Heat source for microwave heating

Post by elelel »

Hi,
I have a question.
This is a reactor with uneven temperature distribution. I want to get the temperature T at a point in the reactor. When T ≥150℃, set the heat source to 0, and when T < 150, set the heat source to a value, like 100. How do I get the temperature variable at this point? Is there a way for Elmer to do that?
Regards
Dustin
Post Reply