SHARE
TWEET

Untitled

a guest Apr 10th, 2019 93 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub rafakam()
  2. Dim t1, t2, t3, t4, t5, p1, p2, p3, p4, p5, p6, m1, m2, m3, m4, m5, m6, m7, m8, nitw, cww, nitn, ng, I1, s1, s2s, s2p, s2b, i2p, i2b, x2s, i2s, i2, i4, s4, s5s, s5p, s5b, i5p, i5b, x5s, i5s, i5, i6, i7, nit, nel, nturboz, nreakt, nelektrowni, p, wd As Double
  3.  
  4. m1 = UserForm1.TextBox13.Value * 1
  5. m2 = UserForm1.TextBox2.Value * 1
  6. t1 = UserForm1.TextBox3.Value
  7. p1 = UserForm1.TextBox4.Value * 10
  8. p2 = UserForm1.TextBox5.Value * 10
  9. p5 = UserForm1.TextBox6.Value / 100
  10. nitw = UserForm1.TextBox7.Value
  11. nitn = UserForm1.TextBox8.Value
  12. nturboz = UserForm1.TextBox9.Value
  13. t5 = UserForm1.TextBox10.Value
  14. nreakt = UserForm1.TextBox15.Value
  15. wd = UserForm1.TextBox16.Value * 1000
  16.  
  17. 'Sprawdzenie, czy wszystkie dane wejściowe zostały uzupełnione
  18. If UserForm1.TextBox13.Value = Empty Then
  19.         MsgBox ("Proszę wpisac wszystkie dane!")
  20.         ElseIf UserForm1.TextBox2.Value = Empty Then
  21.             MsgBox ("Prosze wpisac wszystkie dane!")
  22.         ElseIf UserForm1.TextBox3.Value = Empty Then
  23.             MsgBox ("Prosze wpisac wszystkie dane!")
  24.         ElseIf UserForm1.TextBox4.Value = Empty Then
  25.             MsgBox ("Prosze wpisac wszystkie dane!")
  26.         ElseIf UserForm1.TextBox5.Value = Empty Then
  27.             MsgBox ("Prosze wpisac wszystkie dane!")
  28.         ElseIf UserForm1.TextBox6.Value = Empty Then
  29.             MsgBox ("Prosze wpisac wszystkie dane!")
  30.         ElseIf UserForm1.TextBox7.Value = Empty Then
  31.             MsgBox ("Prosze wpisac wszystkie dane!")
  32.         ElseIf UserForm1.TextBox8.Value = Empty Then
  33.             MsgBox ("Prosze wpisac wszystkie dane!")
  34.         ElseIf UserForm1.TextBox9.Value = Empty Then
  35.             MsgBox ("Prosze wpisac wszystkie dane!")
  36.         ElseIf UserForm1.TextBox10.Value = Empty Then
  37.             MsgBox ("Prosze wpisac wszystkie dane!")
  38.         ElseIf UserForm1.TextBox15.Value = Empty Then
  39.             MsgBox ("Prosze wpisac wszystkie dane!")
  40.         ElseIf UserForm1.TextBox16.Value = Empty Then
  41.     Exit Sub
  42. End If
  43.  
  44.  
  45.  
  46.  
  47.  
  48. 'Entalpia w poszczególnych punktach
  49. I1 = h_pT(p1, t1)
  50. s1 = s_pT(p1, t1)
  51.  
  52.  
  53. s2s = s1
  54. i2s = h_ps(p2, s2s)
  55. i2 = I1 - nitw * (I1 - i2s)
  56.  
  57.  
  58. i3 = h_pT(p2, t1)
  59. i4 = i3
  60. s4 = s_pT(p2, t1)
  61.  
  62.  
  63. s5s = s4
  64. i5s = h_ps(p5, s5s)
  65. i5 = i4 - nitn * (i4 - i5s)
  66.  
  67.  
  68. cww = 4.19 'cieplo wlasciwe wody
  69. i6 = cww * t5
  70.  
  71. 'BS TURBINY WYSOKOPREZNEJ
  72. m3 = m1 - m2
  73.  
  74.  
  75. 'BE MIESZALNIKA
  76. i7 = ((m2 * i2) + (m3 * i6)) / m1
  77. i8 = i7
  78.  
  79.  
  80. 'Moc wewnętrzna turbin
  81. nit = (m1 * (I1 - i2)) + (m3 * (i4 - i5))
  82.  
  83.  
  84.  
  85. 'Moc elektryczna turbozespolu
  86. nel = nit * nturboz
  87.  
  88.  
  89. 'Strumień paliwa doprowadzanego do reaktora
  90. p = ((m1 * (I1 - i7)) + (m3 * (i4 - i3))) / (nreakt * wd)
  91.  
  92.  
  93. 'Sprawność elektrownii
  94. nelektrowni = nel / (p * wd)
  95.  
  96.  
  97. 'Zapis wyników w poszczególnych polach
  98.  
  99. I1 = Round(I1, 1)
  100.     UserForm1.Label51.Caption = I1
  101.    
  102. i2 = Round(i2, 1)
  103.     UserForm1.Label52.Caption = i2
  104.    
  105. i3 = Round(i3, 1)
  106.     UserForm1.Label53.Caption = i3
  107.    
  108. i4 = Round(i4, 1)
  109.     UserForm1.Label54.Caption = i4
  110.    
  111. i5 = Round(i5, 1)
  112.     UserForm1.Label55.Caption = i5
  113.    
  114. i6 = Round(i6, 1)
  115.     UserForm1.Label56.Caption = i6
  116.    
  117. i7 = Round(i7, 1)
  118.     UserForm1.Label57.Caption = i7
  119.    
  120. i8 = Round(i8, 1)
  121.     UserForm1.Label58.Caption = i8
  122.    
  123. 'Nit
  124. nit = Round(nit, 0)
  125.     UserForm1.Label59.Caption = nit
  126.    
  127. 'Nel
  128. nel = Round(nel, 0)
  129.     UserForm1.Label60.Caption = nel
  130.    
  131. 'nelektrowni
  132. nelektrowni = Round(nelektrowni, 2)
  133.     UserForm1.Label61.Caption = nelektrowni
  134.    
  135. 'p
  136. p = p * 1000
  137. p = Round(p, 3)
  138.     UserForm1.Label62.Caption = p
  139.    
  140.  
  141. End Sub
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top