freepaths 2.2__tar.gz → 2.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {freepaths-2.2 → freepaths-2.2.2}/PKG-INFO +1 -1
- {freepaths-2.2 → freepaths-2.2.2}/freepaths/__main__.py +4 -5
- {freepaths-2.2 → freepaths-2.2.2}/freepaths/main_mfp_sampling.py +7 -3
- {freepaths-2.2 → freepaths-2.2.2}/freepaths/run_particle.py +0 -2
- {freepaths-2.2 → freepaths-2.2.2}/freepaths/scattering.py +20 -2
- {freepaths-2.2 → freepaths-2.2.2}/freepaths.egg-info/PKG-INFO +1 -1
- {freepaths-2.2 → freepaths-2.2.2}/README.md +0 -0
- {freepaths-2.2 → freepaths-2.2.2}/freepaths/animation.py +0 -0
- {freepaths-2.2 → freepaths-2.2.2}/freepaths/config.py +0 -0
- {freepaths-2.2 → freepaths-2.2.2}/freepaths/data.py +0 -0
- {freepaths-2.2 → freepaths-2.2.2}/freepaths/default_config.py +0 -0
- {freepaths-2.2 → freepaths-2.2.2}/freepaths/electron.py +0 -0
- {freepaths-2.2 → freepaths-2.2.2}/freepaths/flight.py +0 -0
- {freepaths-2.2 → freepaths-2.2.2}/freepaths/interface_smmm.py +0 -0
- {freepaths-2.2 → freepaths-2.2.2}/freepaths/main_tracing.py +0 -0
- {freepaths-2.2 → freepaths-2.2.2}/freepaths/maps.py +0 -0
- {freepaths-2.2 → freepaths-2.2.2}/freepaths/materials.py +0 -0
- {freepaths-2.2 → freepaths-2.2.2}/freepaths/move.py +0 -0
- {freepaths-2.2 → freepaths-2.2.2}/freepaths/output_info.py +0 -0
- {freepaths-2.2 → freepaths-2.2.2}/freepaths/output_plots.py +0 -0
- {freepaths-2.2 → freepaths-2.2.2}/freepaths/output_structure.py +0 -0
- {freepaths-2.2 → freepaths-2.2.2}/freepaths/particle.py +0 -0
- {freepaths-2.2 → freepaths-2.2.2}/freepaths/particle_types.py +0 -0
- {freepaths-2.2 → freepaths-2.2.2}/freepaths/phonon.py +0 -0
- {freepaths-2.2 → freepaths-2.2.2}/freepaths/post_computations.py +0 -0
- {freepaths-2.2 → freepaths-2.2.2}/freepaths/progress.py +0 -0
- {freepaths-2.2 → freepaths-2.2.2}/freepaths/scatterers.py +0 -0
- {freepaths-2.2 → freepaths-2.2.2}/freepaths/scattering_interfaces.py +0 -0
- {freepaths-2.2 → freepaths-2.2.2}/freepaths/scattering_primitives.py +0 -0
- {freepaths-2.2 → freepaths-2.2.2}/freepaths/scattering_semicircle.py +0 -0
- {freepaths-2.2 → freepaths-2.2.2}/freepaths/scattering_types.py +0 -0
- {freepaths-2.2 → freepaths-2.2.2}/freepaths/sources.py +0 -0
- {freepaths-2.2 → freepaths-2.2.2}/freepaths.egg-info/SOURCES.txt +0 -0
- {freepaths-2.2 → freepaths-2.2.2}/freepaths.egg-info/dependency_links.txt +0 -0
- {freepaths-2.2 → freepaths-2.2.2}/freepaths.egg-info/entry_points.txt +0 -0
- {freepaths-2.2 → freepaths-2.2.2}/freepaths.egg-info/requires.txt +0 -0
- {freepaths-2.2 → freepaths-2.2.2}/freepaths.egg-info/top_level.txt +0 -0
- {freepaths-2.2 → freepaths-2.2.2}/pyproject.toml +0 -0
- {freepaths-2.2 → freepaths-2.2.2}/setup.cfg +0 -0
- {freepaths-2.2 → freepaths-2.2.2}/setup.py +0 -0
|
@@ -4,8 +4,9 @@ import argparse
|
|
|
4
4
|
import colorama
|
|
5
5
|
from colorama import Fore, Style
|
|
6
6
|
|
|
7
|
+
from freepaths.particle_types import ParticleType
|
|
7
8
|
|
|
8
|
-
__version__ = "2.2"
|
|
9
|
+
__version__ = "2.2.2"
|
|
9
10
|
|
|
10
11
|
colorama.init()
|
|
11
12
|
|
|
@@ -16,7 +17,7 @@ parser = argparse.ArgumentParser(
|
|
|
16
17
|
epilog = 'For more information, examples, and tutorials, visit: https://anufrievroman.gitbook.io/freepaths'
|
|
17
18
|
)
|
|
18
19
|
parser.add_argument('input_file', nargs='?', default=None, help='The input file')
|
|
19
|
-
parser.add_argument("-s", "--sampling", help="Run in MFP sampling mode", action="store_true")
|
|
20
|
+
parser.add_argument("-s", "--sampling", help="Run in phonon MFP sampling mode", action="store_true")
|
|
20
21
|
parser.add_argument("-e", "--electron", help="Run simulation for electrons", action="store_true")
|
|
21
22
|
args = parser.parse_args()
|
|
22
23
|
|
|
@@ -26,16 +27,14 @@ def run():
|
|
|
26
27
|
print(f"\n{Fore.BLUE}FreePATHS v{__version__}{Style.RESET_ALL}")
|
|
27
28
|
if args.sampling:
|
|
28
29
|
import freepaths.main_mfp_sampling
|
|
29
|
-
freepaths.main_mfp_sampling.main(args.input_file)
|
|
30
|
+
freepaths.main_mfp_sampling.main(args.input_file, ParticleType.PHONON)
|
|
30
31
|
|
|
31
32
|
elif args.electron:
|
|
32
33
|
import freepaths.main_tracing
|
|
33
|
-
from freepaths.particle_types import ParticleType
|
|
34
34
|
freepaths.main_tracing.main(args.input_file, ParticleType.ELECTRON)
|
|
35
35
|
|
|
36
36
|
else:
|
|
37
37
|
import freepaths.main_tracing
|
|
38
|
-
from freepaths.particle_types import ParticleType
|
|
39
38
|
freepaths.main_tracing.main(args.input_file, ParticleType.PHONON)
|
|
40
39
|
|
|
41
40
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"""Module to run thermal conductivity calculations by integrating the phonon dispersion"""
|
|
2
2
|
|
|
3
3
|
import os
|
|
4
|
+
import numpy as np
|
|
4
5
|
import sys
|
|
5
6
|
import time
|
|
6
7
|
import shutil
|
|
@@ -15,15 +16,16 @@ from freepaths.config import cf
|
|
|
15
16
|
from freepaths.run_particle import run_particle
|
|
16
17
|
from freepaths.phonon import Phonon
|
|
17
18
|
from freepaths.flight import Flight
|
|
19
|
+
from freepaths.particle_types import ParticleType
|
|
18
20
|
from freepaths.data import ScatteringData, GeneralData, SegmentData, PathData, TriangleScatteringData
|
|
19
21
|
from freepaths.progress import Progress
|
|
20
|
-
from freepaths.materials import Si, SiC, Graphite, Ge
|
|
22
|
+
from freepaths.materials import Si, SiC, Graphite, Ge
|
|
21
23
|
from freepaths.maps import ScatteringMap, ThermalMaps
|
|
22
24
|
from freepaths.output_info import output_general_information, output_scattering_information, output_parameter_warnings
|
|
23
25
|
from freepaths.output_plots import plot_data
|
|
24
26
|
|
|
25
27
|
|
|
26
|
-
def main(input_file):
|
|
28
|
+
def main(input_file, particle_type):
|
|
27
29
|
"""This is the main function, which integrates phonon dispersion to get thermal conductivity"""
|
|
28
30
|
|
|
29
31
|
print(f'Mean free path sampling of {Fore.GREEN}{cf.output_folder_name}{Style.RESET_ALL}')
|
|
@@ -36,7 +38,7 @@ def main(input_file):
|
|
|
36
38
|
|
|
37
39
|
# -------- has to be modified fro have only SiGe values and not a mix between Ge and SiGe------------
|
|
38
40
|
elif cf.media == "Ge":
|
|
39
|
-
material = Ge(cf.temp, num_points=cf.number_of_particles +1)
|
|
41
|
+
material = Ge(cf.temp, num_points=cf.number_of_particles +1)
|
|
40
42
|
# -------- has to be modified fro have only SiGe values and not a mix between Ge and SiGe------------
|
|
41
43
|
|
|
42
44
|
elif cf.media == "SiC":
|
|
@@ -112,6 +114,7 @@ def main(input_file):
|
|
|
112
114
|
scatter_stats.write_into_files()
|
|
113
115
|
segment_stats.write_into_files()
|
|
114
116
|
thermal_maps.write_into_files()
|
|
117
|
+
|
|
115
118
|
scatter_maps.write_into_files()
|
|
116
119
|
path_stats.write_into_files()
|
|
117
120
|
|
|
@@ -128,6 +131,7 @@ def main(input_file):
|
|
|
128
131
|
output_scattering_information(scatter_stats)
|
|
129
132
|
output_parameter_warnings()
|
|
130
133
|
|
|
134
|
+
np.savetxt("Data/Thermal conductivity from MFP.csv", np.array([total_thermal_conductivity]), fmt='%2.4e', header="K [W/mK]", encoding='utf-8')
|
|
131
135
|
sys.stdout.write(f'\rSee the results in {Fore.GREEN}Results/{cf.output_folder_name}{Style.RESET_ALL}\n')
|
|
132
136
|
sys.stdout.write(f"\rThermal conductivity = {Fore.GREEN}{total_thermal_conductivity:.5f}{Style.RESET_ALL} W/m·K\n")
|
|
133
137
|
sys.stdout.write(f"\r{Fore.BLUE}Thank you for using FreePATHS{Style.RESET_ALL}\n\n")
|
|
@@ -56,8 +56,6 @@ def run_particle(particle, flight, scatter_stats, places_stats, segment_stats, t
|
|
|
56
56
|
flight.save_free_paths()
|
|
57
57
|
flight.restart()
|
|
58
58
|
particle.assign_internal_scattering_time(material)
|
|
59
|
-
if cf.is_two_dimensional_material:
|
|
60
|
-
particle.phi = 0.0
|
|
61
59
|
|
|
62
60
|
# If hole scattering has occured, record it:
|
|
63
61
|
if triangle_scattering_places.is_scattered:
|
|
@@ -12,12 +12,18 @@ from freepaths.move import move
|
|
|
12
12
|
from freepaths.scattering_primitives import *
|
|
13
13
|
|
|
14
14
|
|
|
15
|
+
def correction_for_two_dimensional_materials(pt):
|
|
16
|
+
"""Bring phi back to zero if a scattering happened"""
|
|
17
|
+
if cf.is_two_dimensional_material:
|
|
18
|
+
pt.phi = 0.0
|
|
19
|
+
|
|
20
|
+
|
|
15
21
|
def internal_scattering(pt, flight, scattering_types):
|
|
16
22
|
"""Check if the time passed since previous diffuse scattering event reached
|
|
17
23
|
the time until an internal scattering event, and if yes, scatters randomly"""
|
|
18
24
|
if flight.time_since_previous_scattering >= pt.time_of_internal_scattering:
|
|
19
25
|
scattering_types.internal = random_scattering(pt)
|
|
20
|
-
|
|
26
|
+
correction_for_two_dimensional_materials(pt)
|
|
21
27
|
|
|
22
28
|
def reinitialization(pt, scattering_types):
|
|
23
29
|
"""Re-thermalize (diffusely) particle when it comes back to one of the hot sides. Return true of particle was reinitialized"""
|
|
@@ -25,18 +31,22 @@ def reinitialization(pt, scattering_types):
|
|
|
25
31
|
|
|
26
32
|
if cf.hot_side_position_bottom and y < 0:
|
|
27
33
|
scattering_types.hot_side = horizontal_surface_up_scattering(pt, cf.side_wall_roughness, is_diffuse=True)
|
|
34
|
+
correction_for_two_dimensional_materials(pt)
|
|
28
35
|
return True
|
|
29
36
|
|
|
30
37
|
if cf.hot_side_position_top and y > cf.length:
|
|
31
38
|
scattering_types.hot_side = horizontal_surface_down_scattering(pt, cf.side_wall_roughness, is_diffuse=True)
|
|
39
|
+
correction_for_two_dimensional_materials(pt)
|
|
32
40
|
return True
|
|
33
41
|
|
|
34
42
|
if cf.hot_side_position_right and x > cf.width / 2:
|
|
35
43
|
scattering_types.hot_side = vertical_surface_left_scattering(pt, cf.side_wall_roughness, cf, is_diffuse=True)
|
|
44
|
+
correction_for_two_dimensional_materials(pt)
|
|
36
45
|
return True
|
|
37
46
|
|
|
38
47
|
if cf.hot_side_position_left and x < -cf.width / 2:
|
|
39
48
|
scattering_types.hot_side = vertical_surface_right_scattering(pt, cf.side_wall_roughness, cf, is_diffuse=True)
|
|
49
|
+
correction_for_two_dimensional_materials(pt)
|
|
40
50
|
return True
|
|
41
51
|
|
|
42
52
|
return False
|
|
@@ -100,9 +110,13 @@ def surface_scattering(pt, scattering_types, triangle_scattering_places):
|
|
|
100
110
|
# Preliminary move to see if particle would cross something:
|
|
101
111
|
x, y, z = move(pt, cf.timestep)
|
|
102
112
|
|
|
103
|
-
# Scattering on top
|
|
113
|
+
# Scattering on top surface:
|
|
104
114
|
ceiling_scattering(pt, scattering_types, x, y, z)
|
|
115
|
+
correction_for_two_dimensional_materials(pt)
|
|
116
|
+
|
|
117
|
+
# Scattering on top surface:
|
|
105
118
|
floor_scattering(pt, scattering_types, x, y, z)
|
|
119
|
+
correction_for_two_dimensional_materials(pt)
|
|
106
120
|
|
|
107
121
|
# Scattering on sidewalls:
|
|
108
122
|
if cf.include_right_sidewall:
|
|
@@ -113,6 +127,7 @@ def surface_scattering(pt, scattering_types, triangle_scattering_places):
|
|
|
113
127
|
scattering_on_top_sidewall(pt, scattering_types, x, y, z)
|
|
114
128
|
if cf.include_bottom_sidewall:
|
|
115
129
|
scattering_on_bottom_sidewall(pt, scattering_types, x, y, z)
|
|
130
|
+
correction_for_two_dimensional_materials(pt)
|
|
116
131
|
|
|
117
132
|
# Scattering on holes:
|
|
118
133
|
if cf.holes:
|
|
@@ -120,6 +135,7 @@ def surface_scattering(pt, scattering_types, triangle_scattering_places):
|
|
|
120
135
|
for hole in cf.holes:
|
|
121
136
|
if hole.is_inside(x, y, z, cf):
|
|
122
137
|
hole.scatter(pt, scattering_types, x, y, z, cf)
|
|
138
|
+
correction_for_two_dimensional_materials(pt)
|
|
123
139
|
|
|
124
140
|
# If there was any scattering, then no need to check rest of the holes:
|
|
125
141
|
if scattering_types.holes is not None:
|
|
@@ -139,12 +155,14 @@ def surface_scattering(pt, scattering_types, triangle_scattering_places):
|
|
|
139
155
|
for bulk in cf.bulks:
|
|
140
156
|
if bulk.is_crossed(pt, x, y, z):
|
|
141
157
|
bulk.scatter(pt, scattering_types, x, y, z, cf)
|
|
158
|
+
correction_for_two_dimensional_materials(pt)
|
|
142
159
|
|
|
143
160
|
# Scattering on interfaces (thin layers):
|
|
144
161
|
if cf.interfaces:
|
|
145
162
|
for interface in cf.interfaces:
|
|
146
163
|
if interface.is_crossed(pt, x, y, z):
|
|
147
164
|
interface.scatter(pt, cf, scattering_types)
|
|
165
|
+
correction_for_two_dimensional_materials(pt)
|
|
148
166
|
|
|
149
167
|
# If there was any scattering, then no need to check other interfaces:
|
|
150
168
|
if scattering_types.interfaces is not None:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|