Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Step function boundary condition: step occurs earlier than expected

Please login with a confirmed email address before reporting spam

I have a simple 1-D model where I specified a general inward heat flux at one endpoint. The heat flux is defined as a step function which has a constant value of 400 W/m^2 for 20 sec, and then the heat flux is decreased to a constant value 300 W/m^2. The transition zone is 0.1 sec.

The problem I am having is the heat flux begins to decrease earlier than what was programmed. The attached file shows a plot of the inward heat flux (which is exactly what was programmed) and the total heat flux. I found that I could fix this by decreasing the maximum time step. But for more complex models I can't decrease the time stepping due to the high computation time.

I am not looking to change my current model. Instead I would just like to know how Comsol determines a time dependent solution and why a large time step results in this change occurring earlier than expected.

-John



10 Replies Last Post Jun 26, 2012, 4:42 p.m. EDT
Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 26, 2012, 1:36 p.m. EDT
Hi

have you checked that your mesh is compatible with the gradients generated by a 0.1 sec abrupt temperature change ?, how many mesh elements are there across he heat front as it propagates ? Because you do not only have an earlier drop, but also an undershoot (numerical ?)

changin time stepping is one way, changing the mesh is another to cope with transient thermal effects

--
Good luck
Ivar
Hi have you checked that your mesh is compatible with the gradients generated by a 0.1 sec abrupt temperature change ?, how many mesh elements are there across he heat front as it propagates ? Because you do not only have an earlier drop, but also an undershoot (numerical ?) changin time stepping is one way, changing the mesh is another to cope with transient thermal effects -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 26, 2012, 2:22 p.m. EDT
Thanks for the quick response. The plot that I showed was for an extremely fine mesh. For my geometry, which consisted of a 1-D line 1 m long, there were 100 mesh elements. Increases the mesh does eliminate that undershoot in the heat flux. However the transition still occurs earlier than what I wanted.

But again I am mainly just trying to understand what Comsol is actually doing. My guess is that instead of solving from a time of 0 sec to a time of 30 sec, Comsol is solving all time steps simultaneously. And therefore Comsol is trying to center the transition zone around 20 sec instead of starting the transition zone at 20 sec. But I don't know how Comsol obtains its solution, so I don't know if this explanation is correct.

-John
Thanks for the quick response. The plot that I showed was for an extremely fine mesh. For my geometry, which consisted of a 1-D line 1 m long, there were 100 mesh elements. Increases the mesh does eliminate that undershoot in the heat flux. However the transition still occurs earlier than what I wanted. But again I am mainly just trying to understand what Comsol is actually doing. My guess is that instead of solving from a time of 0 sec to a time of 30 sec, Comsol is solving all time steps simultaneously. And therefore Comsol is trying to center the transition zone around 20 sec instead of starting the transition zone at 20 sec. But I don't know how Comsol obtains its solution, so I don't know if this explanation is correct. -John

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 26, 2012, 3:01 p.m. EDT
Hi

but if you are using the standard step() function it's value is 0.5 at the t=0 time, hence the transition starts at Dt/2 before t=0 and ends at Dt/2 after, where Dt is the transition time, try a plot of step1()

--
Good luck
Ivar
Hi but if you are using the standard step() function it's value is 0.5 at the t=0 time, hence the transition starts at Dt/2 before t=0 and ends at Dt/2 after, where Dt is the transition time, try a plot of step1() -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 26, 2012, 3:25 p.m. EDT
The step function appears to be identical to the inward heat flux from the attachment in my first post, but it is still very different from the total heat flux. I attached a plot of the step function. I assume the transition zone in the total heat flux is much larger than 0.1 sec because of the mesh size and time step. But I am still unsure why this increase in the transition zone occurs before and after 20 sec, instead of just after 20 sec.

-John
The step function appears to be identical to the inward heat flux from the attachment in my first post, but it is still very different from the total heat flux. I attached a plot of the step function. I assume the transition zone in the total heat flux is much larger than 0.1 sec because of the mesh size and time step. But I am still unsure why this increase in the transition zone occurs before and after 20 sec, instead of just after 20 sec. -John


Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 26, 2012, 3:29 p.m. EDT
Hi

I do not have any explanations, would need to understand more about the model and the set-up, but heat fluxes are not always the most precise. Have you read through theknowledge base articles on heat flux calculations and tip&tricks ? Take a look, that might give you a clue

--
Good luck
Ivar
Hi I do not have any explanations, would need to understand more about the model and the set-up, but heat fluxes are not always the most precise. Have you read through theknowledge base articles on heat flux calculations and tip&tricks ? Take a look, that might give you a clue -- Good luck Ivar

Nagi Elabbasi Facebook Reality Labs

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 26, 2012, 3:55 p.m. EDT
Hi,

COMSOL could be taking big time steps close to 20 seconds. For example if COMSOL solves at t=18 and then uses a step size of 2.0 then the next solution time will be t=20. If you request the results at t=19 it will be an interpolated result. You can check that from the Log tab. If that is the case restrict the maximum time step the solver can take to a smaller value.

Nagi Elabbasi
Veryst Engineering
Hi, COMSOL could be taking big time steps close to 20 seconds. For example if COMSOL solves at t=18 and then uses a step size of 2.0 then the next solution time will be t=20. If you request the results at t=19 it will be an interpolated result. You can check that from the Log tab. If that is the case restrict the maximum time step the solver can take to a smaller value. Nagi Elabbasi Veryst Engineering

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 26, 2012, 4:03 p.m. EDT
I will look through the articles and see what I can find. Thank you.

-John
I will look through the articles and see what I can find. Thank you. -John

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 26, 2012, 4:15 p.m. EDT
The maximum time step is currently at 0.1 sec. However the transition occurs about 1.2 sec early. I can improve the results be lowering the time step even more, but I would expect 0.1 sec to be small enough.

-John
The maximum time step is currently at 0.1 sec. However the transition occurs about 1.2 sec early. I can improve the results be lowering the time step even more, but I would expect 0.1 sec to be small enough. -John

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 26, 2012, 4:19 p.m. EDT
Hi Nagi

your are right, it depends also on the settings of the time stepper, automatic, intermediate or strict (and perhaps some new things in 4., I3 havent had time to get there yet ;)

--
Good luck
Ivar
Hi Nagi your are right, it depends also on the settings of the time stepper, automatic, intermediate or strict (and perhaps some new things in 4., I3 havent had time to get there yet ;) -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 26, 2012, 4:42 p.m. EDT
I was able to fix the problem by adjusting the steps taken by solver to intermediate or strict. Thanks for the help.

-John
I was able to fix the problem by adjusting the steps taken by solver to intermediate or strict. Thanks for the help. -John

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.