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.

Wrong function output values

Please login with a confirmed email address before reporting spam

Hi. I am new to comsol and came across a weird problem that I need help with.

I use a piecewise function to determine a changing boundary temperature in my model like this:

Days 0 to 25: T = 283 K
Days 25 to 50: T = 300 K
Timestep = 0.1 day

So the temperature should change at day 25 but for some reason it changes prematurely at day 21! The magnitude of the deviance changes depending on amount of days simulated.

I have tried every trick I can think of to find the source of this problem but to no avail. The interpolation function gives same wrong outputs but the analytic function seems to work like it should.

Any ideas what could be causing this?


3 Replies Last Post Jan 18, 2017, 3:43 p.m. EST
Edgar J. Kaiser Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 7 years ago Jan 18, 2017, 1:35 p.m. EST
Atte,

are you using free time stepping? The solver then chooses own steps regardless of your settings. This may work for smoother profiles but not in your case. You may need to use strict time stepping to resolve the step.

Cheers
Edgar

--
Edgar J. Kaiser
emPhys Physical Technology
www.emphys.com
Atte, are you using free time stepping? The solver then chooses own steps regardless of your settings. This may work for smoother profiles but not in your case. You may need to use strict time stepping to resolve the step. Cheers Edgar -- Edgar J. Kaiser emPhys Physical Technology http://www.emphys.com

Please login with a confirmed email address before reporting spam

Posted: 7 years ago Jan 18, 2017, 2:05 p.m. EST
That was it! Thank you very much!

So what I had to change was (in my model) in the model builder: Study 1 > Solver configurations > Solution 1 > Time-dependent solver 1 --> Time stepping: steps taken by solver = Strict.
That was it! Thank you very much! So what I had to change was (in my model) in the model builder: Study 1 > Solver configurations > Solution 1 > Time-dependent solver 1 --> Time stepping: steps taken by solver = Strict.

Walter Frei COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 7 years ago Jan 18, 2017, 3:43 p.m. EST
Hi Atte,

You can actually also use the Events interface to force the solver to recognize the changing boundary condition at day 25. Using a single explicit event at day 25 will be more efficient that using strict timestepping. For a more detailed discussion why, please see:
www.comsol.com/blogs/modeling-a-periodic-heat-load/

Best Regards,
Hi Atte, You can actually also use the Events interface to force the solver to recognize the changing boundary condition at day 25. Using a single explicit event at day 25 will be more efficient that using strict timestepping. For a more detailed discussion why, please see: https://www.comsol.com/blogs/modeling-a-periodic-heat-load/ Best Regards,

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.