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.

Using different time steps in study

Poorvank Sharma Teaching Assistant | IIT Bombay | Vibrational Spectroscopy

Please login with a confirmed email address before reporting spam

Hi

I am studying thr thermal expansion of a nanoheater in pulsed heat load. The load comes as a radiation for 25fs only and I have to study the simulation for 200ps. I want the solver to take 1fs time step till 25fs and then a larger time step say 100fs till 200ps. How can I do that. Any help would be appreciated.

Regards Poorvank


3 Replies Last Post Apr 22, 2021, 9:37 a.m. EDT
Robert Koslover Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 3 years ago Apr 21, 2021, 1:34 p.m. EDT
Updated: 3 years ago Apr 21, 2021, 1:36 p.m. EDT

Yes, I've done this sort of thing, although with less dramatic changes of timescale. I did two key things. First: I prepared it as two study steps (Step 1: Time Dependent A and Step 2: Time Dependent B) under the same overall Study. Step 1 and Step 2 were very similar, but with different output times (but that's not all, please read on). In my example, I have the output times for Step 1 set up as: range(0,0.025,5) and for Step 2 set as: range(5,0.05,10). Thus, you can see that the second Step begins where the first Step ends, but the outputs I've specified are half as often. But if that was all that I did, it might only effect the output times, not the actual solver steps. So here's the Second part: Once you have the above two Steps set up, you can choose (right-click Study) "show default solver." This will show you two solvers in a row, since you have two Steps. They are already linked to execute in order (which is a good thing, but you are not done yet!). Under "Time-Dependent Solver 1, Time Stepping" I specified Manual time steps with a Time Step: 0.025 . Similarly, under "Time-Dependent Solver 2, Time Stepping" I specified Manual time steps with a Time Step: 0.05 . (These matched my output times, but you could choose differently.) Anyway, these combinations basically tell the code to do the problem in two parts (aka, Steps), the first part for the first time period, with the first time steppings as I specified, and then to continue into the second part for the second time period, for the second time steppings that I specified. When you set your problem up, you may have to play with it a bit, clear solutions, delete/reset solvers, etc., to finally get this to work out well. But trust me, I was able to make it work, so you probably can too. Good luck.

-------------------
Scientific Applications & Research Associates (SARA) Inc.
www.comsol.com/partners-consultants/certified-consultants/sara
Yes, I've done this sort of thing, although with less dramatic changes of timescale. I did two key things. First: I prepared it as two *study steps* (*Step 1: Time Dependent A* and *Step 2: Time Dependent B*) under the same overall *Study*. Step 1 and Step 2 were very similar, but with different output times (but that's not all, please read on). In my example, I have the output times for Step 1 set up as: range(0,0.025,5) and for Step 2 set as: range(5,0.05,10). Thus, you can see that the second *Step* begins where the first *Step* ends, but the outputs I've specified are half as often. But if that was all that I did, it might only effect the *output* times, not the actual solver steps. So here's the Second part: Once you have the above two Steps set up, you can choose (right-click Study) "show default solver." This will show you two solvers in a row, since you have two Steps. They are already linked to execute in order (which is a good thing, but you are not done yet!). Under "Time-Dependent Solver 1, Time Stepping" I specified Manual time steps with a Time Step: 0.025 . Similarly, under "Time-Dependent Solver 2, Time Stepping" I specified Manual time steps with a Time Step: 0.05 . (These matched my output times, but you could choose differently.) Anyway, these combinations basically tell the code to do the problem in two parts (aka, Steps), the first part for the first time period, with the first time steppings as I specified, and then to continue into the second part for the second time period, for the second time steppings that I specified. When you set your problem up, you may have to play with it a bit, clear solutions, delete/reset solvers, etc., to finally get this to work out well. But trust me, *I was able to make it work*, so you probably can too. Good luck.

Poorvank Sharma Teaching Assistant | IIT Bombay | Vibrational Spectroscopy

Please login with a confirmed email address before reporting spam

Posted: 3 years ago Apr 22, 2021, 5:02 a.m. EDT
Updated: 3 years ago Apr 22, 2021, 5:13 a.m. EDT

Hi Robert,

You help worked for me :) Thanks. I can see 3 solutions due to some reason. Also, they are not ordered. Sol1 should be (0,1,25)[fs] and Soln2 should be (25,100,200000)[fs], but I am getting Soln1 (0,1,50). Soln2 (25,100,200000)[fs] and Soln3 (0,1,25)[fs].

I plan to study the temperature variation in the whole 200000 [fs] in a single cumulative solution. Is it possible to get both the solutions ordered and cumulated together? I am attaching the .mph file for reference.

Regards

Poorvank

Hi Robert, You help worked for me :) Thanks. I can see 3 solutions due to some reason. Also, they are not ordered. Sol1 should be (0,1,25)[fs] and Soln2 should be (25,100,200000)[fs], but I am getting Soln1 (0,1,50). Soln2 (25,100,200000)[fs] and Soln3 (0,1,25)[fs]. I plan to study the temperature variation in the whole 200000 [fs] in a single cumulative solution. Is it possible to get both the solutions ordered and cumulated together? I am attaching the .mph file for reference. Regards Poorvank


Robert Koslover Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 3 years ago Apr 22, 2021, 9:37 a.m. EDT
Updated: 3 years ago Apr 22, 2021, 9:40 a.m. EDT

Look under Study, Solver Configurations, Solution 2. You have two Time-Dependent Solvers there instead of only one. That's why you have three solutions total. So, did you remember my warning that "you may have to play with it a bit, clear solutions, delete/reset solvers, etc., to finally get this to work out well" ? Well, now you know why I said that. Anyway, for a brute-force way to deal with this: if you right-click Solver Configurations, then choose "Delete Configurations," and then go back and right-click Study 1, then "Show Default Solver," you will end up with only two solutions. But you will also have to type in the other details again, such as setting the manual time steps, etc. (per my earlier note). You're getting close, so don't give up. :) In regard to putting them together at the end, you can create multiple plots that access different solution sets, but are under the same plot group. This will allow you to plot them at the same time. The appearance on the combined plots as you go from one solution to the next can be nearly seamless, if you do it carefully. Also, you can export data and make plots using external tools such as Matlab or Excel, etc., if you really want to.

-------------------
Scientific Applications & Research Associates (SARA) Inc.
www.comsol.com/partners-consultants/certified-consultants/sara
Look under Study, Solver Configurations, Solution 2. You have two Time-Dependent Solvers there instead of only one. That's why you have three solutions total. So, did you remember my warning that "you may have to play with it a bit, clear solutions, delete/reset solvers, etc., to finally get this to work out well" ? Well, now you know why I said that. Anyway, for a brute-force way to deal with this: if you right-click Solver Configurations, then choose "Delete Configurations," and then go back and right-click Study 1, then "Show Default Solver," you will end up with only two solutions. But you will also have to type in the other details again, such as setting the manual time steps, etc. (per my earlier note). You're getting close, so don't give up. :) In regard to putting them together at the end, you can create multiple plots that access different solution sets, but are under the same plot group. This will allow you to plot them at the same time. The appearance on the combined plots as you go from one solution to the next can be nearly seamless, if you do it carefully. Also, you can export data and make plots using external tools such as Matlab or Excel, etc., if you really want to.

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.