Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adaptive Timestep #16

Open
ghost opened this issue Feb 17, 2020 · 3 comments
Open

Adaptive Timestep #16

ghost opened this issue Feb 17, 2020 · 3 comments

Comments

@ghost
Copy link

ghost commented Feb 17, 2020

Hi, thanks for sharing your code via Github!
It looks very promising and also thank you for the excellent documentation.

I am trying to simulate a multilayer structure and the temperature evolution after optical excitation with a single laser pulse.
I was wondering whether it is possible to implement an adaptive timestep here?

As my laser pulse is short (on the order of hundreds of fs), the initial step should be on the order of a few fs as well, but as I would like to simulate until hundreds of ps or a ns even, there is no need to keep the timestep as small for the whole simulation process. I guess an adaptive timestep could help and save time and resources.

Thanks in advance! :)

@luksen99
Copy link
Member

Hi,

thank you for the comment and your feedback!
Regarding your question:

  1. The source term, responsible for the heat injection will not influence the stability limit.
  2. Being interested in different scopes of time dynamics is a very valid concern but has not been implemented as for now, since we are typically more interested in ultrafast dynamics (scale of <= ps).
    However, we are open to suggestions on this. Fork from Developer and pull a request. Typically Runge Kutter methods are used to do this.

Thank you!

@dschick
Copy link

dschick commented Feb 18, 2020

hi @luksen99,

2\. we are typically more interested in ultrafast dynamics (scale of <= ps).

I only partly agree, since there are already a few examples, especially including the spin system, where the NTM needs to be calculated for 100s of nanoseconds.

1. The source term, responsible for the heat injection will not influence the stability limit.

So it is only the structure that determines the stability in terms of geometry and thermophysical properties? I guess nanometer-sized multilayers with manyinterfaces are then the "worst" case to consider?

Using the current simulations, one already suffers from very high memory usage when using long delays.
A simple example might give you an automatically set time step in the range of 10^-17 s.
In case you want to simulate till 100ps = 10^-10s the simulations already allocate memory for a matrix [10^7 x (spatial grid size)] for every subsystem.

2\. Typically Runge Kutter methods are used to do this.

Does that mean, that the current solver can only calculate on an evenly spaced temporal grid?
Is there any possibility to set the temporal gird manually instead of just the time step?

Assuming, that the NTM simulations do not require a source term, but can already work with an initial spatial temperature profile as initial condition (is that actually already the case?):

the user could split up the simulation in different chunks applying different time steps manually and always using the last spatial temperature profile of one simulation chunk to use it as initial condition for the next chunk.

@luksen99
Copy link
Member

luksen99 commented Mar 19, 2020

1. The source term, responsible for the heat injection will not influence the stability limit.
Yes, only the structural parameters, C, k, G, are determining the stability limit. However, keep in mind that in this code we allow C(T) and k(T), so for very high laser fluences, this implicitly affects the structural parameters, which are linearized to calculate the stability limit as well. However, this did not affect the time steps of experimentally relevant cases so far.
I guess nanometer-sized multilayers with many interfaces are then the "worst" case to consider?
I would say that a mix of interfaces of very different sizes can be a challenge. Typically, ´small´ structures show ´fast´ dynamics, so a small time-step is exactly what we want. However, if there is a mix of ´small ´ structures with ´fast´ dynamics and ´large´ structures with ´slower´ dynamics the solver will take the smallest timestep required.
This also depends on the resolution in space, which is determined by the order of spline interpolation, allowing also fast modes to be captured and the constant number of collocation points for every layer, which can be changed.
In order to change the order of spline interpolation you would have to go into the source code, it is declared in the Msetup() function. The respective variable is order = 5. Eventually decreasing it to 3 (but not lower than 2!) can make an improvement.
The user could split up the simulation in different chunks applying different time steps manually and always using the last spatial temperature profile of one simulation chunk to use it as initial condition for the next chunk.
Yes!
Last but not least: Those are rather general suggestions. If you want, you can forward us the precise problem setting and we can look at it in a more concrete way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants