|
1 | | -# tut_mission_B737.py |
| 1 | +# tut_VSP_Import_Export_B737.py |
2 | 2 | # |
3 | 3 | # Created: Aug 2014, SUAVE Team |
4 | 4 | # Modified: Jun 2015, SUAVE Team |
5 | 5 |
|
6 | 6 | """ setup file for a mission with a 737 |
7 | | -""" |
8 | | - |
| 7 | +""" |
9 | 8 |
|
10 | 9 | # ---------------------------------------------------------------------- |
11 | 10 | # Imports |
12 | 11 | # ---------------------------------------------------------------------- |
13 | 12 |
|
14 | 13 | 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 |
28 | 15 | from SUAVE.Plots.Performance.Mission_Plots import * |
29 | 16 | from SUAVE.Plots.Geometry import * |
30 | 17 | from SUAVE.Methods.Propulsion.turbofan_sizing import turbofan_sizing |
31 | 18 | from SUAVE.Methods.Propulsion.turbofan_sizing import turbofan_sizing |
32 | 19 | from SUAVE.Methods.Geometry.Two_Dimensional.Planform import segment_properties |
33 | 20 | from copy import deepcopy |
34 | 21 |
|
| 22 | +import vsp |
| 23 | +from SUAVE.Input_Output.OpenVSP.vsp_write import write |
35 | 24 |
|
| 25 | +import numpy as np |
| 26 | +import pylab as plt |
36 | 27 | # ---------------------------------------------------------------------- |
37 | 28 | # Main |
38 | 29 | # ---------------------------------------------------------------------- |
39 | 30 |
|
40 | 31 | 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() |
44 | 36 | return |
45 | 37 |
|
46 | 38 | # ---------------------------------------------------------------------- |
47 | 39 | # Define the Vehicle |
48 | 40 | # ---------------------------------------------------------------------- |
49 | 41 |
|
50 | | -def vehicle_setup(): |
| 42 | +def vsp_export_vehicle_setup(): |
51 | 43 |
|
52 | 44 | # ------------------------------------------------------------------ |
53 | 45 | # Initialize the Vehicle |
@@ -786,7 +778,253 @@ def vehicle_setup(): |
786 | 778 | # ------------------------------------------------------------------ |
787 | 779 |
|
788 | 780 | 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 | + |
790 | 1028 | if __name__ == '__main__': |
791 | 1029 | main() |
792 | 1030 | plt.show() |
|
0 commit comments