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

Implementation of multilayer 2TM #119

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion hdr/sim.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include <vector>

/// Enumerated lists for code readability
enum pump_functions_t {square=0, two_temperature, double_pump_two_temperature, double_pump_square};
enum pump_functions_t {square=0, two_temperature, double_pump_two_temperature, double_pump_square, multilayer_two_temperature};

namespace sim{

Expand Down Expand Up @@ -150,6 +150,17 @@ namespace sim{
extern double TTG; ///electron coupling constant
extern double TTTe; /// electron temperature
extern double TTTp; /// phonon temperature

//Modified by M Strungaru
extern double TTcutofftime; //cutoff time for the laser pulse (in s)
extern double TTdamp; //damping after the TTcutofftime
extern double TTephrat; //ratio between the new electron-phonon coupling and old one
extern double TT_afterpp;
//for substrate
extern double TTCe_sub; ///electron specific heat
extern double TTCl_sub; ///phonon specific heat
extern double TTG_sub; ///electron coupling constant


extern int system_simulation_flags;
extern int hamiltonian_simulation_flags[10];
Expand Down
75 changes: 75 additions & 0 deletions src/program/temperature_pulse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ double two_temperature_function(double ftime);
double double_pump_two_temperature_function(double ftime);
double square_temperature_function(double ftime);
double double_pump_square_temperature_function(double ftime);
double multilayer_two_temperature_function(double ftime);

/// Selects appropriate temperature pulse function according to user input
double temperature_pulse_function(double function_time){
Expand All @@ -75,6 +76,10 @@ double temperature_pulse_function(double function_time){
case(double_pump_square):
return double_pump_square_temperature_function(function_time);
break;

case (multilayer_two_temperature):
return multilayer_two_temperature_function(function_time);
break;

default:
return 0.0;
Expand Down Expand Up @@ -226,6 +231,76 @@ double double_pump_square_temperature_function(double ftime){

}

//modified by M Strungaru
double multilayer_two_temperature_function(double ftime){

const double i_pump_time = 1.0/sim::pump_time;
const double reduced_time = (ftime-3.*sim::pump_time)*i_pump_time;
const double four_ln_2 = 2.77258872224; // 4 ln 2
// 2/(delta sqrt(pi/ln 2))*0.1, delta = 10 nm, J/m^2 -> mJ/cm^2 (factor 0.1)
const double two_delta_sqrt_pi_ln_2 = 9394372.787;
const double pump=sim::pump_power*two_delta_sqrt_pi_ln_2*
exp(-four_ln_2*reduced_time*reduced_time)*i_pump_time;

const double Te = sim::TTTe;
const double Tp = sim::TTTp;
const double G = sim::TTG;
const double Ce = sim::TTCe;
const double Cl = sim::TTCl;
const double dt = mp::dt_SI;

//two temperature model parameters for substrate
double G1 = sim::TTG_sub;
const double Ce1 = sim::TTCe_sub;
const double Cl1 = sim::TTCl_sub;


if(ftime>=sim::TTcutofftime){
//pump=sim::TT_afterpp;
//G=sim::TTG*sim::TTephrat;

//std::cout<<"ftime22 "<<sim::TTcutofftime<<"\t"<<pump<<"\t"<<sim::TTephrat<<"\t"<< sim::TTdamp<<std::endl;
//std::cout<<"2 Hth "<<mp::material[0].H_th_sigma<<std::endl;
for(unsigned int mat=0;mat<mp::material.size();mat++){
mp::material[mat].alpha=sim::TTdamp;
mp::material[mat].one_oneplusalpha_sq = -mp::material[mat].gamma_rel/(1.0+mp::material[mat].alpha*mp::material[mat].alpha);
mp::material[mat].alpha_oneplusalpha_sq = mp::material[mat].alpha*mp::material[mat].one_oneplusalpha_sq;
mp::material[mat].H_th_sigma= sqrt(2.0*mp::material[mat].alpha*1.3806503e-23 / (mp::material[mat].mu_s_SI*mp::material[mat].gamma_rel*mp::dt));
}
}
// integrate two temperature model (floor in free elecron approximation (c prop to T) for low temperatures)
//normal integration of 22TM without heat sink coupling
if(ftime<sim::TTcutofftime){

if(Te>1.0) sim::TTTe = (-G*(Te-Tp)+pump)*dt/(Ce*Te) + Te;
else sim::TTTe = (-G*(Te-Tp)+pump)*dt/Ce + Te;
sim::TTTp = ( G*(Te-Tp) )*dt/Cl + Tp; //- (Tp-sim::Teq)*sim::HeatSinkCouplingConstant*dt;
}
else {
//integrate the other parameters for 2ttm
if(Te>1.0) sim::TTTe = (-G1*(Te-Tp)+pump)*dt/(Ce1*Te) + Te;
else sim::TTTe = (-G1*(Te-Tp)+pump)*dt/Ce1 + Te;
sim::TTTp = ( G1*(Te-Tp) )*dt/Cl1 + Tp - (Tp-sim::Teq)*sim::HeatSinkCouplingConstant*dt;
}


// Optionally set material specific temperatures
if(sim::local_temperature==true){
for(unsigned int mat=0;mat<mp::material.size();mat++){
if(mp::material[mat].couple_to_phonon_temperature==true) mp::material[mat].temperature=sim::TTTp;
else mp::material[mat].temperature=sim::TTTe;
}
}

if(ftime<sim::TTcutofftime)
return sim::TTTe;
else
return sim::TTTp;


}


namespace program{
/// @brief Function to calculate a time series with two temperature model heating/cooling profile
///
Expand Down
10 changes: 10 additions & 0 deletions src/simulate/sim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,16 @@ namespace sim{
double TTTe = 0.0; /// electron temperature
double TTTp = 0.0; /// phonon temperature

//created by M Strungaru
double TTcutofftime=500E-15; //cutoff time for the laser pulse (in s)
double TTdamp=0.001; //damping after the TTcutofftime
double TTephrat=100; //ratio between the new electron-phonon coupling and old one
double TT_afterpp=0.0;
double TTCe_sub = 222.0; ///electron specific heat (gamma)
double TTCl_sub = 2.3E06; ///phonon specific heat
double TTG_sub = 6.6E17 ;///electron coupling constant


int system_simulation_flags;
int hamiltonian_simulation_flags[10];

Expand Down
64 changes: 64 additions & 0 deletions src/vio/match.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,11 @@ namespace vin{
if(value==test){
sim::pump_function=double_pump_square;
return EXIT_SUCCESS;
}
test="multilayer-two-temperature";
if(value==test){
sim::pump_function=multilayer_two_temperature;
return EXIT_SUCCESS;
}
else{
terminaltextcolor(RED);
Expand Down Expand Up @@ -510,6 +515,65 @@ namespace vin{
return EXIT_SUCCESS;
}
//--------------------------------------------------------------------
//--------------------------------------------------------------------
//Modified by M Strungaru 2024
test="two-temperature-damping";
if(word==test){
double hscc=atof(value.c_str());
check_for_valid_value(hscc, word, line, prefix, unit, "none", 0.0, 1.0e40,"input","0.0 - 1.0E40");
sim::TTdamp=hscc;
return EXIT_SUCCESS;
}
//--------------------------------------------------------------------
test="two-temperature-cutoff-time";
if(word==test){
double hscc=atof(value.c_str());
check_for_valid_value(hscc, word, line, prefix, unit, "none", 0.0, 1.0e40,"input","0.0 - 1.0E40");
sim::TTcutofftime=hscc;
return EXIT_SUCCESS;
}
//--------------------------------------------------------------------
test="two-temperature-e-ph-ratio";
if(word==test){
double hscc=atof(value.c_str());
check_for_valid_value(hscc, word, line, prefix, unit, "none", 0.0, 1.0e40,"input","0.0 - 1.0E40");
sim::TTephrat=hscc;
return EXIT_SUCCESS;
}
//--------------------------------------------------------------------
test="two-temperature-after-pulse-power";
if(word==test){
double hscc=atof(value.c_str());
check_for_valid_value(hscc, word, line, prefix, unit, "none", 0.0, 1.0e40,"input","0.0 - 1.0E40");
sim::TT_afterpp=hscc;
return EXIT_SUCCESS;
}
//--------------------------------------------------------------------
test="two-temperature-substrate-electron-heat-capacity";
if(word==test){
double hscc=atof(value.c_str());
check_for_valid_value(hscc, word, line, prefix, unit, "none", 0.0, 1.0e40,"input","0.0 - 1.0E40");
sim::TTCe_sub=hscc;
return EXIT_SUCCESS;
}
//--------------------------------------------------------------------
test="two-temperature-substrate-phonon-heat-capacity";
if(word==test){
double hscc=atof(value.c_str());
check_for_valid_value(hscc, word, line, prefix, unit, "none", 0.0, 1.0e40,"input","0.0 - 1.0E40");
sim::TTCl_sub=hscc;
return EXIT_SUCCESS;
}
//--------------------------------------------------------------------
test="two-temperature-substrate-electron-phonon-coupling";
if(word==test){
double hscc=atof(value.c_str());
check_for_valid_value(hscc, word, line, prefix, unit, "none", 0.0, 1.0e40,"input","0.0 - 1.0E40");
sim::TTG_sub=hscc;
return EXIT_SUCCESS;
}
//--------------------------------------------------------------------

test="cooling-function";
if(word==test){
test="exponential";
Expand Down