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.

Direct influcence over automatic time-stepping?

Andrew Prudil Nuclear Materials

Please login with a confirmed email address before reporting spam

Hi everyone,
I'm wondering if it is possible to have a model influence the time-stepping algorithm directly? I know that certain things will cause time-stepping issues and I would like to 'inform' the time-stepping algorithm about them so that the steps can be adjusted accordingly.

I know that the time-stepping is adjusted automatically however there is no way for it to effectively predict highly non-linear events. I would like to be able to use results from the model (global values such as time or from coupling variables) to influence the time-stepping. That way I can use what I know will happen in conjunction with the time-dependent solver.

I tried using a time dependent expression in the maximum time-step size input but that is not allowed.

Is the only way to do this using the time-descrete solver or by adding specific time-steps?

Thanks for your help!
-Andrew

3 Replies Last Post Oct 18, 2012, 2:18 p.m. EDT
Andrew Prudil Nuclear Materials

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Oct 17, 2012, 4:36 p.m. EDT
Incase anyone was wondering, I never found a way to do exactly what I was looking for but I did find a bit of a work around.

In my case I have a time-dependent function which acts as an input to drive the model. When the input function changes rapidly I know that the model will require more time-steps. Because of this I know that I need to slow down the solver in somecases when the time-dependent solver doesn't know that because it is only looking at the derivatives at the present time (not in the future as I can).

I ended up adding a global variable and seting it equal to the input function in the future (ie t+a seconds) and solving it with a tight tollerance. The idea is that when the model is about to become difficult to solve the solver slows down so that it approaches more slowly (and more robustly).

In my current model this actually seems to be working in conjunction with extra time-steps and the intermediate function. It is making enough of a difference that if I remove it the model will in somecases not converge while it will with this global function slowing the solver down.

The solution is not as elegant as I'd like but seems to work well enough for now. I'd like to be able to give this information directly to the solver. If anyone at COMSOL finds this post I'd really like it the automatic time-stepping algorithms to accept maximum time-step inputs as a function of the dependent variables and time(from my perspective it should be really easy and really useful).
Incase anyone was wondering, I never found a way to do exactly what I was looking for but I did find a bit of a work around. In my case I have a time-dependent function which acts as an input to drive the model. When the input function changes rapidly I know that the model will require more time-steps. Because of this I know that I need to slow down the solver in somecases when the time-dependent solver doesn't know that because it is only looking at the derivatives at the present time (not in the future as I can). I ended up adding a global variable and seting it equal to the input function in the future (ie t+a seconds) and solving it with a tight tollerance. The idea is that when the model is about to become difficult to solve the solver slows down so that it approaches more slowly (and more robustly). In my current model this actually seems to be working in conjunction with extra time-steps and the intermediate function. It is making enough of a difference that if I remove it the model will in somecases not converge while it will with this global function slowing the solver down. The solution is not as elegant as I'd like but seems to work well enough for now. I'd like to be able to give this information directly to the solver. If anyone at COMSOL finds this post I'd really like it the automatic time-stepping algorithms to accept maximum time-step inputs as a function of the dependent variables and time(from my perspective it should be really easy and really useful).

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Oct 18, 2012, 11:27 a.m. EDT
Andrew,

Thanks for sharing this nice trick. I hope that future version would have some condition-based time stepping schemes.
Andrew, Thanks for sharing this nice trick. I hope that future version would have some condition-based time stepping schemes.

Andrew Prudil Nuclear Materials

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Oct 18, 2012, 2:18 p.m. EDT
No problem. I should warn people that this technique is highly problem sensitive.It requires tweaking both the time offset and the solution tolerance such that it triggers shorter time-steps at the appropriate time. Perhaps someone with a more detailed understanding of how the time-stepping algorithm works would be able to provide more specific instructions for tweaking the values than my trial and error approach.
No problem. I should warn people that this technique is highly problem sensitive.It requires tweaking both the time offset and the solution tolerance such that it triggers shorter time-steps at the appropriate time. Perhaps someone with a more detailed understanding of how the time-stepping algorithm works would be able to provide more specific instructions for tweaking the values than my trial and error approach.

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.