tubular-reactor 0.1.0__py3-none-any.whl
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.
- tubular_reactor/__init__.py +13 -0
- tubular_reactor/analytics/gc.py +256 -0
- tubular_reactor/reactors/__init__.py +4 -0
- tubular_reactor/reactors/reactor.py +158 -0
- tubular_reactor/reactors/substances.py +59 -0
- tubular_reactor-0.1.0.dist-info/METADATA +323 -0
- tubular_reactor-0.1.0.dist-info/RECORD +10 -0
- tubular_reactor-0.1.0.dist-info/WHEEL +5 -0
- tubular_reactor-0.1.0.dist-info/licenses/LICENSE +274 -0
- tubular_reactor-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# from .gc_perkin_elmer import gc_pe_read, str_to_dt
|
|
2
|
+
#
|
|
3
|
+
# __all__ = ["gc_pe_read", "str_to_dt"]
|
|
4
|
+
|
|
5
|
+
# from .reactors import reactor, substances
|
|
6
|
+
# from .analytics import gc_perkin_elmer
|
|
7
|
+
#
|
|
8
|
+
# __all__ = [
|
|
9
|
+
# "reactor", "substances",
|
|
10
|
+
# "gc_perkin_elmer"]
|
|
11
|
+
|
|
12
|
+
# from . import gc_testing
|
|
13
|
+
# __all__ = ["gc_testing"]
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import re
|
|
2
|
+
from collections import deque
|
|
3
|
+
import datetime as dt
|
|
4
|
+
from typing import Literal
|
|
5
|
+
|
|
6
|
+
import numpy as np
|
|
7
|
+
import numpy.typing as npt
|
|
8
|
+
import pandas as pd
|
|
9
|
+
from pybaselines import Baseline
|
|
10
|
+
from scipy.signal import find_peaks
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def read_perkin_elmer(filepath: str) -> tuple[npt.NDArray[np.timedelta64], npt.NDArray[np.float64]]:
|
|
14
|
+
#TODO: Add time milliseconds
|
|
15
|
+
"""
|
|
16
|
+
Reads the
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
n_header: int = 47
|
|
20
|
+
n_footer: int = 530
|
|
21
|
+
start_time = np.datetime64("1970-01-01T00:00:00")
|
|
22
|
+
|
|
23
|
+
# Get information for chromatogram
|
|
24
|
+
with open(filepath, 'r', encoding='utf-8') as file:
|
|
25
|
+
footer = deque(file, maxlen=n_footer)
|
|
26
|
+
|
|
27
|
+
sampling_info: str
|
|
28
|
+
sampling_rate: float | bool = False
|
|
29
|
+
for idx, line in enumerate(footer):
|
|
30
|
+
if line.startswith('\"RATE\"'):
|
|
31
|
+
sampling_info = footer[idx+2]
|
|
32
|
+
sampling_rate = float(sampling_info.split('\"')[1])
|
|
33
|
+
if not sampling_rate:
|
|
34
|
+
print("Sampling rate not found in chromatogram!")
|
|
35
|
+
sampling_rate = 12.5
|
|
36
|
+
print(f"Sampling rate to standart value of {sampling_rate:.1f}.")
|
|
37
|
+
|
|
38
|
+
df_data: pd.DataFrame = pd.read_csv(filepath, engine='python', skiprows=n_header, skipfooter=n_footer)
|
|
39
|
+
signal: npt.NDArray[np.float64] = df_data.values[:, 0]
|
|
40
|
+
samples: npt.NDArray[np.int64] = np.arange(signal.shape[0])
|
|
41
|
+
time: npt.NDArray[np.timedelta64] = start_time + samples * np.timedelta64(int(1e3 / sampling_rate), "ms")
|
|
42
|
+
baseline_fitter = Baseline(time)
|
|
43
|
+
baseline: npt.NDArray[np.float64] = baseline_fitter.asls(
|
|
44
|
+
signal,
|
|
45
|
+
lam=1e6, # smoothness 1e5 - 1e7 (higher = smoother baseline)
|
|
46
|
+
p=0.001 # asymmetry 0.0001 - 0.01 (smaller = ignore peaks more)
|
|
47
|
+
)[0]
|
|
48
|
+
signal_corrected: npt.NDArray[np.float64] = signal - baseline
|
|
49
|
+
|
|
50
|
+
return time, signal_corrected
|
|
51
|
+
|
|
52
|
+
# Functions for conversion between str for input time, int for number of measurement / idx and dt.datetime for visualization
|
|
53
|
+
|
|
54
|
+
def strtime2dt(strtime: str) -> dt.datetime:
|
|
55
|
+
"""
|
|
56
|
+
Conversion from time as string to datetime object
|
|
57
|
+
Parameters:
|
|
58
|
+
string(str): Time in form '%M":%S'.
|
|
59
|
+
"""
|
|
60
|
+
|
|
61
|
+
start_time: dt.datetime = dt.datetime(1970, 1, 1)
|
|
62
|
+
|
|
63
|
+
pattern = r"(\d+):(\d+)(?:[:.](\d{1,3}))?"
|
|
64
|
+
match = re.split(pattern, strtime)
|
|
65
|
+
if match:
|
|
66
|
+
minutes = int(match[1])
|
|
67
|
+
seconds = int(match[2])
|
|
68
|
+
ms_str = match[3] if match[3] else "0"
|
|
69
|
+
milliseconds = int(ms_str.ljust(3, '0')[:3])
|
|
70
|
+
return start_time + dt.timedelta(minutes=minutes, seconds=seconds, milliseconds=milliseconds)
|
|
71
|
+
else:
|
|
72
|
+
print("Invalid time format")
|
|
73
|
+
return start_time
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def strtime2int(strtime: str) -> int:
|
|
77
|
+
sampling_rate: float = 12.5
|
|
78
|
+
# pattern: str = r"(\d+):(\d+)?:\.(\d+)"
|
|
79
|
+
pattern: str = r"(\d+):(\d+)(?:\.(\d{1,3}))?"
|
|
80
|
+
match = re.split(pattern, strtime)
|
|
81
|
+
if match:
|
|
82
|
+
minutes = int(match[1])
|
|
83
|
+
seconds = int(match[2])
|
|
84
|
+
ms_str = match[3] if match[3] else "0"
|
|
85
|
+
milliseconds = int(ms_str.ljust(3, '0')[:3])
|
|
86
|
+
total_value = int(round((minutes * 60 * sampling_rate) + (seconds * sampling_rate) + milliseconds))
|
|
87
|
+
return total_value
|
|
88
|
+
else:
|
|
89
|
+
print("Invalid time format. Use '1:23', '1:23.4', '1:23.400' or '1:23:400")
|
|
90
|
+
return 0
|
|
91
|
+
|
|
92
|
+
def int2dt(index: int) -> str:
|
|
93
|
+
return str(index)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def int2strtime(index: int) -> str:
|
|
98
|
+
sampling_rate: float = 12.5
|
|
99
|
+
seconds, remainder = divmod(index, sampling_rate)
|
|
100
|
+
milliseconds = int(remainder * 1000 / sampling_rate)
|
|
101
|
+
minutes, seconds = map(int, divmod(seconds, 60))
|
|
102
|
+
return f'{minutes}:{seconds:02d}.{milliseconds:03d}'
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
def list_peaks(signal: npt.NDArray[np.float32],
|
|
106
|
+
limit_left: str | int | None = None,
|
|
107
|
+
limit_right: str | int | None = None,
|
|
108
|
+
# Pead finding
|
|
109
|
+
min_height: float = 2500,
|
|
110
|
+
min_distance: float = 25,
|
|
111
|
+
min_width: float = 5,
|
|
112
|
+
return_type: Literal['index', 'time'] = 'index') -> list[int | str]:
|
|
113
|
+
"""
|
|
114
|
+
Find peaks in chromatogram and optionally return only those from a given range.
|
|
115
|
+
Parameters:
|
|
116
|
+
min_height(float): Minimum height of peak.
|
|
117
|
+
min_distance(float): Minimum distance between two peaks.
|
|
118
|
+
min_width(float): Minimum width of peak. If lower, peak is getting ignored as noise.
|
|
119
|
+
# min_prominence(float):
|
|
120
|
+
# wlen(int): Window length around peak for selection of
|
|
121
|
+
"""
|
|
122
|
+
#TODO: Check if lower distance value results in overseen peak of if peaks are getting combines as one
|
|
123
|
+
peaks_cut = []
|
|
124
|
+
peaks, _ = find_peaks(signal,
|
|
125
|
+
height=min_height,
|
|
126
|
+
distance=min_distance,
|
|
127
|
+
width=min_width)
|
|
128
|
+
|
|
129
|
+
if type(limit_left) == str and type(limit_right) == str:
|
|
130
|
+
try:
|
|
131
|
+
limit_left_int: int = strtime2int(limit_left)
|
|
132
|
+
limit_right_int: int = strtime2int(limit_right)
|
|
133
|
+
peaks = [peak for peak in peaks if limit_left_int <= peak <= limit_right_int]
|
|
134
|
+
except:
|
|
135
|
+
print("Input valid limit for right and left as measurement index like 3820.")
|
|
136
|
+
if type(limit_left) == int and type(limit_right) == int:
|
|
137
|
+
try:
|
|
138
|
+
peaks = [peak for peak in peaks if limit_left <= peak <= limit_right]
|
|
139
|
+
except:
|
|
140
|
+
print("Input valid limit for right and left as time '2:30'.")
|
|
141
|
+
|
|
142
|
+
if return_type == 'time':
|
|
143
|
+
for peak in peaks:
|
|
144
|
+
peaks_cut.append(int2strtime(peak))
|
|
145
|
+
else:
|
|
146
|
+
peaks_cut = peaks
|
|
147
|
+
|
|
148
|
+
return peaks_cut
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
def integrate_peak(chromatogram: npt.NDArray[np.float32],
|
|
152
|
+
timepoint: int | str,
|
|
153
|
+
# For peak finding
|
|
154
|
+
min_height: float=2500,
|
|
155
|
+
min_distance: float=25,
|
|
156
|
+
min_width: float=5,
|
|
157
|
+
# For peak integration
|
|
158
|
+
# min_prominence: float=0.5,
|
|
159
|
+
wlen: float=30,
|
|
160
|
+
output_limit: bool=False):
|
|
161
|
+
"""
|
|
162
|
+
Find peaks in chromatogram and optionally return only those from a given range.
|
|
163
|
+
Parameters:
|
|
164
|
+
min_height(float): Minimum height of peak.
|
|
165
|
+
min_distance(float): Minimum distance between two peaks.
|
|
166
|
+
min_width(float): Minimum width of peak. If lower, peak is getting ignored as noise.
|
|
167
|
+
min_prominence(float):
|
|
168
|
+
wlen(int): Maximum window length for selection of integration limits.
|
|
169
|
+
Adoption of peaks are wider or multiple peaks fall in window length.
|
|
170
|
+
"""
|
|
171
|
+
|
|
172
|
+
if type(timepoint) == str:
|
|
173
|
+
peak_select = strtime2int(timepoint)
|
|
174
|
+
elif type(timepoint) == int or np.int64:
|
|
175
|
+
peak_select = int(timepoint)
|
|
176
|
+
else:
|
|
177
|
+
print('Wrong input for timepoint. Use str or int.')
|
|
178
|
+
return None
|
|
179
|
+
|
|
180
|
+
idx = 0
|
|
181
|
+
while True:
|
|
182
|
+
peaks, props = find_peaks(chromatogram,
|
|
183
|
+
height=min_height,
|
|
184
|
+
distance=min_distance,
|
|
185
|
+
width=min_width,
|
|
186
|
+
# prominence=min_prominence,
|
|
187
|
+
wlen=wlen)
|
|
188
|
+
|
|
189
|
+
right_limits: npt.NDArray = props['right_bases']
|
|
190
|
+
left_limits: npt.NDArray = props['left_bases']
|
|
191
|
+
|
|
192
|
+
# Get limits for selected peak
|
|
193
|
+
left_limit: int = 0
|
|
194
|
+
right_limit: int = 0
|
|
195
|
+
for left_limit, right_limit in zip(left_limits, right_limits):
|
|
196
|
+
if left_limit < peak_select < right_limit:
|
|
197
|
+
break
|
|
198
|
+
|
|
199
|
+
limit_deriviative = 100
|
|
200
|
+
deriviative_chromatogram = np.gradient(chromatogram)
|
|
201
|
+
|
|
202
|
+
# Check for multiple peaks in integration range
|
|
203
|
+
peaks_in_range: int = 0
|
|
204
|
+
for peak in peaks:
|
|
205
|
+
if left_limit < peak < right_limit:
|
|
206
|
+
peaks_in_range += 1
|
|
207
|
+
|
|
208
|
+
if peaks_in_range > 1:
|
|
209
|
+
wlen -= 10
|
|
210
|
+
print("Narrowing integration limits for only integration one peak.")
|
|
211
|
+
if wlen < 20:
|
|
212
|
+
print("Warning: Narrow window length.")
|
|
213
|
+
if idx == 15:
|
|
214
|
+
print(f"No good limits found: {left_limit}, {right_limit}")
|
|
215
|
+
elif peaks_in_range == 0:
|
|
216
|
+
print("No peaks in integration limits detected. Seems odd")
|
|
217
|
+
return 0
|
|
218
|
+
elif deriviative_chromatogram[left_limit - 1] * deriviative_chromatogram[left_limit + 1] < 0 and \
|
|
219
|
+
deriviative_chromatogram[right_limit - 1] * deriviative_chromatogram[right_limit + 1] < 0:
|
|
220
|
+
# Change of sign in deriviative -> minimum between two peaks reached
|
|
221
|
+
print(f"left: {deriviative_chromatogram[left_limit]:.0f} CoS: {deriviative_chromatogram[left_limit - 1] * deriviative_chromatogram[left_limit + 1] < 0}, right: {deriviative_chromatogram[right_limit]:.0f} CoS: {deriviative_chromatogram[right_limit - 1] * deriviative_chromatogram[right_limit + 1] < 0}")
|
|
222
|
+
break
|
|
223
|
+
elif limit_deriviative > abs(deriviative_chromatogram[left_limit]) and limit_deriviative > abs(deriviative_chromatogram[right_limit]):
|
|
224
|
+
print(f"left: {deriviative_chromatogram[left_limit]:.0f}, right: {deriviative_chromatogram[right_limit]:.0f}")
|
|
225
|
+
break
|
|
226
|
+
else:
|
|
227
|
+
# Deriviative still high, end of peak not reached
|
|
228
|
+
wlen += 10
|
|
229
|
+
# print("Increasing window by 10")
|
|
230
|
+
if wlen > 200:
|
|
231
|
+
print("Warning: Wide window length.")
|
|
232
|
+
if idx == 10:
|
|
233
|
+
print(f"No good limits found: {left_limit}, {right_limit}")
|
|
234
|
+
|
|
235
|
+
# print(f"Left limit: {left_limit} deriv {deriviative_chromatogram[left_limit]:.0f}, right limit: {right_limit} \
|
|
236
|
+
# deriv {deriviative_chromatogram[right_limit]:.0f}, wlen: {wlen}")
|
|
237
|
+
|
|
238
|
+
area = np.trapezoid(chromatogram[left_limit:right_limit])
|
|
239
|
+
if output_limit:
|
|
240
|
+
return area, left_limit, right_limit
|
|
241
|
+
else:
|
|
242
|
+
return area
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
def area_peak_range(chroma: npt.NDArray[np.float32],
|
|
246
|
+
limit_left: str,
|
|
247
|
+
limit_right: str,
|
|
248
|
+
) -> int:
|
|
249
|
+
# limit_left_int: int = strtime2int(limit_left_str)
|
|
250
|
+
# limit_right_int: int = strtime2int(limit_right_str)
|
|
251
|
+
peaks: list[int] = list_peaks(chroma, limit_left=limit_left, limit_right=limit_right)
|
|
252
|
+
areas = []
|
|
253
|
+
for peak in peaks:
|
|
254
|
+
area = integrate_peak(chroma, peak)
|
|
255
|
+
areas.append(area)
|
|
256
|
+
return sum(areas)
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
from math import pi as PI, log, sqrt
|
|
2
|
+
from typing import Final
|
|
3
|
+
import numpy as np
|
|
4
|
+
from .substances import Solvent, Solid
|
|
5
|
+
|
|
6
|
+
SEC_PER_MIN: Final[int] = 60 # s/min
|
|
7
|
+
ML_PER_M3: Final[float] = 1e6 # ml/m^3
|
|
8
|
+
INCH_TO_METER: Final[float] = 0.0254 # m/inch
|
|
9
|
+
RE_LAM_LIM: Final[int] = 2300
|
|
10
|
+
DIFFUSION_LIQUID: Final[float] = 1e-9 # m^2/s
|
|
11
|
+
|
|
12
|
+
reactor_outer_diameter: dict[str, float] = {
|
|
13
|
+
"1/8": INCH_TO_METER * 1 / 8,
|
|
14
|
+
"1/16": INCH_TO_METER * 1 / 16,
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
#NOTE: Values for twisting Bodenstein number calculation
|
|
18
|
+
dean_values: list[int] = [10, 20, 30, 40, 50]
|
|
19
|
+
y_axis_values: list[float] = [11, 10.5, 10, 9, 8]
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class Reactor:
|
|
23
|
+
def __init__(self, inner_diameter_mm: float, outer_diameter_inch: float, length: float = 0.0) -> None:
|
|
24
|
+
"""
|
|
25
|
+
Reactor dimensions
|
|
26
|
+
|
|
27
|
+
Parameters:
|
|
28
|
+
inner_diameter_mm (float): Internal reactor diameter in millimeter
|
|
29
|
+
outer_diameter_inch (float): Outer reactor diameter in inch (1/16 or 1/8)
|
|
30
|
+
length (float): Optional, length of reactor in m. Not needed if length is getting calculated.
|
|
31
|
+
"""
|
|
32
|
+
self.inner_diameter: float = inner_diameter_mm / 1e3
|
|
33
|
+
self.outer_diameter: float = outer_diameter_inch * INCH_TO_METER
|
|
34
|
+
self.length: float = length
|
|
35
|
+
self.area: float = PI * self.inner_diameter * length
|
|
36
|
+
self.cross_section_area: float = PI / 4 * self.inner_diameter**2
|
|
37
|
+
|
|
38
|
+
def __str__(self) -> str:
|
|
39
|
+
return f"Reactor with an inner diameter of {self.inner_diameter * 1e3:.2f} mm, outer diamter of \
|
|
40
|
+
{self.outer_diameter * 1e3:.2f} mm and a length of {self.length:.2f} m"
|
|
41
|
+
|
|
42
|
+
def bodenstein(self, flow_rate_mlmin: float, solvent: Solvent, twisting_radius_mm: float | None = None) -> None:
|
|
43
|
+
"""
|
|
44
|
+
Calculate the bodenstein number of the previous defined reactor for a specific flow rate and solvent
|
|
45
|
+
|
|
46
|
+
Parameters:
|
|
47
|
+
flow_rate_mlmin (float): Total flow rate for reactor in ml/min
|
|
48
|
+
solvent (Solvent): Possible solvents like 'Solvent.ethanol' with their material properties from the substances.py file
|
|
49
|
+
twisting_radius(mm): Optional, radius of twisting when working with a twisted reactor based on Erdgogan & Chatwin 1967
|
|
50
|
+
"""
|
|
51
|
+
|
|
52
|
+
self.flow_rate: float = flow_rate_mlmin / (SEC_PER_MIN * ML_PER_M3)
|
|
53
|
+
self.velocity: float = self.flow_rate / self.cross_section_area
|
|
54
|
+
self.tau: float = self.length / self.velocity
|
|
55
|
+
|
|
56
|
+
rho: float = solvent.density
|
|
57
|
+
eta: float = solvent.viscosity
|
|
58
|
+
|
|
59
|
+
self.reynolds_number = rho * self.velocity * self.inner_diameter / eta
|
|
60
|
+
self.diffusion_axial: float = DIFFUSION_LIQUID + (self.velocity**2 * self.inner_diameter**2) / (192 * DIFFUSION_LIQUID)
|
|
61
|
+
self.bodenstein_number: float = self.velocity * self.length / self.diffusion_axial
|
|
62
|
+
print(f"Bodenstein number of straight reactor is {self.bodenstein_number:.1f}.")
|
|
63
|
+
|
|
64
|
+
if twisting_radius_mm:
|
|
65
|
+
twisting_radius: float = twisting_radius_mm / 1000
|
|
66
|
+
dean_number: float = self.reynolds_number * sqrt(self.inner_diameter / (2 * twisting_radius))
|
|
67
|
+
y_axis_value: float = np.interp(dean_number, dean_values, y_axis_values)
|
|
68
|
+
#TODO: Add warning if twisted axial diffusion is not interpolated but extrapolated
|
|
69
|
+
self.diffusion_axial_twisted: float = self.diffusion_axial / ((1 / 192 * 10000) / y_axis_value)
|
|
70
|
+
self.bodenstein_number_twisted: float = self.velocity * self.length / self.diffusion_axial_twisted
|
|
71
|
+
print(f"Bodenstein number of twisted reactor is {self.bodenstein_number_twisted:.1f}.")
|
|
72
|
+
|
|
73
|
+
def time_to_stationary(self, percent_steady: int, n_residence_times: float = 3) -> None:
|
|
74
|
+
"""
|
|
75
|
+
Calculate time until steady state is reached to a certain percentage
|
|
76
|
+
|
|
77
|
+
Paramters:
|
|
78
|
+
percent_steady (int): Quantity value in percent at which the steady state is reached
|
|
79
|
+
n_residence_times (float): Default 3, number of residence times to calculate
|
|
80
|
+
"""
|
|
81
|
+
|
|
82
|
+
# Use diffusion of twisted reactor if that has been previous calculated
|
|
83
|
+
try:
|
|
84
|
+
self.diffusion_axial_twisted
|
|
85
|
+
diffusion_axial = self.diffusion_axial_twisted
|
|
86
|
+
except:
|
|
87
|
+
diffusion_axial = self.diffusion_axial
|
|
88
|
+
|
|
89
|
+
n = 100 # number of spatial nodes
|
|
90
|
+
n_residence_times = 3
|
|
91
|
+
dx = self.length / (n - 1)
|
|
92
|
+
dt = 0.5 * min(dx / self.velocity, dx**2 / (2 * diffusion_axial)) # for explicit stability
|
|
93
|
+
t_max = n_residence_times * self.length / self.velocity
|
|
94
|
+
steps = int(t_max / dt)
|
|
95
|
+
|
|
96
|
+
# Initial concentration profile: fluid A = 0 everywhere
|
|
97
|
+
conc: np.ndarray = np.zeros(n)
|
|
98
|
+
conc_out: np.ndarray = np.zeros(steps)
|
|
99
|
+
|
|
100
|
+
# Time stepping using explicit forward integration on advection-dispersion
|
|
101
|
+
for idx in range(steps):
|
|
102
|
+
conc[0] = 1.0 # inlet switched to fluid B (C=1)
|
|
103
|
+
conc_n = conc.copy()
|
|
104
|
+
for i in range(1, n-1):
|
|
105
|
+
adv = -self.velocity * (conc[i] - conc[i-1]) / dx
|
|
106
|
+
diff = diffusion_axial * (conc[i+1] - 2*conc[i] + conc[i-1]) / dx**2
|
|
107
|
+
conc_n[i] = conc[i] + dt*(adv + diff)
|
|
108
|
+
conc_n[-1] = conc_n[-2]
|
|
109
|
+
conc = conc_n
|
|
110
|
+
conc_out[idx] = conc[-1]
|
|
111
|
+
|
|
112
|
+
# Compute breakthrough time
|
|
113
|
+
value_steady: float = percent_steady / 100
|
|
114
|
+
times = np.linspace(0, t_max, steps)
|
|
115
|
+
t_steady: float = np.interp(value_steady, conc_out, times)
|
|
116
|
+
tau_steady = t_steady / self.tau
|
|
117
|
+
print(f"{percent_steady} % of stationary achieved after {tau_steady:.1f} residence times or {t_steady:.1f} s.")
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
#NOTE: Specify the temperature at the outlet or the remaining temperature difference for wich the length is getting calculated?
|
|
121
|
+
def preheating(self, flow_rate_mlmin: float, initial_temperature_degC: float, outlet_temperature_degC: float,
|
|
122
|
+
cooling_temperature_degC: float, solvent: Solvent, solid: Solid) -> None:
|
|
123
|
+
"""
|
|
124
|
+
Calculate tube length to reach outlet temperature.
|
|
125
|
+
|
|
126
|
+
Parameters:
|
|
127
|
+
flow_rate_mlmin (float): Volume flow rate in ml/min.
|
|
128
|
+
initial_temperature_degC (float): Initial temperature in degree Celsius.
|
|
129
|
+
cooling_temperature_degC (float): Cooling temperature in degree Celsius.
|
|
130
|
+
solvent (Solvent): Possible solvents like'Solvent.ethanol' with their material properties from the substances.py file
|
|
131
|
+
solid (Solid): Possible solvents like 'Solid.ptfe' with their paterial properties from the substances.py file
|
|
132
|
+
"""
|
|
133
|
+
|
|
134
|
+
flow_rate: float = flow_rate_mlmin / (SEC_PER_MIN * ML_PER_M3)
|
|
135
|
+
|
|
136
|
+
rho, cp, eta, lamb = solvent.props()
|
|
137
|
+
tube_lamb: float = solid.thermal_conductivity
|
|
138
|
+
|
|
139
|
+
mass_flow_rate = flow_rate * rho
|
|
140
|
+
velocity = flow_rate / self.cross_section_area
|
|
141
|
+
|
|
142
|
+
reynolds_number = velocity * self.inner_diameter * rho / eta
|
|
143
|
+
if reynolds_number > RE_LAM_LIM:
|
|
144
|
+
print(f"Flow is not fully laminar with a Reynolds number of {reynolds_number:.0f}.")
|
|
145
|
+
nusselt_number = 3.66
|
|
146
|
+
alpha_inner = nusselt_number * lamb / self.inner_diameter
|
|
147
|
+
heat_transfer_coefficient = 1 / (1 / alpha_inner + self.inner_diameter / (2 * tube_lamb)\
|
|
148
|
+
* log(self.outer_diameter / self.inner_diameter))
|
|
149
|
+
|
|
150
|
+
length_outlet_temperature = log((outlet_temperature_degC - cooling_temperature_degC)\
|
|
151
|
+
/ (initial_temperature_degC - cooling_temperature_degC))\
|
|
152
|
+
* -(mass_flow_rate * cp) / (heat_transfer_coefficient * PI * self.inner_diameter)
|
|
153
|
+
print(f"{length_outlet_temperature:.2f} m are needed to reach {outlet_temperature_degC} °C at the outlet.")
|
|
154
|
+
self.length = length_outlet_temperature
|
|
155
|
+
# NOTE: other idea is to calculate temperature based on length
|
|
156
|
+
# outlet_temperature_degC = cooling_temperature_degC + (initial_temperature_degC - cooling_temperature_degC) * exp(-U * self.area / (mass_flow_rate * cp))
|
|
157
|
+
# print(f"Temperature at the outlet is {outlet_temperature_degC:.2f} °C.")
|
|
158
|
+
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Lookup classes for solvents and solids substance data.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from dataclasses import astuple, dataclass
|
|
6
|
+
from enum import Enum
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@dataclass(frozen=True)
|
|
10
|
+
class SolventProps:
|
|
11
|
+
density: float # kg/m^3
|
|
12
|
+
heat_capacity: float # J/(kg*K)
|
|
13
|
+
viscosity: float # Pa*s
|
|
14
|
+
thermal_conductivity: float # W/(m*K)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class Solvent(Enum):
|
|
18
|
+
water = SolventProps(998, 4185, 0.001, 0.598)
|
|
19
|
+
ethanol = SolventProps(789, 2430, 0.01074, 0.167)
|
|
20
|
+
ethylacetate= SolventProps(894, 1920, 0.000423, 0.144)
|
|
21
|
+
thf = SolventProps(890, 1720, 0.000456, 0.120)
|
|
22
|
+
ethylenglycol = SolventProps(1110, 2357, 0.0161, 0.254)
|
|
23
|
+
|
|
24
|
+
def __init__(self, props: SolventProps):
|
|
25
|
+
self.density = props.density
|
|
26
|
+
self.heat_capacity = props.heat_capacity
|
|
27
|
+
self.viscosity = props.viscosity
|
|
28
|
+
self.thermal_conductivity = props.thermal_conductivity
|
|
29
|
+
|
|
30
|
+
def desc(self) -> SolventProps:
|
|
31
|
+
"""Access the dataclass for typing / convenience."""
|
|
32
|
+
return self.value
|
|
33
|
+
|
|
34
|
+
def props(self) -> tuple:
|
|
35
|
+
return astuple(self.value)
|
|
36
|
+
|
|
37
|
+
# # optional convenience properties to avoid writing `.spec.` repeatedly
|
|
38
|
+
# @property
|
|
39
|
+
# def density(self) -> float:
|
|
40
|
+
# return self.heat_capacity
|
|
41
|
+
|
|
42
|
+
@dataclass(frozen=True)
|
|
43
|
+
class SolidsProps:
|
|
44
|
+
thermal_conductivity: float # W/(m^2*K)
|
|
45
|
+
|
|
46
|
+
class Solid(Enum):
|
|
47
|
+
stainlesssteel = SolidsProps(15)
|
|
48
|
+
ptfe = SolidsProps(0.25)
|
|
49
|
+
pfa = SolidsProps(0.209)
|
|
50
|
+
|
|
51
|
+
def __init__(self, props: SolidsProps) -> None:
|
|
52
|
+
self.thermal_conductivity = props.thermal_conductivity
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
if __name__ == "__main__":
|
|
56
|
+
solvent: Solvent = Solvent.water
|
|
57
|
+
rho, cp, eta, lamb = solvent.props()
|
|
58
|
+
print(lamb)
|
|
59
|
+
print(solvent.thermal_conductivity)
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tubular_reactor
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Library for tubular experiments and their evaluation
|
|
5
|
+
Author-email: Clemens Gaa <caeglx@protonmail.com>
|
|
6
|
+
License: European Union Public Licence
|
|
7
|
+
V. 1.2
|
|
8
|
+
|
|
9
|
+
EUPL © the European Union 2007, 2016
|
|
10
|
+
|
|
11
|
+
This European Union Public Licence (the ‘EUPL’) applies to the Work (as
|
|
12
|
+
defined below) which is provided under the terms of this Licence. Any use of
|
|
13
|
+
the Work, other than as authorised under this Licence is prohibited (to the
|
|
14
|
+
extent such use is covered by a right of the copyright holder of the Work).
|
|
15
|
+
|
|
16
|
+
The Work is provided under the terms of this Licence when the Licensor (as
|
|
17
|
+
defined below) has placed the following notice immediately following the
|
|
18
|
+
copyright notice for the Work: “Licensed under the EUPL”, or has expressed by
|
|
19
|
+
any other means his willingness to license under the EUPL.
|
|
20
|
+
|
|
21
|
+
1. Definitions
|
|
22
|
+
|
|
23
|
+
In this Licence, the following terms have the following meaning:
|
|
24
|
+
— ‘The Licence’: this Licence.
|
|
25
|
+
— ‘The Original Work’: the work or software distributed or communicated by the
|
|
26
|
+
‘Licensor under this Licence, available as Source Code and also as
|
|
27
|
+
‘Executable Code as the case may be.
|
|
28
|
+
— ‘Derivative Works’: the works or software that could be created by the
|
|
29
|
+
‘Licensee, based upon the Original Work or modifications thereof. This
|
|
30
|
+
‘Licence does not define the extent of modification or dependence on the
|
|
31
|
+
‘Original Work required in order to classify a work as a Derivative Work;
|
|
32
|
+
‘this extent is determined by copyright law applicable in the country
|
|
33
|
+
‘mentioned in Article 15.
|
|
34
|
+
— ‘The Work’: the Original Work or its Derivative Works.
|
|
35
|
+
— ‘The Source Code’: the human-readable form of the Work which is the most
|
|
36
|
+
convenient for people to study and modify.
|
|
37
|
+
|
|
38
|
+
— ‘The Executable Code’: any code which has generally been compiled and which
|
|
39
|
+
is meant to be interpreted by a computer as a program.
|
|
40
|
+
— ‘The Licensor’: the natural or legal person that distributes or communicates
|
|
41
|
+
the Work under the Licence.
|
|
42
|
+
— ‘Contributor(s)’: any natural or legal person who modifies the Work under
|
|
43
|
+
the Licence, or otherwise contributes to the creation of a Derivative Work.
|
|
44
|
+
— ‘The Licensee’ or ‘You’: any natural or legal person who makes any usage of
|
|
45
|
+
the Work under the terms of the Licence.
|
|
46
|
+
— ‘Distribution’ or ‘Communication’: any act of selling, giving, lending,
|
|
47
|
+
renting, distributing, communicating, transmitting, or otherwise making
|
|
48
|
+
available, online or offline, copies of the Work or providing access to its
|
|
49
|
+
essential functionalities at the disposal of any other natural or legal
|
|
50
|
+
person.
|
|
51
|
+
|
|
52
|
+
2. Scope of the rights granted by the Licence
|
|
53
|
+
|
|
54
|
+
The Licensor hereby grants You a worldwide, royalty-free, non-exclusive,
|
|
55
|
+
sublicensable licence to do the following, for the duration of copyright
|
|
56
|
+
vested in the Original Work:
|
|
57
|
+
|
|
58
|
+
— use the Work in any circumstance and for all usage,
|
|
59
|
+
— reproduce the Work,
|
|
60
|
+
— modify the Work, and make Derivative Works based upon the Work,
|
|
61
|
+
— communicate to the public, including the right to make available or display
|
|
62
|
+
the Work or copies thereof to the public and perform publicly, as the case
|
|
63
|
+
may be, the Work,
|
|
64
|
+
— distribute the Work or copies thereof,
|
|
65
|
+
— lend and rent the Work or copies thereof,
|
|
66
|
+
— sublicense rights in the Work or copies thereof.
|
|
67
|
+
|
|
68
|
+
Those rights can be exercised on any media, supports and formats, whether now
|
|
69
|
+
known or later invented, as far as the applicable law permits so.
|
|
70
|
+
|
|
71
|
+
In the countries where moral rights apply, the Licensor waives his right to
|
|
72
|
+
exercise his moral right to the extent allowed by law in order to make
|
|
73
|
+
effective the licence of the economic rights here above listed.
|
|
74
|
+
|
|
75
|
+
The Licensor grants to the Licensee royalty-free, non-exclusive usage rights
|
|
76
|
+
to any patents held by the Licensor, to the extent necessary to make use of
|
|
77
|
+
the rights granted on the Work under this Licence.
|
|
78
|
+
|
|
79
|
+
3. Communication of the Source Code
|
|
80
|
+
|
|
81
|
+
The Licensor may provide the Work either in its Source Code form, or as
|
|
82
|
+
Executable Code. If the Work is provided as Executable Code, the Licensor
|
|
83
|
+
provides in addition a machine-readable copy of the Source Code of the Work
|
|
84
|
+
along with each copy of the Work that the Licensor distributes or indicates,
|
|
85
|
+
in a notice following the copyright notice attached to the Work, a repository
|
|
86
|
+
where the Source Code is easily and freely accessible for as long as the
|
|
87
|
+
Licensor continues to distribute or communicate the Work.
|
|
88
|
+
|
|
89
|
+
4. Limitations on copyright
|
|
90
|
+
|
|
91
|
+
Nothing in this Licence is intended to deprive the Licensee of the benefits
|
|
92
|
+
from any exception or limitation to the exclusive rights of the rights owners
|
|
93
|
+
in the Work, of the exhaustion of those rights or of other applicable
|
|
94
|
+
limitations thereto.
|
|
95
|
+
|
|
96
|
+
5. Obligations of the Licensee
|
|
97
|
+
|
|
98
|
+
The grant of the rights mentioned above is subject to some restrictions and
|
|
99
|
+
obligations imposed on the Licensee. Those obligations are the following:
|
|
100
|
+
|
|
101
|
+
Attribution right: The Licensee shall keep intact all copyright, patent or
|
|
102
|
+
trademarks notices and all notices that refer to the Licence and to the
|
|
103
|
+
disclaimer of warranties. The Licensee must include a copy of such notices and
|
|
104
|
+
a copy of the Licence with every copy of the Work he/she distributes or
|
|
105
|
+
communicates. The Licensee must cause any Derivative Work to carry prominent
|
|
106
|
+
notices stating that the Work has been modified and the date of modification.
|
|
107
|
+
|
|
108
|
+
Copyleft clause: If the Licensee distributes or communicates copies of the
|
|
109
|
+
Original Works or Derivative Works, this Distribution or Communication will be
|
|
110
|
+
done under the terms of this Licence or of a later version of this Licence
|
|
111
|
+
unless the Original Work is expressly distributed only under this version of
|
|
112
|
+
the Licence — for example by communicating ‘EUPL v. 1.2 only’. The Licensee
|
|
113
|
+
(becoming Licensor) cannot offer or impose any additional terms or conditions
|
|
114
|
+
on the Work or Derivative Work that alter or restrict the terms of the
|
|
115
|
+
Licence.
|
|
116
|
+
|
|
117
|
+
Compatibility clause: If the Licensee Distributes or Communicates Derivative
|
|
118
|
+
Works or copies thereof based upon both the Work and another work licensed
|
|
119
|
+
under a Compatible Licence, this Distribution or Communication can be done
|
|
120
|
+
under the terms of this Compatible Licence. For the sake of this clause,
|
|
121
|
+
‘Compatible Licence’ refers to the licences listed in the appendix attached to
|
|
122
|
+
this Licence. Should the Licensee's obligations under the Compatible Licence
|
|
123
|
+
conflict with his/her obligations under this Licence, the obligations of the
|
|
124
|
+
Compatible Licence shall prevail.
|
|
125
|
+
|
|
126
|
+
Provision of Source Code: When distributing or communicating copies of the
|
|
127
|
+
Work, the Licensee will provide a machine-readable copy of the Source Code or
|
|
128
|
+
indicate a repository where this Source will be easily and freely available
|
|
129
|
+
for as long as the Licensee continues to distribute or communicate the Work.
|
|
130
|
+
|
|
131
|
+
Legal Protection: This Licence does not grant permission to use the trade
|
|
132
|
+
names, trademarks, service marks, or names of the Licensor, except as required
|
|
133
|
+
for reasonable and customary use in describing the origin of the Work and
|
|
134
|
+
reproducing the content of the copyright notice.
|
|
135
|
+
|
|
136
|
+
6. Chain of Authorship
|
|
137
|
+
|
|
138
|
+
The original Licensor warrants that the copyright in the Original Work granted
|
|
139
|
+
hereunder is owned by him/her or licensed to him/her and that he/she has the
|
|
140
|
+
power and authority to grant the Licence.
|
|
141
|
+
|
|
142
|
+
Each Contributor warrants that the copyright in the modifications he/she
|
|
143
|
+
brings to the Work are owned by him/her or licensed to him/her and that he/she
|
|
144
|
+
has the power and authority to grant the Licence.
|
|
145
|
+
|
|
146
|
+
Each time You accept the Licence, the original Licensor and subsequent
|
|
147
|
+
Contributors grant You a licence to their contributions to the Work, under the
|
|
148
|
+
terms of this Licence.
|
|
149
|
+
|
|
150
|
+
7. Disclaimer of Warranty
|
|
151
|
+
|
|
152
|
+
The Work is a work in progress, which is continuously improved by numerous
|
|
153
|
+
Contributors. It is not a finished work and may therefore contain defects or
|
|
154
|
+
‘bugs’ inherent to this type of development.
|
|
155
|
+
|
|
156
|
+
For the above reason, the Work is provided under the Licence on an ‘as is’
|
|
157
|
+
basis and without warranties of any kind concerning the Work, including
|
|
158
|
+
without limitation merchantability, fitness for a particular purpose, absence
|
|
159
|
+
of defects or errors, accuracy, non-infringement of intellectual property
|
|
160
|
+
rights other than copyright as stated in Article 6 of this Licence.
|
|
161
|
+
|
|
162
|
+
This disclaimer of warranty is an essential part of the Licence and a
|
|
163
|
+
condition for the grant of any rights to the Work.
|
|
164
|
+
|
|
165
|
+
8. Disclaimer of Liability
|
|
166
|
+
|
|
167
|
+
Except in the cases of wilful misconduct or damages directly caused to natural
|
|
168
|
+
persons, the Licensor will in no event be liable for any direct or indirect,
|
|
169
|
+
material or moral, damages of any kind, arising out of the Licence or of the
|
|
170
|
+
use of the Work, including without limitation, damages for loss of goodwill,
|
|
171
|
+
work stoppage, computer failure or malfunction, loss of data or any commercial
|
|
172
|
+
damage, even if the Licensor has been advised of the possibility of such
|
|
173
|
+
damage. However, the Licensor will be liable under statutory product liability
|
|
174
|
+
laws as far such laws apply to the Work.
|
|
175
|
+
|
|
176
|
+
9. Additional agreements
|
|
177
|
+
|
|
178
|
+
While distributing the Work, You may choose to conclude an additional
|
|
179
|
+
agreement, defining obligations or services consistent with this Licence.
|
|
180
|
+
However, if accepting obligations, You may act only on your own behalf and on
|
|
181
|
+
your sole responsibility, not on behalf of the original Licensor or any other
|
|
182
|
+
Contributor, and only if You agree to indemnify, defend, and hold each
|
|
183
|
+
Contributor harmless for any liability incurred by, or claims asserted against
|
|
184
|
+
such Contributor by the fact You have accepted any warranty or additional
|
|
185
|
+
liability.
|
|
186
|
+
|
|
187
|
+
10. Acceptance of the Licence
|
|
188
|
+
|
|
189
|
+
The provisions of this Licence can be accepted by clicking on an icon ‘I
|
|
190
|
+
agree’ placed under the bottom of a window displaying the text of this Licence
|
|
191
|
+
or by affirming consent in any other similar way, in accordance with the rules
|
|
192
|
+
of applicable law. Clicking on that icon indicates your clear and irrevocable
|
|
193
|
+
acceptance of this Licence and all of its terms and conditions.
|
|
194
|
+
|
|
195
|
+
Similarly, you irrevocably accept this Licence and all of its terms and
|
|
196
|
+
conditions by exercising any rights granted to You by Article 2 of this
|
|
197
|
+
Licence, such as the use of the Work, the creation by You of a Derivative Work
|
|
198
|
+
or the Distribution or Communication by You of the Work or copies thereof.
|
|
199
|
+
|
|
200
|
+
11. Information to the public
|
|
201
|
+
|
|
202
|
+
In case of any Distribution or Communication of the Work by means of
|
|
203
|
+
electronic communication by You (for example, by offering to download the Work
|
|
204
|
+
from a remote location) the distribution channel or media (for example, a
|
|
205
|
+
website) must at least provide to the public the information requested by the
|
|
206
|
+
applicable law regarding the Licensor, the Licence and the way it may be
|
|
207
|
+
accessible, concluded, stored and reproduced by the Licensee.
|
|
208
|
+
|
|
209
|
+
12. Termination of the Licence
|
|
210
|
+
|
|
211
|
+
The Licence and the rights granted hereunder will terminate automatically upon
|
|
212
|
+
any breach by the Licensee of the terms of the Licence. Such a termination
|
|
213
|
+
will not terminate the licences of any person who has received the Work from
|
|
214
|
+
the Licensee under the Licence, provided such persons remain in full
|
|
215
|
+
compliance with the Licence.
|
|
216
|
+
|
|
217
|
+
13. Miscellaneous
|
|
218
|
+
|
|
219
|
+
Without prejudice of Article 9 above, the Licence represents the complete
|
|
220
|
+
agreement between the Parties as to the Work.
|
|
221
|
+
|
|
222
|
+
If any provision of the Licence is invalid or unenforceable under applicable
|
|
223
|
+
law, this will not affect the validity or enforceability of the Licence as a
|
|
224
|
+
whole. Such provision will be construed or reformed so as necessary to make it
|
|
225
|
+
valid and enforceable.
|
|
226
|
+
|
|
227
|
+
The European Commission may publish other linguistic versions or new versions
|
|
228
|
+
of this Licence or updated versions of the Appendix, so far this is required
|
|
229
|
+
and reasonable, without reducing the scope of the rights granted by the
|
|
230
|
+
Licence. New versions of the Licence will be published with a unique version
|
|
231
|
+
number.
|
|
232
|
+
|
|
233
|
+
All linguistic versions of this Licence, approved by the European Commission,
|
|
234
|
+
have identical value. Parties can take advantage of the linguistic version of
|
|
235
|
+
their choice.
|
|
236
|
+
|
|
237
|
+
14. Jurisdiction
|
|
238
|
+
|
|
239
|
+
Without prejudice to specific agreement between parties,
|
|
240
|
+
— any litigation resulting from the interpretation of this License, arising
|
|
241
|
+
between the European Union institutions, bodies, offices or agencies, as a
|
|
242
|
+
Licensor, and any Licensee, will be subject to the jurisdiction of the Court
|
|
243
|
+
of Justice of the European Union, as laid down in article 272 of the Treaty
|
|
244
|
+
on the Functioning of the European Union,
|
|
245
|
+
— any litigation arising between other parties and resulting from the
|
|
246
|
+
interpretation of this License, will be subject to the exclusive
|
|
247
|
+
jurisdiction of the competent court where the Licensor resides or conducts
|
|
248
|
+
its primary business.
|
|
249
|
+
|
|
250
|
+
15. Applicable Law
|
|
251
|
+
|
|
252
|
+
Without prejudice to specific agreement between parties,
|
|
253
|
+
— this Licence shall be governed by the law of the European Union Member State
|
|
254
|
+
where the Licensor has his seat, resides or has his registered office,
|
|
255
|
+
— this licence shall be governed by Belgian law if the Licensor has no seat,
|
|
256
|
+
residence or registered office inside a European Union Member State.
|
|
257
|
+
|
|
258
|
+
Appendix
|
|
259
|
+
|
|
260
|
+
‘Compatible Licences’ according to Article 5 EUPL are:
|
|
261
|
+
— GNU General Public License (GPL) v. 2, v. 3
|
|
262
|
+
— GNU Affero General Public License (AGPL) v. 3
|
|
263
|
+
— Open Software License (OSL) v. 2.1, v. 3.0
|
|
264
|
+
— Eclipse Public License (EPL) v. 1.0
|
|
265
|
+
— CeCILL v. 2.0, v. 2.1
|
|
266
|
+
— Mozilla Public Licence (MPL) v. 2
|
|
267
|
+
— GNU Lesser General Public Licence (LGPL) v. 2.1, v. 3
|
|
268
|
+
— Creative Commons Attribution-ShareAlike v. 3.0 Unported (CC BY-SA 3.0) for
|
|
269
|
+
works other than software
|
|
270
|
+
— European Union Public Licence (EUPL) v. 1.1, v. 1.2
|
|
271
|
+
— Québec Free and Open-Source Licence — Reciprocity (LiLiQ-R) or
|
|
272
|
+
Strong Reciprocity (LiLiQ-R+)
|
|
273
|
+
|
|
274
|
+
— The European Commission may update this Appendix to later versions of the
|
|
275
|
+
above licences without producing a new version of the EUPL, as long as they
|
|
276
|
+
provide the rights granted in Article 2 of this Licence and protect the
|
|
277
|
+
covered Source Code from exclusive appropriation.
|
|
278
|
+
— All other changes or additions to this Appendix require the production of a
|
|
279
|
+
new EUPL version.
|
|
280
|
+
|
|
281
|
+
Project-URL: Code, https://github.com/caeglx/tubular_reactor
|
|
282
|
+
Keywords: tubular reactor
|
|
283
|
+
Classifier: Development Status :: 3 - Alpha
|
|
284
|
+
Classifier: License :: OSI Approved :: European Union Public Licence 1.2 (EUPL 1.2)
|
|
285
|
+
Classifier: Operating System :: OS Independent
|
|
286
|
+
Classifier: Programming Language :: Python :: 3
|
|
287
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
288
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
289
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
290
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
291
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
292
|
+
Classifier: Topic :: Scientific/Engineering :: Chemistry
|
|
293
|
+
Description-Content-Type: text/markdown
|
|
294
|
+
License-File: LICENSE
|
|
295
|
+
Dynamic: license-file
|
|
296
|
+
|
|
297
|
+
# turbular_reactor_lib
|
|
298
|
+
Collection of functions for microreactor usage
|
|
299
|
+
## Python Set-up
|
|
300
|
+
Should work with Python > 3.9.
|
|
301
|
+
|
|
302
|
+
The simplest way of installing Python in modern Windows 10 and 11 is by using WinGet package manager in the command line (cmd or PowerShell).
|
|
303
|
+
|
|
304
|
+
```bash
|
|
305
|
+
winget install python3.12
|
|
306
|
+
```
|
|
307
|
+
The user has to enable this for the first usage since packages can get installed from untrusted sources.
|
|
308
|
+
Close and reopen PowerShell and verify, that the installation was successfully.
|
|
309
|
+
|
|
310
|
+
```bash
|
|
311
|
+
python --version
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
>Python 3.12.10 or something similar
|
|
315
|
+
|
|
316
|
+
For beginners, the use of Visual Studio Code is recommended since it allows an easy and well documented workflow with Python scripts and Jupyter Notebooks and can also get installed with WinGet.
|
|
317
|
+
|
|
318
|
+
```bash
|
|
319
|
+
winget insall -e --id Microsoft.VisdualStudioCode
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
### Create virtual environment
|
|
323
|
+
To keep a clean environment for a project and to avoid possible package conflicts, it is always recommended to create a Python environment for each project. This is possible from inside Visual Studio Code itself.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
tubular_reactor/__init__.py,sha256=IWjAwXewzmjIaOtUtgA9p7K25eUNEHI5GAS9sD_fz_c,308
|
|
2
|
+
tubular_reactor/analytics/gc.py,sha256=oJV8WLA-U94LeVR9G7tV3xWrEgdfu9XuENXL5N7ZiWo,10202
|
|
3
|
+
tubular_reactor/reactors/__init__.py,sha256=dGTcn9_Qr8Klf8-8XckWGzlVzt4RV2lcJMjvQOPTqpA,118
|
|
4
|
+
tubular_reactor/reactors/reactor.py,sha256=2uBBueI7uM6aBsdacVmYcdFFyovuA2W1ZfcPJLGvHK4,8028
|
|
5
|
+
tubular_reactor/reactors/substances.py,sha256=mMtHU0p8KD-I4tZJWz0s2M1aQybNIvQDL1cAFsMXq0I,1683
|
|
6
|
+
tubular_reactor-0.1.0.dist-info/licenses/LICENSE,sha256=blOZrS9FSNwi3Z7_HDZ9XShu_BVyOJSzo7dyNHtgnRE,13865
|
|
7
|
+
tubular_reactor-0.1.0.dist-info/METADATA,sha256=GiCT-rLzZ1D8eInwokP0Mnq_8ThfdZI8X8ZL5H1UM-E,18002
|
|
8
|
+
tubular_reactor-0.1.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
9
|
+
tubular_reactor-0.1.0.dist-info/top_level.txt,sha256=c7ZzUMF6RWnJv_tXDpKhn1PG176Lp5V9RRZRuVqqFR8,16
|
|
10
|
+
tubular_reactor-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
European Union Public Licence
|
|
2
|
+
V. 1.2
|
|
3
|
+
|
|
4
|
+
EUPL © the European Union 2007, 2016
|
|
5
|
+
|
|
6
|
+
This European Union Public Licence (the ‘EUPL’) applies to the Work (as
|
|
7
|
+
defined below) which is provided under the terms of this Licence. Any use of
|
|
8
|
+
the Work, other than as authorised under this Licence is prohibited (to the
|
|
9
|
+
extent such use is covered by a right of the copyright holder of the Work).
|
|
10
|
+
|
|
11
|
+
The Work is provided under the terms of this Licence when the Licensor (as
|
|
12
|
+
defined below) has placed the following notice immediately following the
|
|
13
|
+
copyright notice for the Work: “Licensed under the EUPL”, or has expressed by
|
|
14
|
+
any other means his willingness to license under the EUPL.
|
|
15
|
+
|
|
16
|
+
1. Definitions
|
|
17
|
+
|
|
18
|
+
In this Licence, the following terms have the following meaning:
|
|
19
|
+
— ‘The Licence’: this Licence.
|
|
20
|
+
— ‘The Original Work’: the work or software distributed or communicated by the
|
|
21
|
+
‘Licensor under this Licence, available as Source Code and also as
|
|
22
|
+
‘Executable Code as the case may be.
|
|
23
|
+
— ‘Derivative Works’: the works or software that could be created by the
|
|
24
|
+
‘Licensee, based upon the Original Work or modifications thereof. This
|
|
25
|
+
‘Licence does not define the extent of modification or dependence on the
|
|
26
|
+
‘Original Work required in order to classify a work as a Derivative Work;
|
|
27
|
+
‘this extent is determined by copyright law applicable in the country
|
|
28
|
+
‘mentioned in Article 15.
|
|
29
|
+
— ‘The Work’: the Original Work or its Derivative Works.
|
|
30
|
+
— ‘The Source Code’: the human-readable form of the Work which is the most
|
|
31
|
+
convenient for people to study and modify.
|
|
32
|
+
|
|
33
|
+
— ‘The Executable Code’: any code which has generally been compiled and which
|
|
34
|
+
is meant to be interpreted by a computer as a program.
|
|
35
|
+
— ‘The Licensor’: the natural or legal person that distributes or communicates
|
|
36
|
+
the Work under the Licence.
|
|
37
|
+
— ‘Contributor(s)’: any natural or legal person who modifies the Work under
|
|
38
|
+
the Licence, or otherwise contributes to the creation of a Derivative Work.
|
|
39
|
+
— ‘The Licensee’ or ‘You’: any natural or legal person who makes any usage of
|
|
40
|
+
the Work under the terms of the Licence.
|
|
41
|
+
— ‘Distribution’ or ‘Communication’: any act of selling, giving, lending,
|
|
42
|
+
renting, distributing, communicating, transmitting, or otherwise making
|
|
43
|
+
available, online or offline, copies of the Work or providing access to its
|
|
44
|
+
essential functionalities at the disposal of any other natural or legal
|
|
45
|
+
person.
|
|
46
|
+
|
|
47
|
+
2. Scope of the rights granted by the Licence
|
|
48
|
+
|
|
49
|
+
The Licensor hereby grants You a worldwide, royalty-free, non-exclusive,
|
|
50
|
+
sublicensable licence to do the following, for the duration of copyright
|
|
51
|
+
vested in the Original Work:
|
|
52
|
+
|
|
53
|
+
— use the Work in any circumstance and for all usage,
|
|
54
|
+
— reproduce the Work,
|
|
55
|
+
— modify the Work, and make Derivative Works based upon the Work,
|
|
56
|
+
— communicate to the public, including the right to make available or display
|
|
57
|
+
the Work or copies thereof to the public and perform publicly, as the case
|
|
58
|
+
may be, the Work,
|
|
59
|
+
— distribute the Work or copies thereof,
|
|
60
|
+
— lend and rent the Work or copies thereof,
|
|
61
|
+
— sublicense rights in the Work or copies thereof.
|
|
62
|
+
|
|
63
|
+
Those rights can be exercised on any media, supports and formats, whether now
|
|
64
|
+
known or later invented, as far as the applicable law permits so.
|
|
65
|
+
|
|
66
|
+
In the countries where moral rights apply, the Licensor waives his right to
|
|
67
|
+
exercise his moral right to the extent allowed by law in order to make
|
|
68
|
+
effective the licence of the economic rights here above listed.
|
|
69
|
+
|
|
70
|
+
The Licensor grants to the Licensee royalty-free, non-exclusive usage rights
|
|
71
|
+
to any patents held by the Licensor, to the extent necessary to make use of
|
|
72
|
+
the rights granted on the Work under this Licence.
|
|
73
|
+
|
|
74
|
+
3. Communication of the Source Code
|
|
75
|
+
|
|
76
|
+
The Licensor may provide the Work either in its Source Code form, or as
|
|
77
|
+
Executable Code. If the Work is provided as Executable Code, the Licensor
|
|
78
|
+
provides in addition a machine-readable copy of the Source Code of the Work
|
|
79
|
+
along with each copy of the Work that the Licensor distributes or indicates,
|
|
80
|
+
in a notice following the copyright notice attached to the Work, a repository
|
|
81
|
+
where the Source Code is easily and freely accessible for as long as the
|
|
82
|
+
Licensor continues to distribute or communicate the Work.
|
|
83
|
+
|
|
84
|
+
4. Limitations on copyright
|
|
85
|
+
|
|
86
|
+
Nothing in this Licence is intended to deprive the Licensee of the benefits
|
|
87
|
+
from any exception or limitation to the exclusive rights of the rights owners
|
|
88
|
+
in the Work, of the exhaustion of those rights or of other applicable
|
|
89
|
+
limitations thereto.
|
|
90
|
+
|
|
91
|
+
5. Obligations of the Licensee
|
|
92
|
+
|
|
93
|
+
The grant of the rights mentioned above is subject to some restrictions and
|
|
94
|
+
obligations imposed on the Licensee. Those obligations are the following:
|
|
95
|
+
|
|
96
|
+
Attribution right: The Licensee shall keep intact all copyright, patent or
|
|
97
|
+
trademarks notices and all notices that refer to the Licence and to the
|
|
98
|
+
disclaimer of warranties. The Licensee must include a copy of such notices and
|
|
99
|
+
a copy of the Licence with every copy of the Work he/she distributes or
|
|
100
|
+
communicates. The Licensee must cause any Derivative Work to carry prominent
|
|
101
|
+
notices stating that the Work has been modified and the date of modification.
|
|
102
|
+
|
|
103
|
+
Copyleft clause: If the Licensee distributes or communicates copies of the
|
|
104
|
+
Original Works or Derivative Works, this Distribution or Communication will be
|
|
105
|
+
done under the terms of this Licence or of a later version of this Licence
|
|
106
|
+
unless the Original Work is expressly distributed only under this version of
|
|
107
|
+
the Licence — for example by communicating ‘EUPL v. 1.2 only’. The Licensee
|
|
108
|
+
(becoming Licensor) cannot offer or impose any additional terms or conditions
|
|
109
|
+
on the Work or Derivative Work that alter or restrict the terms of the
|
|
110
|
+
Licence.
|
|
111
|
+
|
|
112
|
+
Compatibility clause: If the Licensee Distributes or Communicates Derivative
|
|
113
|
+
Works or copies thereof based upon both the Work and another work licensed
|
|
114
|
+
under a Compatible Licence, this Distribution or Communication can be done
|
|
115
|
+
under the terms of this Compatible Licence. For the sake of this clause,
|
|
116
|
+
‘Compatible Licence’ refers to the licences listed in the appendix attached to
|
|
117
|
+
this Licence. Should the Licensee's obligations under the Compatible Licence
|
|
118
|
+
conflict with his/her obligations under this Licence, the obligations of the
|
|
119
|
+
Compatible Licence shall prevail.
|
|
120
|
+
|
|
121
|
+
Provision of Source Code: When distributing or communicating copies of the
|
|
122
|
+
Work, the Licensee will provide a machine-readable copy of the Source Code or
|
|
123
|
+
indicate a repository where this Source will be easily and freely available
|
|
124
|
+
for as long as the Licensee continues to distribute or communicate the Work.
|
|
125
|
+
|
|
126
|
+
Legal Protection: This Licence does not grant permission to use the trade
|
|
127
|
+
names, trademarks, service marks, or names of the Licensor, except as required
|
|
128
|
+
for reasonable and customary use in describing the origin of the Work and
|
|
129
|
+
reproducing the content of the copyright notice.
|
|
130
|
+
|
|
131
|
+
6. Chain of Authorship
|
|
132
|
+
|
|
133
|
+
The original Licensor warrants that the copyright in the Original Work granted
|
|
134
|
+
hereunder is owned by him/her or licensed to him/her and that he/she has the
|
|
135
|
+
power and authority to grant the Licence.
|
|
136
|
+
|
|
137
|
+
Each Contributor warrants that the copyright in the modifications he/she
|
|
138
|
+
brings to the Work are owned by him/her or licensed to him/her and that he/she
|
|
139
|
+
has the power and authority to grant the Licence.
|
|
140
|
+
|
|
141
|
+
Each time You accept the Licence, the original Licensor and subsequent
|
|
142
|
+
Contributors grant You a licence to their contributions to the Work, under the
|
|
143
|
+
terms of this Licence.
|
|
144
|
+
|
|
145
|
+
7. Disclaimer of Warranty
|
|
146
|
+
|
|
147
|
+
The Work is a work in progress, which is continuously improved by numerous
|
|
148
|
+
Contributors. It is not a finished work and may therefore contain defects or
|
|
149
|
+
‘bugs’ inherent to this type of development.
|
|
150
|
+
|
|
151
|
+
For the above reason, the Work is provided under the Licence on an ‘as is’
|
|
152
|
+
basis and without warranties of any kind concerning the Work, including
|
|
153
|
+
without limitation merchantability, fitness for a particular purpose, absence
|
|
154
|
+
of defects or errors, accuracy, non-infringement of intellectual property
|
|
155
|
+
rights other than copyright as stated in Article 6 of this Licence.
|
|
156
|
+
|
|
157
|
+
This disclaimer of warranty is an essential part of the Licence and a
|
|
158
|
+
condition for the grant of any rights to the Work.
|
|
159
|
+
|
|
160
|
+
8. Disclaimer of Liability
|
|
161
|
+
|
|
162
|
+
Except in the cases of wilful misconduct or damages directly caused to natural
|
|
163
|
+
persons, the Licensor will in no event be liable for any direct or indirect,
|
|
164
|
+
material or moral, damages of any kind, arising out of the Licence or of the
|
|
165
|
+
use of the Work, including without limitation, damages for loss of goodwill,
|
|
166
|
+
work stoppage, computer failure or malfunction, loss of data or any commercial
|
|
167
|
+
damage, even if the Licensor has been advised of the possibility of such
|
|
168
|
+
damage. However, the Licensor will be liable under statutory product liability
|
|
169
|
+
laws as far such laws apply to the Work.
|
|
170
|
+
|
|
171
|
+
9. Additional agreements
|
|
172
|
+
|
|
173
|
+
While distributing the Work, You may choose to conclude an additional
|
|
174
|
+
agreement, defining obligations or services consistent with this Licence.
|
|
175
|
+
However, if accepting obligations, You may act only on your own behalf and on
|
|
176
|
+
your sole responsibility, not on behalf of the original Licensor or any other
|
|
177
|
+
Contributor, and only if You agree to indemnify, defend, and hold each
|
|
178
|
+
Contributor harmless for any liability incurred by, or claims asserted against
|
|
179
|
+
such Contributor by the fact You have accepted any warranty or additional
|
|
180
|
+
liability.
|
|
181
|
+
|
|
182
|
+
10. Acceptance of the Licence
|
|
183
|
+
|
|
184
|
+
The provisions of this Licence can be accepted by clicking on an icon ‘I
|
|
185
|
+
agree’ placed under the bottom of a window displaying the text of this Licence
|
|
186
|
+
or by affirming consent in any other similar way, in accordance with the rules
|
|
187
|
+
of applicable law. Clicking on that icon indicates your clear and irrevocable
|
|
188
|
+
acceptance of this Licence and all of its terms and conditions.
|
|
189
|
+
|
|
190
|
+
Similarly, you irrevocably accept this Licence and all of its terms and
|
|
191
|
+
conditions by exercising any rights granted to You by Article 2 of this
|
|
192
|
+
Licence, such as the use of the Work, the creation by You of a Derivative Work
|
|
193
|
+
or the Distribution or Communication by You of the Work or copies thereof.
|
|
194
|
+
|
|
195
|
+
11. Information to the public
|
|
196
|
+
|
|
197
|
+
In case of any Distribution or Communication of the Work by means of
|
|
198
|
+
electronic communication by You (for example, by offering to download the Work
|
|
199
|
+
from a remote location) the distribution channel or media (for example, a
|
|
200
|
+
website) must at least provide to the public the information requested by the
|
|
201
|
+
applicable law regarding the Licensor, the Licence and the way it may be
|
|
202
|
+
accessible, concluded, stored and reproduced by the Licensee.
|
|
203
|
+
|
|
204
|
+
12. Termination of the Licence
|
|
205
|
+
|
|
206
|
+
The Licence and the rights granted hereunder will terminate automatically upon
|
|
207
|
+
any breach by the Licensee of the terms of the Licence. Such a termination
|
|
208
|
+
will not terminate the licences of any person who has received the Work from
|
|
209
|
+
the Licensee under the Licence, provided such persons remain in full
|
|
210
|
+
compliance with the Licence.
|
|
211
|
+
|
|
212
|
+
13. Miscellaneous
|
|
213
|
+
|
|
214
|
+
Without prejudice of Article 9 above, the Licence represents the complete
|
|
215
|
+
agreement between the Parties as to the Work.
|
|
216
|
+
|
|
217
|
+
If any provision of the Licence is invalid or unenforceable under applicable
|
|
218
|
+
law, this will not affect the validity or enforceability of the Licence as a
|
|
219
|
+
whole. Such provision will be construed or reformed so as necessary to make it
|
|
220
|
+
valid and enforceable.
|
|
221
|
+
|
|
222
|
+
The European Commission may publish other linguistic versions or new versions
|
|
223
|
+
of this Licence or updated versions of the Appendix, so far this is required
|
|
224
|
+
and reasonable, without reducing the scope of the rights granted by the
|
|
225
|
+
Licence. New versions of the Licence will be published with a unique version
|
|
226
|
+
number.
|
|
227
|
+
|
|
228
|
+
All linguistic versions of this Licence, approved by the European Commission,
|
|
229
|
+
have identical value. Parties can take advantage of the linguistic version of
|
|
230
|
+
their choice.
|
|
231
|
+
|
|
232
|
+
14. Jurisdiction
|
|
233
|
+
|
|
234
|
+
Without prejudice to specific agreement between parties,
|
|
235
|
+
— any litigation resulting from the interpretation of this License, arising
|
|
236
|
+
between the European Union institutions, bodies, offices or agencies, as a
|
|
237
|
+
Licensor, and any Licensee, will be subject to the jurisdiction of the Court
|
|
238
|
+
of Justice of the European Union, as laid down in article 272 of the Treaty
|
|
239
|
+
on the Functioning of the European Union,
|
|
240
|
+
— any litigation arising between other parties and resulting from the
|
|
241
|
+
interpretation of this License, will be subject to the exclusive
|
|
242
|
+
jurisdiction of the competent court where the Licensor resides or conducts
|
|
243
|
+
its primary business.
|
|
244
|
+
|
|
245
|
+
15. Applicable Law
|
|
246
|
+
|
|
247
|
+
Without prejudice to specific agreement between parties,
|
|
248
|
+
— this Licence shall be governed by the law of the European Union Member State
|
|
249
|
+
where the Licensor has his seat, resides or has his registered office,
|
|
250
|
+
— this licence shall be governed by Belgian law if the Licensor has no seat,
|
|
251
|
+
residence or registered office inside a European Union Member State.
|
|
252
|
+
|
|
253
|
+
Appendix
|
|
254
|
+
|
|
255
|
+
‘Compatible Licences’ according to Article 5 EUPL are:
|
|
256
|
+
— GNU General Public License (GPL) v. 2, v. 3
|
|
257
|
+
— GNU Affero General Public License (AGPL) v. 3
|
|
258
|
+
— Open Software License (OSL) v. 2.1, v. 3.0
|
|
259
|
+
— Eclipse Public License (EPL) v. 1.0
|
|
260
|
+
— CeCILL v. 2.0, v. 2.1
|
|
261
|
+
— Mozilla Public Licence (MPL) v. 2
|
|
262
|
+
— GNU Lesser General Public Licence (LGPL) v. 2.1, v. 3
|
|
263
|
+
— Creative Commons Attribution-ShareAlike v. 3.0 Unported (CC BY-SA 3.0) for
|
|
264
|
+
works other than software
|
|
265
|
+
— European Union Public Licence (EUPL) v. 1.1, v. 1.2
|
|
266
|
+
— Québec Free and Open-Source Licence — Reciprocity (LiLiQ-R) or
|
|
267
|
+
Strong Reciprocity (LiLiQ-R+)
|
|
268
|
+
|
|
269
|
+
— The European Commission may update this Appendix to later versions of the
|
|
270
|
+
above licences without producing a new version of the EUPL, as long as they
|
|
271
|
+
provide the rights granted in Article 2 of this Licence and protect the
|
|
272
|
+
covered Source Code from exclusive appropriation.
|
|
273
|
+
— All other changes or additions to this Appendix require the production of a
|
|
274
|
+
new EUPL version.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
tubular_reactor
|