forked from Carlopasquinucci/k-epsilon-omega-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRun.py
59 lines (45 loc) · 1.21 KB
/
Run.py
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
"""
Created on January 2020
@author: carlopasquinucci : carlo.a.pasquinucci (at) gmail.com
"""
"""
Instruction:
1)Fill the data in Initial_Data.dat
2)Run Run.py
3)Read the results on Results.dat
"""
print("\n")
print("#########################################################")
print("###### #######")
print("###### Calcolus of k epsilon omega #######")
print("###### #######")
print("#########################################################")
print("\n")
#Read data from file
f = open("Initial_Data.dat", "r")
i=0
while (i< 15):
test=f.readline()
i= i+1
Velocity=float(f.readline())
empty=f.readline()
empty=f.readline()
empty=f.readline()
TurbuLevel=float(f.readline())
empty=f.readline()
empty=f.readline()
empty=f.readline()
TurbuLength=float(f.readline())
f.close()
#Calculus of k omega epsilon
k=(3/2)**(1/2)*(Velocity*TurbuLevel*TurbuLength)
epsilon=3/2*(Velocity*TurbuLevel)**2
omega=epsilon**(1/2)*TurbuLength
#Print on file
F=open("Results","w")
F.write("k="+str(k)+"\n")
F.write("epsilon="+str(epsilon)+"\n")
F.write("omega="+str(omega)+"\n")
F.close()
print("")
print("Results printed in Results.dat")