Open karnapravin opened 1 year ago
Also, I cannot visualize the source term even if I copy the code from the example page. The error page is a huge page but at last it says" AssertionError: Pieces mismatches: [{1768, 1769}, {1776, 1775}, {1784, 1783}] ". Also the animation does not run. My code for solving TTM is as follows. from NTMpy import NTMpy as ntm from matplotlib import pyplot as plt import numpy as np import numericalunits as u u.reset_units('SI') s = ntm.source() s.spaceprofile = "TMM" s.timeprofile = "Gaussian" s.FWHM = 0.1u.ps #Full width half max of the laser pulse s.fluence = 17u.mJ/u.cm*2 #Fluence of the laser s.t0 = 1u.ps #Time when Gaussian peaks s.lambda_vac = 400 #Wavelength of incident light (in nm!) s.theta_in = np.pi/4 #Incident angle s.polarization = "p"
length_cu = 500u.nm #Length of the Material n_cu = 1.2878+2.2596j #Complex refractive index k_el_cu = 391u.W/(u.mu.K);#Heat conductivity k_ph_cu = 7u.W/(u.mu.K);#Heat conductivity rho_cu = 1e38.96*u.kg/(u.m3)#Density C_el_cu = lambda Te:(96.8*u.J/(u.m*3u.K2))/(1e38.96u.kg/(u.m3)) Te #Electron heat capacity C_lat_cu = 3.62e6u.J/(u.m3*u.K*2)/rho_cu #Lattice heat capacity G_cu = 6e17u.W/(u.m*3u.K) #Lattice electron coupling constant Temperature Model:
sim = ntm.simulation(2,s)
sim.addLayer(length_cu,n_cu,[k_el_cu,k_ph_cu],[C_el_cu,C_lat_cu],rho_cu,[G_cu])
sim.final_time = 15*u.ps
[x,t,T] = sim.run()
v = ntm.visual(sim)
so = v.source()
v.contour('1')
v.contour('2') [timegrid, avT] = v.average()
speed = 1 v.animation(speed)
Ciao karnapravin
You can get the source term with the method sourceprofile() of the class simulation.
For example, you can run S = sim.sourceprofile('TMM','Gaussian', x, L, t, 12)
where
'TMM' and 'Gaussian' are the type of the source, in particular the space distribution and the time evolution (you can use also other types like lambert-beer for example)
L is the array of the position of the interfaces. You can get them using sim.temp_data.length
t is the time instants when you want to compute the source term. You can use the output t of the method run(), so is coincides with the time where the temperature is computed
x is the points where you want to compute the source term. If you want the same points where the the temperature is computed, you can use the output x of the method run()
-12 is the number of points where the diffusion equation is imposed, in the current version of the code must be 12
For the problems with the plot tools, I am not sure what is the cause. May I ask what IDE and interpreter are you using? (so I can try to reproduce the same error)
If I take a long time to respond, you can email me at valentino.scalera@cern.ch (for some reason the repository owners did not received any notification of the issue form github)
How do I get the values of the source term at each time and position, like for electron or lattice temperature? I need to get the source term values to calculate the contribution of -(Ke/G del^2Te). Thanks