Advertisement
Guest User

Untitled

a guest
Feb 27th, 2017
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. %Choked Flow Eqn MODELLED ISOTHERMALLY
  2.  
  3. D_orifice = 0.005; %Diameter of orifice (m) (piercing)
  4. D_can = 0.037*2; %Diameter of Can (m)
  5.  
  6. T_1 = 22+273; %Ambient Temperature (K)
  7. R = 188.9; %Specific Gas Constant for CO2
  8.  
  9. P_1(1) = 61*100000; %Pressure in canister (Pa)
  10. P_2 = 101325; %Atmospheric Pressure (Pa)
  11.  
  12. Cd = 0.61; %Discharge Coefficient
  13.  
  14. Cp = 4.416; %Isobaric heat capacity at 61 bar and 22C (kJ/mol)
  15. Cv = 1.0103; %Isochoric heat capacity at 61 bar and 22C (kJ/mol)
  16. k = Cp/Cv; %Specific heat ratio
  17.  
  18. A_1 = (pi*(D_can^2))/4; %Area of can (m2)
  19. A_2 = (pi*(D_orifice^2))/4; %Area of orifice (piercing) (m2)
  20.  
  21. Volume_Canister = pi*((D_orifice/2)^2)*0.076264; %Volume of Canister (m^3)
  22.  
  23.  
  24. mass(1) = 0.06; %initial mass
  25. rho(1) = P_1(1)/(R*T_1); %initial density
  26. m_dot(1) = Cd.*A_2.*(sqrt(k*rho(1)*P_1(1)*((2/(k+1))^((k+1)/(k-1))))); %initial mass flow
  27. Velocity_Orifice(1) = m_dot(1)/(rho(1)*A_2); %Velocity at orifice (m/s)
  28.  
  29. dt = 0.001; %time step
  30. t(1) = 0; %initial time
  31.  
  32. n = 1;
  33.  
  34. while mass(n) > 0
  35. if P_1(n) <= 101325
  36. P_1(n+1) = 101325;
  37. else
  38.  
  39. rho(n+1) = P_1(n+1)/(R*T_1); %Density
  40.  
  41. m_dot(n+1) = Cd.*A_2.*(sqrt(k*rho(n+1)*P_1(n)*((2/(k+1))^((k+1)/(k-1))))); %Mass Flow Rate (kg/s)
  42.  
  43. Velocity_Orifice(n+1) = m_dot(n+1)/(rho(n+1)*A_2); %Velocity at orifice (m/s)
  44.  
  45. mass(n+1) = mass(n) - m_dot(n+1)*dt %Mass
  46.  
  47. P_1(n+1) = (((mass(n+1)/44)*R*T_1)/((Volume_Canister)-(mass(n+1)/44)*(4.267e-5))) - ((((mass(n+1)/44)^2)*0.364)/(Volume_Canister.^2)); %Pressure Calculated with vdw
  48.  
  49. t(n+1) = t(n) + dt; %Time
  50.  
  51. n = n+1
  52. end
  53. end
  54.  
  55. plot(t,mass)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement