-
Notifications
You must be signed in to change notification settings - Fork 117
Expand file tree
/
Copy pathemergency_equipment.py
More file actions
50 lines (40 loc) · 1.61 KB
/
emergency_equipment.py
File metadata and controls
50 lines (40 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
"""
Define utilities to calculate the estimated mass of emergency equipment mass
"""
import openmdao.api as om
from aviary.constants import GRAV_ENGLISH_LBM
from aviary.variable_info.functions import add_aviary_option, add_aviary_output
from aviary.variable_info.variables import Aircraft
class EmergencyEquipment(om.ExplicitComponent):
"""
Define the default component to calculate the estimated mass of emergency
service equipment. The methodology is based on the
GASP weight equations, modified to output mass instead of weight.
"""
def initialize(self):
add_aviary_option(self, Aircraft.CrewPayload.Design.NUM_PASSENGERS)
def setup(self):
add_aviary_output(self, Aircraft.Design.EMERGENCY_EQUIPMENT_MASS, units='lbm')
def compute(self, inputs, outputs):
num_pax = self.options[Aircraft.CrewPayload.Design.NUM_PASSENGERS]
num_flight_attendants = 0
if num_pax >= 20.0:
num_flight_attendants = 1
if num_pax >= 51.0:
num_flight_attendants = 2
if num_pax >= 101.0:
num_flight_attendants = 3
if num_pax >= 151.0:
num_flight_attendants = 4
if num_pax >= 201.0:
num_flight_attendants = 5
if num_pax >= 251.0:
num_flight_attendants = 6
emergency_wt = 0.0
if num_pax > 5.0:
emergency_wt = 10.0
if num_pax > 9.0:
emergency_wt = 15.0
if num_pax >= 35.0:
emergency_wt = 25.0 * num_flight_attendants + 15.0
outputs[Aircraft.Design.EMERGENCY_EQUIPMENT_MASS] = emergency_wt / GRAV_ENGLISH_LBM