User_4

Untitled

Nov 29th, 2020
618
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Question4
  2.  
  3. P1 = 1.05E5 # [Pa]
  4. T1 = 20 + 273.15 # [K]
  5. P2 = 2E5 # [Pa]
  6. T2 = 100 + 273.15 # [K]
  7. Vdot = 0.3 # [m^3/s]
  8. R = 0.287E3 # [J/kgK]
  9.  
  10. phi_1 = 0.85
  11.  
  12. Pv1 = phi_1 * 2.339E3
  13. print("Pv1 = %0.4f [kPa]" % (Pv1/1E3))
  14.  
  15. Pa1 = P1 - Pv1
  16. print("Pa1 = %0.4f [kPa]" % (Pa1/1E3))
  17.  
  18. Pa2 = Pa1 * (T2/T1)
  19. print("Pa2 = %0.4f [kPa]" % (Pa2/1E3))
  20.  
  21. Pv2 = P2 - Pa2
  22. print("Pv2 = %0.4f [kPa]" % (Pv2/1E3))
  23.  
  24. Pg2 = 101.3E3 # [Pa]
  25. phi_2 = Pv2/Pg2
  26. print("phi_2 = %0.4f [ ]" % (phi_2))
  27.  
  28. # Compute compressor work
  29.  
  30. # Start by finding omega1, omega2
  31. omega1 = (0.622*Pv1)/(P1 - Pv1)
  32. omega2 = (0.622*Pv2)/(P2 - Pv2)
  33. print("\nomega1 = %0.4f [ ]" % omega1)
  34. print("omega2 = %0.4f [ ]" % omega2)
  35.  
  36. # Interpolate for hg1
  37. xVals = np.array([250, 300])
  38. yVals = np.array([461.36, 554.32])
  39. hg1 = np.interp(293.15, xVals, yVals)
  40. print("hg1 = %0.4f [kJ/kg]" % hg1)
  41.  
  42. # Interpolate for hg2
  43. xVals = np.array([350, 400])
  44. yVals = np.array([647.90, 742.40])
  45. hg2 = np.interp(373.15, xVals, yVals)
  46. print("hg2 = %0.4f [kJ/kg]" % hg2)
  47.  
  48. # Interpolate for ha1
  49. xVals = np.array([290, 298.15])
  50. yVals = np.array([290.43, 298.62])
  51. ha1 = np.interp(293.15, xVals, yVals)
  52. print("ha1 = %0.4f [kJ/kg]" % ha1)
  53.  
  54. # Interpolate for ha2
  55. xVals = np.array([360, 380])
  56. yVals = np.array([360.86, 381.06])
  57. ha2 = np.interp(373.15, xVals, yVals)
  58. print("ha2 = %0.4f [kJ/kg]" % ha2)
  59.  
  60.  
  61. # Compute h of mixture
  62. h1_mix = ha1 + omega1 * hg1
  63. h2_mix = ha2 + omega2 * hg2
  64. print("h1_mix = %0.4f [kJ/kg_da]" % h1_mix)
  65. print("h2_mix = %0.4f [kJ/kg_da]" % h2_mix)
  66.  
  67. Wdot = h2_mix - h1_mix
  68. print("Wdot = %0.4f [kJ/kg_da]" % Wdot)
  69.  
  70. # Compute mass flow to get power
  71. mdot = (P1 * Vdot) / (R * T1)
  72. print("mdot = %0.4f [kg/s]" % mdot)
  73. Power = Wdot * mdot
  74. print("Power = %0.4f [kW]" % Power)
RAW Paste Data