anufrievroman / freepaths

Monte Carlo simulator of phonon and heat transport in nanostructures
https://anufrievroman.gitbook.io/freepaths
Other
14 stars 4 forks source link

timesteps behaviour #13

Open phigas opened 5 months ago

phigas commented 5 months ago

Currently the timesteps are all of equal size which is useful to show the profiles converging. But this means that for the final converged timestep only few phonons are actually considered. The way it should be done is that the first couple timesteps are shorter and that the final timestep is long. Maybe it's possible to have multiple smaller timesteps and then add them together to one big one. This way the convergence can still be evaluated and still many phonons are evaluated in the main timestep

anufrievroman commented 4 months ago

So, finally after checking the last version, I think it would be better to still have several short time segments across the whole simulation time, like previously, to visualize the convergence. Just that last N time segments are merged for better thermal conductivity calculation, but uncertainty is still calculated from the different time segments. So that there is still NUMBER_OF_TIME_SEGMENTS, which includes smaller NUMBER_OF_INITILIZATION_TIME_SEGMENTS, and all the remaining segments are averaged to get the final value.

phigas commented 4 months ago

The reason i did not choose this is because it is more difficult to implement. You would have to add up the heat and flux maps you need and find a place to output the extra tc. It's true that the old method made it easier to see convergence.

Currently the virtual start times of the phonons are generated from 0 to end of simulation. A very easy alternative would have been to instead generate the phonons from -t to end of simulation with t being some initialization time.

anufrievroman commented 4 months ago

Finally, I've reimplemented things a bit, similar to how it was before, with several equal timesteps, but now the final thermal conductivity is calculated as average after the stabilization, as shown below. So, this way we can see the convergence, can calculate the standard deviation (shown there as a region) #17 and at the same time still use many phonons to get a stable average value, not just the last value, like previously.

Here is the new plot generated by the program: image

I'll add a display of actual value and a few other things.

anufrievroman commented 4 months ago

So, the final timeframe behavior is like that.