-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added initial implementation of localized temperature pulse
- Loading branch information
1 parent
3a64529
commit 35cc3a4
Showing
18 changed files
with
1,156 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
//----------------------------------------------------------------------------- | ||
// | ||
// This header file is part of the VAMPIRE open source package under the | ||
// GNU GPL (version 2) licence (see licence file for details). | ||
// | ||
// (c) R F L Evans 2014. All rights reserved. | ||
// | ||
//----------------------------------------------------------------------------- | ||
// | ||
// Functions to calculate dynamic lateral and vertical temperature | ||
// profiles with the two temperature model. Laser has gaussian absorption | ||
// profile in x,y and an exponential decrease in absorption with increasing | ||
// depth (z). | ||
// | ||
// | | ||
// | | ||
// | | ||
// | | ||
// | | ||
// _-_ | ||
// / \ | ||
// __-- --__ | ||
// ---------------------- | ||
// | | | | | | | | | ||
// ---------------------- | ||
// | | | | | | | | | ||
// ---------------------- | ||
// | ||
// The deposited laser energy is modified laterally by a gaussian heat profile | ||
// given by | ||
// | ||
// P(r) = exp (-4 ln(2.0) (r**2) / (fwhm**2) ) | ||
// | ||
// and/or vertically considering an exponential depth dependence of the laser | ||
// energy given by | ||
// | ||
// P(z) = exp(-z/penetration-depth) | ||
// | ||
// Both of these can be combined to give a full 3D solution of the two | ||
// temperature model, including dynamic heat distribution within the sample. | ||
|
||
// System headers | ||
#include <string> | ||
#include <vector> | ||
|
||
// Program headers | ||
|
||
#ifndef LOCALTEMPERATURE_H_ | ||
#define LOCALTEMPERATURE_H_ | ||
|
||
//-------------------------------------------------------------------------------- | ||
// Namespace for variables and functions to calculate localised temperature pulse | ||
//-------------------------------------------------------------------------------- | ||
namespace ltmp{ | ||
|
||
//----------------------------------------------------------------------------- | ||
// Variables used for the localised temperature pulse calculation | ||
//----------------------------------------------------------------------------- | ||
|
||
//----------------------------------------------------------------------------- | ||
// Function to check local temperature pulse is enabled | ||
//----------------------------------------------------------------------------- | ||
bool is_enabled(); | ||
|
||
//----------------------------------------------------------------------------- | ||
// Function to initialise localised temperature pulse calculation | ||
//----------------------------------------------------------------------------- | ||
void initialise(const double system_dimensions_x, | ||
const double system_dimensions_y, | ||
const double system_dimensions_z, | ||
const std::vector<double>& atom_coords_x, | ||
const std::vector<double>& atom_coords_y, | ||
const std::vector<double>& atom_coords_z, | ||
const std::vector<int>& atom_type_array, | ||
const int num_local_atoms, | ||
const double starting_temperature, | ||
const double pump_power, | ||
const double pump_time, | ||
const double TTG, | ||
const double TTCe, | ||
const double TTCl, | ||
const double dt); | ||
|
||
//----------------------------------------------------------------------------- | ||
// Function to copy localised thermal fields to external field array | ||
//----------------------------------------------------------------------------- | ||
void get_localised_thermal_fields(std::vector<double>& x_total_external_field_array, | ||
std::vector<double>& y_total_external_field_array, | ||
std::vector<double>& z_total_external_field_array, | ||
const int start_index, | ||
const int end_index); | ||
|
||
//----------------------------------------------------------------------------- | ||
// Function for updating localised temperature | ||
//----------------------------------------------------------------------------- | ||
void update_localised_temperature(const double start_from_start); | ||
|
||
//----------------------------------------------------------------------------- | ||
// Function to process input file parameters for ltmp settings | ||
//----------------------------------------------------------------------------- | ||
bool match_input_parameter(std::string const key, std::string const word, std::string const value, std::string const unit, int const line); | ||
|
||
} // end of ltmp namespace | ||
|
||
#endif // LOCALTEMPERATURE_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
//----------------------------------------------------------------------------- | ||
// | ||
// This source file is part of the VAMPIRE open source package under the | ||
// GNU GPL (version 2) licence (see licence file for details). | ||
// | ||
// (c) R F L Evans 2014. All rights reserved. | ||
// | ||
//----------------------------------------------------------------------------- | ||
|
||
// C++ standard library headers | ||
|
||
// Vampire headers | ||
#include "ltmp.hpp" | ||
|
||
// Local temperature pulse headers | ||
#include "internal.hpp" | ||
|
||
namespace ltmp{ | ||
namespace internal{ | ||
//----------------------------------------------------------------------------- | ||
// Shared variables used for the local temperature pulse calculation | ||
//----------------------------------------------------------------------------- | ||
bool enabled=true; //false; /// enable localised local temperature pulse | ||
bool initialised=false; /// flag set if initialised | ||
bool lateral_discretisation=false; /// enable lateral temperature profile | ||
bool vertical_discretisation=true; /// enable vertical temperature profile | ||
bool output_microcell_data=false; /// enable verbose output data for temperature cells | ||
|
||
double micro_cell_size = 10.0; /// lateral size of local temperature microcells (A) | ||
double laser_spot_size = 350.0; /// laser spot size for lateral profile (A) | ||
double penetration_depth = 200.0; /// vertical laser penetration depth | ||
double thermal_conductivity = 11.0; //J/s/m/K | ||
|
||
double pump_power; // laser pump power | ||
double pump_time; // laser pump time (s) | ||
double TTG; // electron-lattice coupling constant | ||
double TTCe; // electron heat capacity (T=0) | ||
double TTCl; // lattice heat capcity | ||
double dt; // time step | ||
|
||
int num_local_atoms; /// number of local atoms (ignores halo atoms in parallel simulation) | ||
int num_cells; /// number of temperature cells | ||
int my_first_cell; /// first cell on my CPU | ||
int my_last_cell; /// last cell on my CPU | ||
|
||
std::vector<int> atom_temperature_index; /// defines which temperature cell applies to atom (including Te or Tp) | ||
std::vector<double> atom_sigma; /// unrolled list of thermal prefactor sqrt(2kBalpha/gamma*mu_s*dt) | ||
|
||
std::vector<int> cell_neighbour_list; // list of cell interactions for heat transfer | ||
std::vector<int> cell_neighbour_start_index; // start index of interactions for cell | ||
std::vector<int> cell_neighbour_end_index; // end index of interactions for cell | ||
|
||
std::vector<double> x_field_array; /// arrays to store atomic temperature field | ||
std::vector<double> y_field_array; | ||
std::vector<double> z_field_array; | ||
|
||
std::vector<double> root_temperature_array; /// stored as pairs sqrt(Te), sqrt(Tp) (2 x number of cells) MIRRORED on all CPUs | ||
std::vector<double> cell_position_array; /// position of cells in x,y,z (3*n) MIRRORED on all CPUs // dont need this | ||
std::vector<double> delta_temperature_array; /// stored as pairs dTe, dTp LOCAL CPU only | ||
std::vector<double> attenuation_array; /// factor reducng incident laser fluence for each cell LOCAL CPU only | ||
|
||
//std::vector<double> material_kerr_sensitivity_depth; // unrolled list of kerr sensitivity depths for each material | ||
|
||
} // end of internal namespace | ||
} // end of ltmp namespace | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
//----------------------------------------------------------------------------- | ||
// | ||
// This source file is part of the VAMPIRE open source package under the | ||
// GNU GPL (version 2) licence (see licence file for details). | ||
// | ||
// (c) R F L Evans 2014. All rights reserved. | ||
// | ||
//----------------------------------------------------------------------------- | ||
|
||
// C++ standard library headers | ||
|
||
// Vampire headers | ||
#include "ltmp.hpp" | ||
#include "random.hpp" | ||
|
||
// Local temperature pulse headers | ||
#include "internal.hpp" | ||
|
||
namespace ltmp{ | ||
|
||
//----------------------------------------------------------------------------- | ||
// Function for updating local temperature fields | ||
//----------------------------------------------------------------------------- | ||
void update_localised_temperature(const double time_from_start){ | ||
|
||
// calculate local temperature | ||
ltmp::internal::calculate_local_temperature(time_from_start); | ||
|
||
// store number of local atoms as local constant for compiler | ||
const int num_local_atoms = ltmp::internal::num_local_atoms; | ||
|
||
// Initialise thermal field random numbers | ||
generate (ltmp::internal::x_field_array.begin(),ltmp::internal::x_field_array.begin()+num_local_atoms, mtrandom::gaussian); | ||
generate (ltmp::internal::y_field_array.begin(),ltmp::internal::y_field_array.begin()+num_local_atoms, mtrandom::gaussian); | ||
generate (ltmp::internal::z_field_array.begin(),ltmp::internal::z_field_array.begin()+num_local_atoms, mtrandom::gaussian); | ||
|
||
// calculate local thermal field for all atoms | ||
for(int atom=0; atom<ltmp::internal::num_local_atoms; ++atom) { | ||
const int cell = ltmp::internal::atom_temperature_index[atom]; /// get cell index for atom temperature (Te or Tp) | ||
const double rootT = ltmp::internal::root_temperature_array[cell]; /// get sqrt(T) for atom | ||
const double sigma = ltmp::internal::atom_sigma[atom]; /// unrolled list of thermal prefactor | ||
|
||
ltmp::internal::x_field_array[atom]*= sigma*rootT; | ||
ltmp::internal::y_field_array[atom]*= sigma*rootT; | ||
ltmp::internal::z_field_array[atom]*= sigma*rootT; | ||
} | ||
|
||
return; | ||
} | ||
|
||
//----------------------------------------------------------------------------- | ||
// Function for adding local thermal fields to external field array | ||
//----------------------------------------------------------------------------- | ||
void get_localised_thermal_fields(std::vector<double>& x_total_external_field_array, | ||
std::vector<double>& y_total_external_field_array, | ||
std::vector<double>& z_total_external_field_array, | ||
const int start_index, | ||
const int end_index){ | ||
|
||
// Add spin torque fields | ||
for(int i=start_index; i<end_index; ++i) x_total_external_field_array[i] += ltmp::internal::x_field_array[i]; | ||
for(int i=start_index; i<end_index; ++i) y_total_external_field_array[i] += ltmp::internal::y_field_array[i]; | ||
for(int i=start_index; i<end_index; ++i) z_total_external_field_array[i] += ltmp::internal::z_field_array[i]; | ||
|
||
return; | ||
} | ||
|
||
} // end of ltmp namespace |
Oops, something went wrong.