-
Notifications
You must be signed in to change notification settings - Fork 0
/
reactor_primary_coolant_pump.py
81 lines (65 loc) · 2.09 KB
/
reactor_primary_coolant_pump.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import numpy as np
"""
Project NAME:
--------" ASTARA --a Nuclear Power Plant simulator "--------
PROGRAMMER:
EBNY WALID AHAMMED
Undergrad Student (Level 4 term 1)
Dept of Nuclear Engineering
University of Dhaka"""
class reactor_primary_coolant_pump:
def __init__(
self,
area_of_piping: float,
piping_length: float,
friction_factor: float,
# initial_contidions
moment_of_innertia: float,
norminal_pump_speed: float,
actual_pump_speed: float,
norminal_flow_rate: float,
actual_flow_rate: float,
power_delivered_to_shaft: float,
torque_delivered_to_shaft: float,
Total_hydrodynamic_head_loss: float,
developed_pump_head: float,
Hydrodynamic_torque: float,
const: list,
):
self.A = area_of_piping
self.L = piping_length
self.k = friction_factor
self.g = 9.8
self.water_density = 1000
self.A = const[0]
self.B = const[1]
self.C = const[2]
self.Np = actual_pump_speed
self.Ns = norminal_pump_speed
self.Qp = actual_flow_rate
self.Qs = norminal_flow_rate
self.Pd = power_delivered_to_shaft
self.Td = torque_delivered_to_shaft
self.Hd = developed_pump_head
self.Ht = Total_hydrodynamic_head_loss
self.I = moment_of_innertia
self.Td = torque_delivered_to_shaft
self.Th = Hydrodynamic_torque
self.alpha = actual_flow_rate / norminal_flow_rate
self.beta = actual_flow_rate / norminal_flow_rate
def dqdt(self):
self.Hp = (
self.A * (self.Qp) ** 2
+ self.B * self.beta * self.Qp
+ self.C * self.beta**2
)
Dq = self.A * self.g * (self.Hp - self.Ht) / self.l
return Dq
def dNpdt(self):
DNp = (self.Pd - self.water_density * self.Qp * self.Hp) / (
self.Np * self.I * 4 * np.pi**2
)
return DNp
def solver(self, function, y0, dt: float):
f = function
return y0 + function * dt