from os.path import dirname, join
from openmdao.main.api import Assembly
from openmdao.lib.components.api import GeomComponent
from openmdao.lib.datatypes.api import Float, Int
#hyperloop sizing calculations
from inlet import InletGeom
from battery import Battery
from passenger_capsule import PassengerCapsule
from tube_structure import TubeStructural
from aero import Aero
#overall geometry assembly
[docs]class Pod(Assembly):
#Inputs
area_inlet_in = Float(iotype="in", units="cm**2", desc="flow area required at the front of the inlet")
area_inlet_out = Float(iotype="in", units="cm**2", desc="flow area required at the back of the inlet")
time_mission = Float(iotype="in", units="s", desc="travel time for a single trip")
radius_tube_inner = Float(iotype="in", units="cm", desc="inner tube radius")
rho_air = Float(iotype="in", units="kg/m**3", desc="air density (aero calcs)")
F_net = Float(iotype="in", desc="Thrust generated by the nozzle", units="N")
energy = Float(iotype="in", desc="Energy required from batteries", units="kW*h")
Ps_tube = Float(99, iotype="in", desc="static pressure in the tube", units="Pa")
speed_max = Float(iotype="in", desc="maximum velocity of the pod", units="m/s")
hub_to_tip = Float(.4, iotype="in", desc="hub to tip ratio for the compressor")
coef_drag = Float(2, iotype="in", desc="capsule drag coefficient")
n_rows = Int(14, iotype="in", desc="number of rows of seats in the pod")
length_row = Float(150, iotype="in", units="cm", desc="length of each row of seats")
#Outputs
radius_inlet_back_outer = Float(iotype="out", units="cm", desc="outer radius of the back of the inlet")
area_compressor_bypass = Float(iotype="out", units="cm**2", desc="area available to move compressed air around the passenger capsule")
area_cross_section = Float(iotype="out", units="cm**2", desc="cross sectional area of the passenger capsule")
radius_tube_outer = Float(iotype="out", units="cm", desc="outer radius of tube")
net_force = Float(iotype="out", desc="Net force with drag considerations", units="N")
[docs] def run(self,*args,**kwargs):
super(Assembly, self).run(*args,**kwargs)
if __name__ == "__main__":
from openmdao.main.api import set_as_top
g = set_as_top(Pod())