This repository was archived by the owner on Jul 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdata_loader.py
More file actions
89 lines (78 loc) · 3.87 KB
/
data_loader.py
File metadata and controls
89 lines (78 loc) · 3.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import numpy as np
import matplotlib.pyplot as plt
import os
def load_data_different_rho(rho, POI, pipe):
directory = os.getcwd()
folder = "p" + str(rho)
x_axis = np.load(directory + "\\tests\\multiphase_tests\\" + pipe + "\\" + folder + "\\height.npy")
data_fluid = np.load(directory + "\\tests\\multiphase_tests\\" + pipe + "\\" + folder + "\\u_center.npy")
data_particles = np.load(directory + "\\tests\\multiphase_tests\\" + pipe + "\\" + folder + "\\u_center_2.npy")
plt.plot(x_axis, data_fluid[:,-POI], ls='--', label=f"Continuous Phase, ρ = {rho} kg/m³")
plt.plot(x_axis, data_particles[:,-POI], label=f"Dispersed Phase, ρ = {rho} kg/m³")
print(f"Mean velocity of the continuous phase = {np.mean(data_fluid[:,-POI]):.4f}, ρ = {rho} kg/m³")
print(f"Mean velocity of the dispersed phase = {np.mean(data_particles[:,-POI]):.4f}, ρ = {rho} kg/m³")
def load_data_different_a2(a2, POI, pipe):
directory = os.getcwd()
folder = "a00" + str(a2)
x_axis = np.load(directory + "\\tests\\multiphase_tests\\" + pipe + "\\" + folder + "\\height.npy")
data_fluid = np.load(directory + "\\tests\\multiphase_tests\\" + pipe + "\\" + folder + "\\u_center.npy")
data_particles = np.load(directory + "\\tests\\multiphase_tests\\" + pipe + "\\" + folder + "\\u_center_2.npy")
plt.plot(x_axis, data_fluid[:, -POI], ls='--', label=f"Continuous Phase, a_2 = 0.0{a2}")
plt.plot(x_axis, data_particles[:, -POI], label=f"Dispersed Phase, a_2 = 0.0{a2}")
print(f"Mean velocity of the continuous phase = {np.mean(data_fluid[:,-POI]):.4f}, a_2 = 0.0{a2}")
print(f"Mean velocity of the dispersed phase = {np.mean(data_particles[:,-POI]):.4f}, a_2 = 0.0{a2}")
def load_data_dredging(adress, POI, label):
directory = os.getcwd()
x_axis = np.load(directory + "\\tests\\multiphase_tests\\smaller_pipe_fixed_g_kinstress\\" + adress + "\\height.npy")
data_fluid = np.load(directory + "\\tests\\multiphase_tests\\smaller_pipe_fixed_g_kinstress\\" + adress + "\\u_center.npy")
data_particles = np.load(directory + "\\tests\\multiphase_tests\\smaller_pipe_fixed_g_kinstress\\" + adress + "\\u_center_2.npy")
plt.plot(x_axis, data_particles[:, -POI], label=f"Dispersed Phase, {label}")
plt.plot(x_axis, data_fluid[:, -POI], ls='--', label=f"Continuous Phase, {label}")
print(f"Mean velocity of the continuous phase = {np.mean(data_fluid[:, -POI]):.4f}, {label}")
print(f"Mean velocity of the dispersed phase = {np.mean(data_particles[:, -POI]):.4f}, {label}")
if __name__ == "__main__":
POI = 5
# pipe = "larger_pipe"
pipe = "smaller_pipe_fixed gravity"
# load_data_different_rho(1602, POI, pipe)
# load_data_different_rho(2602, POI, pipe)
# load_data_different_rho(3602, POI, pipe)
#
# plt.title("Effects of gravity for different dispersed densities")
# plt.xlabel("Width (m)")
# plt.legend()
# plt.ylabel("Velocity (m/s)")
# plt.grid()
# plt.show()
# load_data_different_a2(1, POI, pipe)
# load_data_different_a2(3, POI, pipe)
# load_data_different_a2(5, POI, pipe)
#
# plt.title("Effects of gravity for different dispersed volume fractions")
# plt.xlabel("Width (m)")
# plt.legend()
# plt.ylabel("Velocity (m/s)")
# plt.grid()
# plt.show()
#
adress_normal = "normal"
adress_11 = "jet 1.1"
adress_14 = "jet 1.4"
adress_18 = "jet 1.8"
#
label_normal = "no jets"
label_11 = "jet outlet = 1.1 m/s"
label_14 = "jet outlet = 1.4 m/s"
label_18 = "jet outlet = 1.8 m/s"
#
# load_data_dredging(adress_normal, POI, label_normal)
load_data_dredging(adress_11, POI, label_11)
load_data_dredging(adress_14, POI, label_14)
load_data_dredging(adress_18, POI, label_18)
#
plt.title("Effects of different jet velocities")
plt.xlabel("Width (m)")
plt.legend()
plt.ylabel("Velocity (m/s)")
plt.grid()
plt.show()