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.

Time stepping taking too long

Please login with a confirmed email address before reporting spam

Hi All,

My simulation times have been taking a lot longer recently, I'd like to learn how to reduc this. Can someone give me some advice about good practices to keep simulation times down, or refer me to some references that discuss this.

Also, for various time-dependent studies I set the time-step to be .1 s, but the solver takes time steps on the order of 1e-4, which I think is partially why simulation times are taking so long. Does someone have an idea as to why is this happening? I've looked through all the nodes in my model and can't find where these times steps are specified.

Best, Henry


7 Replies Last Post 26 lug 2018, 05:32 GMT-4

Please login with a confirmed email address before reporting spam

Posted: 6 years ago 25 lug 2018, 15:55 GMT-4

Hi Henry,

COMSOL chooses a small timestep, usually smaller than the one you define. Throughout the simulation it can increase it or decrease it depending on the changes it sees. If you want to have full control of the timestep go to "Study" -> "Solver Configurations" -> "Solution" -> "Time-dependent solver" -> "Time stepping" and in "Steps taken by solver" select strict to be sure that COMSOL just goes through the timestep you defined. This might be of interst to you: https://www.comsol.pt/support/knowledgebase/1062/ Additionally, if you want to see the times taken by solver see the log file in the "Time dependent solver"

Regards, Nichal

Hi Henry, COMSOL chooses a small timestep, usually smaller than the one you define. Throughout the simulation it can increase it or decrease it depending on the changes it sees. If you want to have full control of the timestep go to "Study" -> "Solver Configurations" -> "Solution" -> "Time-dependent solver" -> "Time stepping" and in "Steps taken by solver" select strict to be sure that COMSOL just goes through the timestep you defined. This might be of interst to you: https://www.comsol.pt/support/knowledgebase/1062/ Additionally, if you want to see the times taken by solver see the log file in the "Time dependent solver" Regards, Nichal

Please login with a confirmed email address before reporting spam

Posted: 6 years ago 25 lug 2018, 16:14 GMT-4

Hi Nichal,

I've done this, but the log window is saying that the stepper is still taking steps ~1e-7. Could it be possible that I've somehow defined a time step elsewhere that it is using? All the study nodes im checking have a the desired time step of .1s.

Thanks, Henry

Hi Nichal, I've done this, but the log window is saying that the stepper is still taking steps ~1e-7. Could it be possible that I've somehow defined a time step elsewhere that it is using? All the study nodes im checking have a the desired time step of .1s. Thanks, Henry

Please login with a confirmed email address before reporting spam

Posted: 6 years ago 25 lug 2018, 16:18 GMT-4

That's odd. In the log itself you have "Tfail" and "NLfail". Do you have a relatively large number there? If your Tfail is high your problem must be the time step that you are setting too high. If your NLfail is high you should refine your mesh.

If you attach your model I can have a look!

That's odd. In the log itself you have "Tfail" and "NLfail". Do you have a relatively large number there? If your Tfail is high your problem must be the time step that you are setting too high. If your NLfail is high you should refine your mesh. If you attach your model I can have a look!

Please login with a confirmed email address before reporting spam

Posted: 6 years ago 25 lug 2018, 16:34 GMT-4

The TFail remains 0, whereas the NLFail slowly increases to with each time step. NLFail went from 0 to about 100, although I cancelled the computation before time was over. I've refined the mesh as much as possible and this had seemingly no effect. I've attached the model below.

One concern I've had that may be playing a role is that my model was imported as a CAD model, so it might be very sophisted even for extremely fine meshes (although I suspect this is not the case as I feel like I've seen more complicated models on the tutorials before). Maybe there is a way to simplify the mesh while maintaining some accuracy?

Thank you so much for your help.

Best, Henry

The TFail remains 0, whereas the NLFail slowly increases to with each time step. NLFail went from 0 to about 100, although I cancelled the computation before time was over. I've refined the mesh as much as possible and this had seemingly no effect. I've attached the model below. One concern I've had that may be playing a role is that my model was imported as a CAD model, so it might be very sophisted even for extremely fine meshes (although I suspect this is not the case as I feel like I've seen more complicated models on the tutorials before). Maybe there is a way to simplify the mesh while maintaining some accuracy? Thank you so much for your help. Best, Henry


Please login with a confirmed email address before reporting spam

Posted: 6 years ago 25 lug 2018, 16:39 GMT-4

Unfortunately I cannot not open your model because my version is 5.1 and you created it with 5.3. I don't know if it is possible to save as an older version of COMSOL. If you how to do it and reattach it I can see it. Sorry...

Unfortunately I cannot not open your model because my version is 5.1 and you created it with 5.3. I don't know if it is possible to save as an older version of COMSOL. If you how to do it and reattach it I can see it. Sorry...

Please login with a confirmed email address before reporting spam

Posted: 6 years ago 25 lug 2018, 16:59 GMT-4

I've attached the application as a .java file that you can compile on your own computer if you want to try that. However I don't know if this will work as I've never done it before, so we may just be out of luck. If that is the case no worries, as I can take this issue up with the support team (they take a while to respond sometimes which is why I came to the discussion boards first).

-Thanks, Henry

I've attached the application as a .java file that you can compile on your own computer if you want to try that. However I don't know if this will work as I've never done it before, so we may just be out of luck. If that is the case no worries, as I can take this issue up with the support team (they take a while to respond sometimes which is why I came to the discussion boards first). -Thanks, Henry


Please login with a confirmed email address before reporting spam

Posted: 6 years ago 26 lug 2018, 05:32 GMT-4

Hi Henry,

I've spent some time trying to compile it but I was not successful. My apologies. Maybe someone else can try to see your file and help you

Kind regards, Nichal

Hi Henry, I've spent some time trying to compile it but I was not successful. My apologies. Maybe someone else can try to see your file and help you Kind regards, Nichal

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.