Skip to content

Commit 817e000

Browse files
committed
began restructuring
1 parent f4d2660 commit 817e000

File tree

5 files changed

+1304
-1237
lines changed

5 files changed

+1304
-1237
lines changed

Lithium_Air_Sizing/Mission.py.py

Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
# Missions.py
2+
#
3+
# Created: May 2015, T. Lukaczyk
4+
# Modified:
5+
6+
7+
# ----------------------------------------------------------------------
8+
# Imports
9+
# ----------------------------------------------------------------------
10+
11+
import SUAVE
12+
from SUAVE.Core import Units
13+
14+
import numpy as np
15+
16+
# ----------------------------------------------------------------------
17+
# Define the Mission
18+
# ----------------------------------------------------------------------
19+
20+
def setup(analyses):
21+
22+
# the mission container
23+
missions = SUAVE.Analyses.Mission.Mission.Container()
24+
25+
# ------------------------------------------------------------------
26+
# Base Mission
27+
# ------------------------------------------------------------------
28+
base_mission = base(analyses)
29+
missions.base = base_mission
30+
31+
32+
return missions
33+
34+
35+
def base(analyses):
36+
37+
# ------------------------------------------------------------------
38+
# Initialize the Mission
39+
# ------------------------------------------------------------------
40+
sol_tol = 1E-12
41+
mission = SUAVE.Analyses.Mission.Sequential_Segments()
42+
mission.tag = 'embraer_e190ar test mission'
43+
44+
# atmospheric model
45+
atmosphere = SUAVE.Attributes.Atmospheres.Earth.US_Standard_1976()
46+
planet = SUAVE.Attributes.Planets.Earth()
47+
48+
#airport
49+
airport = SUAVE.Attributes.Airports.Airport()
50+
airport.altitude = 0.0 * Units.ft
51+
airport.delta_isa = 0.0
52+
airport.atmosphere = SUAVE.Analyses.Atmospheric.US_Standard_1976()
53+
mission.airport = airport
54+
55+
# unpack Segments module
56+
Segments = SUAVE.Analyses.Mission.Segments
57+
58+
59+
# ------------------------------------------------------------------
60+
# First Climb Segment: constant Mach, constant segment angle
61+
# ------------------------------------------------------------------
62+
63+
segment = Segments.Climb.Constant_Speed_Constant_Rate()
64+
segment.tag = "climb_1"
65+
66+
segment.analyses.extend( analyses.takeoff )
67+
68+
segment.altitude_start = 0.0 * Units.km
69+
segment.altitude_end = 1.0 * Units.km
70+
segment.air_speed = 80. * Units['m/s']
71+
segment.climb_rate = 6.0 * Units['m/s']
72+
segment.state.numerics.tolerance_solution = sol_tol
73+
# add to misison
74+
mission.append_segment(segment)
75+
76+
77+
# ------------------------------------------------------------------
78+
# Second Climb Segment: constant Speed, constant segment angle
79+
# ------------------------------------------------------------------
80+
81+
segment = Segments.Climb.Constant_Speed_Constant_Rate()
82+
segment.tag = "climb_2"
83+
84+
segment.analyses.extend( analyses.cruise )
85+
86+
segment.altitude_end = 2.0 * Units.km
87+
segment.air_speed = 80.* Units['m/s']
88+
segment.climb_rate = 6.0 * Units['m/s']
89+
segment.state.numerics.tolerance_solution = sol_tol
90+
# add to mission
91+
mission.append_segment(segment)
92+
93+
94+
# ------------------------------------------------------------------
95+
# Third Climb Segment: constant Mach, constant segment angle
96+
# ------------------------------------------------------------------
97+
98+
segment = Segments.Climb.Constant_Speed_Constant_Rate()
99+
segment.tag = "climb_3"
100+
101+
segment.analyses.extend( analyses.cruise )
102+
103+
segment.altitude_end = 3. * Units.km
104+
segment.air_speed =140* Units['m/s']
105+
segment.climb_rate = 3.0 * Units['m/s']
106+
segment.state.numerics.tolerance_solution = sol_tol
107+
# add to mission
108+
mission.append_segment(segment)
109+
110+
111+
# ------------------------------------------------------------------
112+
# Cruise Segment: constant speed, constant altitude
113+
# ------------------------------------------------------------------
114+
115+
segment = Segments.Cruise.Constant_Speed_Constant_Altitude()
116+
segment.tag = "cruise"
117+
118+
segment.analyses.extend( analyses.cruise )
119+
120+
segment.air_speed = 147.1479 * Units['m/s']
121+
segment.distance = 300 * Units.nautical_miles
122+
segment.state.numerics.tolerance_solution = sol_tol
123+
mission.append_segment(segment)
124+
125+
126+
# ------------------------------------------------------------------
127+
# First Descent Segment: consant speed, constant segment rate
128+
# ------------------------------------------------------------------
129+
130+
segment = Segments.Descent.Constant_Speed_Constant_Rate()
131+
segment.tag = "descent_1"
132+
133+
segment.analyses.extend( analyses.cruise )
134+
135+
segment.altitude_end = 2. * Units.km
136+
segment.air_speed = 120.0 * Units['m/s']
137+
segment.descent_rate = 5.0 * Units['m/s']
138+
segment.state.numerics.tolerance_solution = sol_tol
139+
140+
# add to mission
141+
mission.append_segment(segment)
142+
143+
144+
# ------------------------------------------------------------------
145+
# Second Descent Segment: consant speed, constant segment rate
146+
# ------------------------------------------------------------------
147+
148+
segment = Segments.Descent.Constant_Speed_Constant_Rate()
149+
segment.tag = "descent_2"
150+
151+
segment.analyses.extend( analyses.cruise )
152+
153+
segment.altitude_end = 0.0 * Units.km
154+
segment.air_speed = 100.0 * Units['m/s']
155+
segment.descent_rate = 5.0 * Units['m/s']
156+
segment.state.numerics.tolerance_solution = sol_tol
157+
158+
# append to mission
159+
mission.append_segment(segment)
160+
161+
# ------------------------------------------------------------------
162+
# Mission definition complete
163+
# ------------------------------------------------------------------
164+
165+
166+
return mission
167+
168+
# ----------------------------------------------------------------------
169+
# Call Main
170+
# ----------------------------------------------------------------------
171+
172+
if __name__ == '__main__':
173+
import vehicles
174+
import analyses
175+
176+
vehicles = vehicles.setup()
177+
analyses = analyses.setup(vehicles)
178+
missions = setup(analyses)
179+
180+
vehicles.finalize()
181+
analyses.finalize()
182+
missions.finalize()
183+
184+
missions.base.evaluate()

0 commit comments

Comments
 (0)