
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

Propulsion Assignment - Mathematica code for Isentropic flow equation – I. Surya Prabhas 21103100 ClearAll["Global`"] ( Define variables ) γ = 1.4; ( specific heat ratio for air ) M = 0.5; ( Mach number ) ρ0 = 1.225; ( freestream density, kg/m^3 ) p0 = 101325; ( freestream pressure, Pa ) T0 = 288.15; ( freestream temperature, K ) A = 1; ( cross-sectional area, m^2 ) R = 287.058; ( gas constant for air, J/(kgK) ) ( Calculate derived quantities ) a0 = Sqrt[γRT0]; (* freestream speed of sound, m/s ) V0 = Ma0; (* freestream velocity, m/s ) ρV0 = ρ0V0; (* mass flow rate per unit area, kg/(m^2s) ) p = p0(1 + (γ-1)/2M^2)^(γ/(γ-1)); (* pressure as a function of Mach number ) T = T0/(1 + (γ-1)/2M^2); (* temperature as a function of Mach number ) ρ = ρ0(1 + (γ-1)/2M^2)^(-1/(γ-1)); ( density as a function of Mach number ) V = MSqrt[γRT]; (* velocity as a function of Mach number ) Astar = A(1/M)((2/(γ+1))(1 + (γ-1)/2M^2))^((γ+1)/(2(γ-1))); (* sonic area, m^2 ) Machstar = Sqrt(((γ-1)/(2γ))(A/Astar)^2 + 1)^(-1/2); ( Mach number at sonic conditions ) ( Print results *) Print["Isentropic flow properties for a perfect gas:"] Print["Mach number: ", M] Print["Pressure: ", p, " Pa"] Print["Temperature: ", T, " K"] Print["Density: ", ρ, " kg/m^3"] Print["Velocity: ", V, " m/s"] Print["Sonic area: ", Astar, " m^2"] Print["Mach number at sonic conditions: ", Machstar]