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 "withsol" inside of study to extract solutions

Please login with a confirmed email address before reporting spam

I've been struggling to implement the "withsol" operator in my study. I'm trying to model the change in eigenfrequency due to thermal diffusion.

However, since the eigenfrequency solver can't take a time series as input, I need to extract discrete solutions from my Time Dependent thermal diffusion model to feed into the Eigenfrequency solver. "Withsol" seems like the best tool for this job, but I'm unsure how to include it into my study to get the solutions at the time steps I am interested in. Has anyone had success with something like this?



4 Replies Last Post Sep 25, 2017, 1:32 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: 7 years ago Sep 22, 2017, 4:42 p.m. EDT

Hi

I would try to separate your three solver cases into three separate solver nodes: 1) for the steady state solution, to get initial conditions, and check the graphs for coherence. 2) one for the time derivative solution, BUT by using the solution 1) as intial conditions, and check the results for coherence. 3) Then finally a Parametric (parameter: time = range(as per time study) ) Eigenfrequency solver case (only for the Solid physics) where the Eigenfrequency solver is set up as for a "Prestressed Eignefrequency" solver settings, by using the time series 2) as intial values AND as linearisation points. You need to use an interpoaltion indexing into the time series via the Parametric "time" parameter

This should give you our desired results, but to be 100% sure add some probes and variables to cross check the variable transfers of initial conditions.

You may also run a separate initial conditions, that you enable only for the eigenfrequency study, where you refer to the initial stress solid.s... = witsol('sol...',solid.s...) Where sol... refers to the time series solution, solid.s... runs through all stress tensor values. To hit the time value of the time series a withsol('sol...',solid.s...,setval(t,time)) might be more appropriate else COMSOL chooses only the last time step of the series

Good luck Ivar

-------------------
Have fun COMSOLing,
Sincerely,
Ivar
Hi I would try to separate your three solver cases into three separate solver nodes: 1) for the steady state solution, to get initial conditions, and check the graphs for coherence. 2) one for the time derivative solution, BUT by using the solution 1) as intial conditions, and check the results for coherence. 3) Then finally a Parametric (parameter: time = range(as per time study) ) Eigenfrequency solver case (only for the Solid physics) where the Eigenfrequency solver is set up as for a "Prestressed Eignefrequency" solver settings, by using the time series 2) as intial values AND as linearisation points. You need to use an interpoaltion indexing into the time series via the Parametric "time" parameter This should give you our desired results, but to be 100% sure add some probes and variables to cross check the variable transfers of initial conditions. You may also run a separate initial conditions, that you enable only for the eigenfrequency study, where you refer to the initial stress solid.s... = witsol('sol...',solid.s...) Where sol... refers to the time series solution, solid.s... runs through all stress tensor values. To hit the time value of the time series a withsol('sol...',solid.s...,setval(t,time)) might be more appropriate else COMSOL chooses only the last time step of the series Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 7 years ago Sep 22, 2017, 5:51 p.m. EDT
Updated: 7 years ago Sep 22, 2017, 6:01 p.m. EDT

Ivar,

Thank you for taking a look at this. It seems like the one step that is still giving me trouble is the parametric sweep for the eigenfrequency. I am currently getting an eigenfrequency output that is identical for all solutions, regardless of what time step they represent.

I created a parameter named 'time' which sweeps across the same values as the time steps for the Time Dependent study. But from re-reading your answer, it seems like I am missing something. What do you mean when you say "interpolation indexing" into the time series via the Parametric value?

Best - Paul

Ivar, Thank you for taking a look at this. It seems like the one step that is still giving me trouble is the parametric sweep for the eigenfrequency. I am currently getting an eigenfrequency output that is identical for all solutions, regardless of what time step they represent. I created a parameter named 'time' which sweeps across the same values as the time steps for the Time Dependent study. But from re-reading your answer, it seems like I am missing something. What do you mean when you say "interpolation indexing" into the time series via the Parametric value? Best - Paul

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: 7 years ago Sep 23, 2017, 1:49 a.m. EDT
Updated: 7 years ago Sep 23, 2017, 1:49 a.m. EDT

Hi

then probably its the "index" into the time solution or the "time pointer" that did not get up correctly, in both Derived variables initialisation AND in the Eigenfrequency solver node initialisation settings. see the images below, I have only the latest version of COMSOL active.

By the way your mesh is a bit coarse cehck your CFL number.

Sincerely Ivar

-------------------
Have fun COMSOLing,
Sincerely,
Ivar
Hi then probably its the "index" into the time solution or the "time pointer" that did not get up correctly, in both Derived variables initialisation AND in the Eigenfrequency solver node initialisation settings. see the images below, I have only the latest version of COMSOL active. By the way your mesh is a bit coarse cehck your CFL number. Sincerely Ivar


Please login with a confirmed email address before reporting spam

Posted: 7 years ago Sep 25, 2017, 1:32 p.m. EDT
Updated: 7 years ago Sep 25, 2017, 2:49 p.m. EDT

A big thanks for the clarification and screenshot, Ivar. This model is a placeholder for a more complex geometry that will use the same physics, so fast computation time for testing purposes was the priority instead of accuracy. I will look into CFL and study time steps as I move into my main model, since it's not something I have ever looked at very closely on other projects, although it sounds like a good practice.

A big thanks for the clarification and screenshot, Ivar. This model is a placeholder for a more complex geometry that will use the same physics, so fast computation time for testing purposes was the priority instead of accuracy. I will look into CFL and study time steps as I move into my main model, since it's not something I have ever looked at very closely on other projects, although it sounds like a good practice.

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.