Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

mathematica code for isentropic flow, Summaries of Aerospace Engineering

It is a Mathematica code for isentropic flow relation in propulsion

Typology: Summaries

2022/2023

Uploaded on 05/17/2023

maverick-air-1
maverick-air-1 🇮🇳

4 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
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/(kg*K) *)
(* Calculate derived quantities *)
a0 = Sqrt[γ*R*T0]; (* freestream speed of sound, m/s *)
V0 = M*a0; (* freestream velocity, m/s *)
ρV0 = ρ0*V0; (* mass flow rate per unit area, kg/(m^2*s) *)
p = p0*(1 + (γ-1)/2*M^2)^(γ/(γ-1)); (* pressure as a function of Mach number *)
T = T0/(1 + (γ-1)/2*M^2); (* temperature as a function of Mach number *)
ρ = ρ0*(1 + (γ-1)/2*M^2)^(-1/(γ-1)); (* density as a function of Mach number *)
V = M*Sqrt[γ*R*T]; (* velocity as a function of Mach number *)
Astar = A*(1/M)*((2/(γ+1))*(1 + (γ-1)/2*M^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]

Partial preview of the text

Download mathematica code for isentropic flow and more Summaries Aerospace Engineering in PDF only on Docsity!

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]