Skip to content

Commit 9dc71ca

Browse files
committed
Update tut_VSP_Import_Export_B737.py
1 parent 9eb4cf4 commit 9dc71ca

1 file changed

Lines changed: 259 additions & 21 deletions

File tree

‎tut_VSP_Import_Export_B737.py‎

Lines changed: 259 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,45 @@
1-
# tut_mission_B737.py
1+
# tut_VSP_Import_Export_B737.py
22
#
33
# Created: Aug 2014, SUAVE Team
44
# Modified: Jun 2015, SUAVE Team
55

66
""" setup file for a mission with a 737
7-
"""
8-
7+
"""
98

109
# ----------------------------------------------------------------------
1110
# Imports
1211
# ----------------------------------------------------------------------
1312

1413
import SUAVE
15-
from SUAVE.Core import Units
16-
17-
import numpy as np
18-
import pylab as plt
19-
import pickle
20-
import copy, time
21-
import os
22-
from SUAVE.Core import (
23-
Data, Container
24-
)
25-
import vsp
26-
from SUAVE.Input_Output.OpenVSP.vsp_write import write
27-
14+
from SUAVE.Core import Units , Data, Container
2815
from SUAVE.Plots.Performance.Mission_Plots import *
2916
from SUAVE.Plots.Geometry import *
3017
from SUAVE.Methods.Propulsion.turbofan_sizing import turbofan_sizing
3118
from SUAVE.Methods.Propulsion.turbofan_sizing import turbofan_sizing
3219
from SUAVE.Methods.Geometry.Two_Dimensional.Planform import segment_properties
3320
from copy import deepcopy
3421

22+
import vsp
23+
from SUAVE.Input_Output.OpenVSP.vsp_write import write
3524

25+
import numpy as np
26+
import pylab as plt
3627
# ----------------------------------------------------------------------
3728
# Main
3829
# ----------------------------------------------------------------------
3930

4031
def main():
41-
vehicle = vehicle_setup()
42-
write(vehicle, "B737-800")
43-
32+
vehicle = vsp_export_vehicle_setup()
33+
write(vehicle, "B737-800")
34+
35+
vehicle = vsp_import_vehicle_setup()
4436
return
4537

4638
# ----------------------------------------------------------------------
4739
# Define the Vehicle
4840
# ----------------------------------------------------------------------
4941

50-
def vehicle_setup():
42+
def vsp_export_vehicle_setup():
5143

5244
# ------------------------------------------------------------------
5345
# Initialize the Vehicle
@@ -786,7 +778,253 @@ def vehicle_setup():
786778
# ------------------------------------------------------------------
787779

788780
return vehicle
789-
781+
782+
783+
def vsp_import_vehicle_setup():
784+
785+
786+
787+
788+
# ------------------------------------------------------------------
789+
# Turbofan Network
790+
# ------------------------------------------------------------------
791+
792+
#instantiate the gas turbine network
793+
turbofan = SUAVE.Components.Energy.Networks.Turbofan()
794+
turbofan.tag = 'turbofan'
795+
796+
# setup
797+
turbofan.number_of_engines = 2.0
798+
turbofan.bypass_ratio = 5.4
799+
turbofan.engine_length = 2.71
800+
801+
# This origin is overwritten by compute_component_centers_of_gravity(base,compute_propulsor_origin=True)
802+
turbofan.origin = [[13.72, 4.86,-1.9],[13.72, -4.86,-1.9]]
803+
804+
# working fluid
805+
turbofan.working_fluid = SUAVE.Attributes.Gases.Air()
806+
807+
808+
# ------------------------------------------------------------------
809+
# Component 1 - Ram
810+
811+
# to convert freestream static to stagnation quantities
812+
813+
# instantiate
814+
ram = SUAVE.Components.Energy.Converters.Ram()
815+
ram.tag = 'ram'
816+
817+
# add to the network
818+
turbofan.append(ram)
819+
820+
821+
# ------------------------------------------------------------------
822+
# Component 2 - Inlet Nozzle
823+
824+
# instantiate
825+
inlet_nozzle = SUAVE.Components.Energy.Converters.Compression_Nozzle()
826+
inlet_nozzle.tag = 'inlet_nozzle'
827+
828+
# setup
829+
inlet_nozzle.polytropic_efficiency = 0.98
830+
inlet_nozzle.pressure_ratio = 0.98
831+
832+
# add to network
833+
turbofan.append(inlet_nozzle)
834+
835+
836+
# ------------------------------------------------------------------
837+
# Component 3 - Low Pressure Compressor
838+
839+
# instantiate
840+
compressor = SUAVE.Components.Energy.Converters.Compressor()
841+
compressor.tag = 'low_pressure_compressor'
842+
843+
# setup
844+
compressor.polytropic_efficiency = 0.91
845+
compressor.pressure_ratio = 1.14
846+
847+
# add to network
848+
turbofan.append(compressor)
849+
850+
851+
# ------------------------------------------------------------------
852+
# Component 4 - High Pressure Compressor
853+
854+
# instantiate
855+
compressor = SUAVE.Components.Energy.Converters.Compressor()
856+
compressor.tag = 'high_pressure_compressor'
857+
858+
# setup
859+
compressor.polytropic_efficiency = 0.91
860+
compressor.pressure_ratio = 13.415
861+
862+
# add to network
863+
turbofan.append(compressor)
864+
865+
866+
# ------------------------------------------------------------------
867+
# Component 5 - Low Pressure Turbine
868+
869+
# instantiate
870+
turbine = SUAVE.Components.Energy.Converters.Turbine()
871+
turbine.tag='low_pressure_turbine'
872+
873+
# setup
874+
turbine.mechanical_efficiency = 0.99
875+
turbine.polytropic_efficiency = 0.93
876+
877+
# add to network
878+
turbofan.append(turbine)
879+
880+
881+
# ------------------------------------------------------------------
882+
# Component 6 - High Pressure Turbine
883+
884+
# instantiate
885+
turbine = SUAVE.Components.Energy.Converters.Turbine()
886+
turbine.tag='high_pressure_turbine'
887+
888+
# setup
889+
turbine.mechanical_efficiency = 0.99
890+
turbine.polytropic_efficiency = 0.93
891+
892+
# add to network
893+
turbofan.append(turbine)
894+
895+
896+
# ------------------------------------------------------------------
897+
# Component 7 - Combustor
898+
899+
# instantiate
900+
combustor = SUAVE.Components.Energy.Converters.Combustor()
901+
combustor.tag = 'combustor'
902+
903+
# setup
904+
combustor.efficiency = 0.99
905+
combustor.alphac = 1.0
906+
combustor.turbine_inlet_temperature = 1450
907+
combustor.pressure_ratio = 0.95
908+
combustor.fuel_data = SUAVE.Attributes.Propellants.Jet_A()
909+
910+
# add to network
911+
turbofan.append(combustor)
912+
913+
914+
# ------------------------------------------------------------------
915+
# Component 8 - Core Nozzle
916+
917+
# instantiate
918+
nozzle = SUAVE.Components.Energy.Converters.Expansion_Nozzle()
919+
nozzle.tag = 'core_nozzle'
920+
921+
# setup
922+
nozzle.polytropic_efficiency = 0.95
923+
nozzle.pressure_ratio = 0.99
924+
925+
# add to network
926+
turbofan.append(nozzle)
927+
928+
929+
# ------------------------------------------------------------------
930+
# Component 9 - Fan Nozzle
931+
932+
# instantiate
933+
nozzle = SUAVE.Components.Energy.Converters.Expansion_Nozzle()
934+
nozzle.tag = 'fan_nozzle'
935+
936+
# setup
937+
nozzle.polytropic_efficiency = 0.95
938+
nozzle.pressure_ratio = 0.99
939+
940+
# add to network
941+
turbofan.append(nozzle)
942+
943+
944+
# ------------------------------------------------------------------
945+
# Component 10 - Fan
946+
947+
# instantiate
948+
fan = SUAVE.Components.Energy.Converters.Fan()
949+
fan.tag = 'fan'
950+
951+
# setup
952+
fan.polytropic_efficiency = 0.93
953+
fan.pressure_ratio = 1.7
954+
955+
# add to network
956+
turbofan.append(fan)
957+
958+
959+
# ------------------------------------------------------------------
960+
#Component 10 : thrust (to compute the thrust)
961+
thrust = SUAVE.Components.Energy.Processes.Thrust()
962+
thrust.tag ='compute_thrust'
963+
964+
#total design thrust (includes all the engines)
965+
thrust.total_design = 2*24000. * Units.N #Newtons
966+
967+
#design sizing conditions
968+
altitude = 35000.0*Units.ft
969+
mach_number = 0.78
970+
isa_deviation = 0.
971+
972+
#Engine setup for noise module
973+
974+
975+
# add to network
976+
turbofan.thrust = thrust
977+
978+
turbofan.core_nozzle_diameter = 0.92
979+
turbofan.fan_nozzle_diameter = 1.659
980+
turbofan.engine_height = 0.5 #Engine centerline heigh above the ground plane
981+
turbofan.exa = 1 #distance from fan face to fan exit/ fan diameter)
982+
turbofan.plug_diameter = 0.1 #dimater of the engine plug
983+
turbofan.geometry_xe = 1. # Geometry information for the installation effects function
984+
turbofan.geometry_ye = 1. # Geometry information for the installation effects function
985+
turbofan.geometry_Ce = 2. # Geometry information for the installation effects function
986+
987+
988+
989+
990+
991+
#size the turbofan
992+
turbofan_sizing(turbofan,mach_number,altitude)
993+
994+
# add gas turbine network turbofan to the vehicle
995+
vehicle.append_component(turbofan)
996+
997+
# ------------------------------------------------------------------
998+
# Fuel
999+
# ------------------------------------------------------------------
1000+
fuel = SUAVE.Components.Physical_Component()
1001+
vehicle.fuel = fuel
1002+
fuel.mass_properties.mass = vehicle.mass_properties.max_takeoff-vehicle.mass_properties.max_fuel
1003+
fuel.origin = vehicle.wings.main_wing.mass_properties.center_of_gravity
1004+
fuel.mass_properties.center_of_gravity= vehicle.wings.main_wing.aerodynamic_center
1005+
1006+
# ------------------------------------------------------------------
1007+
# Landing Gear
1008+
# ------------------------------------------------------------------
1009+
landing_gear = SUAVE.Components.Landing_Gear.Landing_Gear()
1010+
landing_gear.tag = "main_landing_gear"
1011+
landing_gear.main_tire_diameter = 1.12000 * Units.m
1012+
landing_gear.nose_tire_diameter = 0.6858 * Units.m
1013+
landing_gear.main_strut_length = 1.8 * Units.m
1014+
landing_gear.nose_strut_length = 1.3 * Units.m
1015+
landing_gear.main_units = 1 #number of nose landing gear
1016+
landing_gear.nose_units = 1 #number of nose landing gear
1017+
landing_gear.main_wheels = 2 #number of wheels on the main landing gear
1018+
landing_gear.nose_wheels = 2 #number of wheels on the nose landing gear
1019+
vehicle.landing_gear = landing_gear
1020+
1021+
# ------------------------------------------------------------------
1022+
# Vehicle Definition Complete
1023+
# ------------------------------------------------------------------
1024+
1025+
return vehicle
1026+
1027+
7901028
if __name__ == '__main__':
7911029
main()
7921030
plt.show()

0 commit comments

Comments
 (0)