Skip to content
Test_laval_nozzle.py 1.13 KiB
Newer Older
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Wed May 29 10:35:27 2019

@author: MAC
"""

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from Engineering_tools import laval_nozzle

Pt = 20e5   # total pressure in the combustion chambre (Pa)
Tt = 2000   # total temperature in the combustion chambre (K)
Ath = 0.4   # throat section area (m2)
Ae = 1.6    # exit section area (m2)
gamma = 1.4 # ratio of specific heats
r = 287     # specific gas constant (J.Kg-1.K-1)

data = pd.DataFrame(columns=['Pamb','Thrust','isp'])
Pamb_tab = np.linspace(1e5,100,100) # array of the ambient pressure (Pa)

for Pamb in Pamb_tab:
    data.loc[len(data)] = (Pamb,)+laval_nozzle(Pt,Tt,Pamb,Ath,Ae,gamma,r)
    

if __name__ == '__main__':     
    plt.figure('Laval Nozzle Thrust')
    plt.plot(data['Pamb']*1e-5,data['Thrust']*1e-3)
    plt.title('Thrust Vs Ambient Pressure')
    plt.xlabel('Ambient Pressure (bar)')
    plt.ylabel('Thrust (kN)')

    plt.figure('Laval Nozzle Isp')
    plt.plot(data['Pamb']*1e-5,data['isp'])
    plt.title('Isp Vs Ambient Pressure')
    plt.xlabel('Ambient Pressure (bar)')
    plt.ylabel('Isp (s)')