Skip to content

Commit

Permalink
Minor adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
anufrievroman committed Feb 28, 2024
1 parent 9428c12 commit 14173a9
Show file tree
Hide file tree
Showing 6 changed files with 116 additions and 19 deletions.
20 changes: 9 additions & 11 deletions examples/fishbone_nanowire.py → examples/scattering_map.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
"""Config file to simulate a fishbone nanowire in Si at 4K"""
"""Config file to simulate a scattering map in a fishbone nanowire in Si at 50 K"""

# General parameters:
OUTPUT_FOLDER_NAME = 'Fishbone nanowire'
NUMBER_OF_PHONONS = 3000
T = 4.0
OUTPUT_FOLDER_NAME = 'Scattering map in fishbone nanowire'
NUMBER_OF_PHONONS = 300
T = 50.0
OUTPUT_SCATTERING_MAP = True

# Multiprocessing
NUMBER_OF_PROCESSES = 10

# Simulation time parameters:
TIMESTEP = 1.0e-12
NUMBER_OF_TIMESTEPS = 100000
NUMBER_OF_VIRTUAL_TIMESTEPS = NUMBER_OF_TIMESTEPS*4
NUMBER_OF_STABILIZATION_TIMEFRAMES = 5
NUMBER_OF_TIMEFRAMES = 8
NUMBER_OF_TIMESTEPS = 10000

# System dimensions [m]:
THICKNESS = 150e-9
THICKNESS = 200e-9
WIDTH = 500e-9
LENGTH = 1500e-9
LENGTH = 600e-9

# Map & profiles parameters:
pixel_size = 10e-9
Expand Down Expand Up @@ -52,7 +50,7 @@
PERIOD_X = WIDTH
PERIOD_Y = 300e-9
NUMBER_OF_PERIODS_X = 2
NUMBER_OF_PERIODS_Y = 6
NUMBER_OF_PERIODS_Y = 3
for i in range(NUMBER_OF_PERIODS_Y):
for j in range(NUMBER_OF_PERIODS_X):
x_coor = -(NUMBER_OF_PERIODS_X - 1) * PERIOD_X / 2 + j * PERIOD_X
Expand Down
1 change: 0 additions & 1 deletion freepaths/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ def check_parameter_validity(self):
"""Check if various parameters are valid"""
if self.number_of_phonons < self.output_trajectories_of_first:
self.output_trajectories_of_first = self.number_of_phonons
print("WARNING: Parameter OUTPUT_TRAJECTORIES_OF_FIRST exceeded NUMBER_OF_PHONONS.\n")

if self.number_of_timeframes <= self.number_of_stabilization_timeframes:
print("ERROR: Parameter NUMBER_OF_STABILIZATION_TIMEFRAMES exceeds or equal to NUMBER_OF_TIMEFRAMES.")
Expand Down
4 changes: 2 additions & 2 deletions freepaths/main_mfp_sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,5 +120,5 @@ def main(input_file):
output_parameter_warnings()

sys.stdout.write(f'\rSee the results in {Fore.GREEN}Results/{cf.output_folder_name}{Style.RESET_ALL}\n')
sys.stdout.write(f"\rThermal conductivity = {Fore.GREEN}{total_thermal_conductivity}{Style.RESET_ALL}\n W/m·K")
sys.stdout.write(f"\r{Fore.BLUE}Thank you for using FreePATHS{Style.RESET_ALL}\n")
sys.stdout.write(f"\rThermal conductivity = {Fore.GREEN}{total_thermal_conductivity:.5f}{Style.RESET_ALL} W/m·K\n")
sys.stdout.write(f"\r{Fore.BLUE}Thank you for using FreePATHS{Style.RESET_ALL}\n\n")
5 changes: 3 additions & 2 deletions freepaths/maps.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,9 @@ def calculate_thermal_conductivity(self):
J_material = np.mean(self.material_heat_flux_profile_y[:, timeframe_number])

# By definition, J = -K * grad(T), so:
self.effective_thermal_conductivity[timeframe_number, 1] = J_effective / grad_T
self.material_thermal_conductivity[timeframe_number, 1] = J_material / grad_T
if grad_T != 0:
self.effective_thermal_conductivity[timeframe_number, 1] = J_effective / grad_T
self.material_thermal_conductivity[timeframe_number, 1] = J_material / grad_T

# Calculate single averaged value in the steady state range:
self.av_effective_thermal_conductivity = np.mean(self.effective_thermal_conductivity[cf.number_of_stabilization_timeframes:, 1])
Expand Down
6 changes: 3 additions & 3 deletions freepaths/output_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,9 @@ def plot_scattering_map():
fig, ax = plt.subplots()
filename = "Data/Scattering map.csv"
spec_x, spec_y, diff_x, diff_y, int_x, int_y = np.genfromtxt(filename, unpack=True, delimiter=',', skip_header=1, encoding='utf-8')
ax.plot(np.trim_zeros(diff_x, 'b'), np.trim_zeros(diff_y, 'b'), 'o', color='b', markersize=0.1, alpha=0.3)
ax.plot(np.trim_zeros(spec_x, 'b'), np.trim_zeros(spec_y, 'b'), 'o', color='g', markersize=0.1, alpha=0.3)
ax.plot(np.trim_zeros(int_x, 'b'), np.trim_zeros(int_y, 'b'), 'o', color='r', markersize=0.1, alpha=0.3)
ax.plot(np.trim_zeros(diff_x, 'b')*1e6, np.trim_zeros(diff_y, 'b')*1e6, 'o', color='b', markersize=0.1, alpha=0.3)
ax.plot(np.trim_zeros(spec_x, 'b')*1e6, np.trim_zeros(spec_y, 'b')*1e6, 'o', color='g', markersize=0.1, alpha=0.3)
ax.plot(np.trim_zeros(int_x, 'b')*1e6, np.trim_zeros(int_y, 'b')*1e6, 'o', color='r', markersize=0.1, alpha=0.3)
ax.set_xlabel('x (μm)')
ax.set_ylabel('y (μm)')
ax.legend(["Diffuse", "Specular", "Internal"])
Expand Down
99 changes: 99 additions & 0 deletions other/schemes/scattering_map.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 14173a9

Please sign in to comment.