The graphical inteface is available on this repository.
At the moment, this new version of NTMpy is not available on pip. NTMpy does not require an installation: download this repository, unzip the files, and click on `launch.py` to open the user interface. The GUI needs eel and jinja2 as dependencies, which can be installed typing the command `pip install eel[jinja2]` on the command promtpt.
NTMpy is a python package to solve 1D diffusion equation with 2 or 3 temperature coupled
The equation under consideration is:
where
-
$T_E(x,t)$ ,$T_L(x,t)$ , and$T_S(x,t)$ are temperature (subscripts recall Electron, Lattice, and Spin)
-
$\rho$ is the mass density in the$i$ -th layer of material (the material properties are piecewise homogeneous)
-
$C_{Ki}$ and$k_{Ki}$ are the specific heat and thermal conductivity of the system$K = E,L,S$ in the$i$ -th layer of material
-
$G_{KHi}$ is the thermal coupling coefficient between the system$K$ and$H$ (with$K,H\in \lbrace E,L,S\rbrace$ ) in the$i$ -th layer
-
$S(x,t)$ is the energy generation/ source
The material properties
The dependance on temperature are non-dispersive, i.e. they depend on the temperature in the same point at the same time
The solution is obtained using the Finite Element Method (FEM) + explicit Euler method. The FEM uses B-splines + collocation method.
Further informations can be found on the paper.
NTMpy can be used as a Python package or with a Graphic User Interface depending on the user preferences.
NTMpy provides a set of classes to simulate coupled heat equation with 2 or 3 temperature in a multilayer system. The simulation parameters are customizable, but the codes can choose them automatically if not given by the user.
Here is an example:
from Sim2T import Sim2T
import Visual as vs
from Source import source
# Initialize source
s = source() # default option, Gaussian pulse
s.setLaser(5, 2e-12)
s.delay = 2e-12 # time the maximum intensity hits
s.refraction = [1,1]
s.absorption = [1.9e-7, 1.9e-7]
# initialize simulation: ntm.simulation(number of temperatures, source)
sim = Sim2T() # Default initial temperature: 300 Kelvin
sim.setSource(s)
# add material layers:
# addLayer(length, [kE, kL], [CE, CL], density, G_EL, spline_number)
sim.addLayer( 30e-9, [ 8, 0], [lambda T: .112*T, 450], 6500, 6e17, 9)
sim.addLayer( 80e-9, [24, 12], [lambda T: .025*T, 730], 5100, 6e17, 12)
# set final simulation time (in seconds)
sim.final_time = 50e-12
# Run simulation
[x, t, phi] = sim.run()
# Plot temperature
vs.compare(x,t,phi[0],phi[1])The ouput phi is a 3D array with the following structure:
- the first index selects the temperature:
phi[0]is the electron temperature,phi[1]is the lattice temperature. - the second index is the space position:
phi[0][n]is the electron temperature in the n-th point of the grid. - the third index is the time instant:
phi[0][0][n]is the electron temperature of the surface after n time steps.
A GUI is available running the launch.py script with pyhton. Detailed description of the GUI is presented in the Wiki of the repository (currently under construction).
New features for NTMpy are currently under development, but with a very slow pace.
If there is any important feature you think is missing and it is important for the experiments, you can open an issue on this repository or directly contact the author.
If you want to contribute to the code development, you can either clone this directory or contact the author Valentino Scalera.
Any collaboration would be very appreciated.
NTMpy was a project of the Ultrafast Condensed Matter physics group at the Stockholm University.
The main contributors are:
- Valentino Scalera
- Lukas Alber
- Vivek Unikandanunni
- Stefano Bonetti
At the moment, Valentino Scalera is handling the maintenance and development of NTMpy.
You can contact me via email if you need help or you want to contribute.
Please, cite the reference paper:
@article{alber2020ntmpy,
title={NTMpy: An open source package for solving coupled parabolic differential equations in the framework of the three-temperature model},
author = {Lukas Alber and Valentino Scalera and Vivek Unikandanunni and Daniel Schick and Stefano Bonetti},
journal = {Computer Physics Communications},
year={2021},
volume = {265},
pages = {107990},
issn = {0010-4655},
doi = {https://doi.org/10.1016/j.cpc.2021.107990},
url = {https://www.sciencedirect.com/science/article/pii/S0010465521001028}
}
NTMpy has four dependencies: Numpy, Matplotlib, B-splines, and Progressbar, plus one extra dependency for the GUI Eel-Jinja2.
