Skip to content
This repository was archived by the owner on Aug 27, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Turbofan/.Turbofan.mdl.py.marks
Binary file not shown.
33,726 changes: 33,726 additions & 0 deletions Turbofan/JT9D.viewOut.GasTbl

Large diffs are not rendered by default.

230 changes: 230 additions & 0 deletions Turbofan/Turbofan.mdl.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,230 @@
from openmdao.main.api import Assembly, Component
from openmdao.lib.drivers.api import DOEdriver
from openmdao.lib.doegenerators.api import FullFactorial
from openmdao.lib.casehandlers.api import DumpCaseRecorder
from openmdao.lib.datatypes.api import Float
from openmdao.lib.drivers.api import BroydenSolver

from pycycle.api import (FlightConditions, Inlet, SplitterBPR, CompressorRline, Duct,
Burner, TurbinePRmap, NozzleConvergent, Shaft, Nmech, FlowStationVar)

class Turbofan(Assembly):

def configure(self):

#component definition
fc = self.add('fc', FlightConditions())
fc.alt = 34000
fc.MN = .8
fc.Wout = 674.2

inlet = self.add('inlet', Inlet() )
inlet.ram_recovery = .995

fan = self.add('fan', CompressorRline())
fan.eff = .867
fan.PR = 1.645

split = self.add( 'split', SplitterBPR())
split.BPR = 5.041

bypduct = self.add( 'bypduct', Duct())
bypduct.dPqP = .01

bypnoz = self.add( 'bypnoz', NozzleConvergent())
bypnoz.cfg = .9962
self.connect('fc.Fl_O.Ps', 'bypnoz.PsExh')

duct1 = self.add( 'duct1', Duct())
duct1.dPqP = .0025

lpc = self.add( 'lpc', CompressorRline())
lpc.eff = .868
lpc.PR = 2.488

duct2 = self.add( 'duct2', Duct())
duct2.dPqP = .0025

hpc = self.add( 'hpc', CompressorRline())
hpc.eff = .865
hpc.PR = 5.609
hpc.Wfrac1=.055
hpc.hfrac1=1
hpc.Pfrac1=1
hpc.Wfrac2=.035
hpc.hfrac2=1
hpc.Pfrac2=1


burner = self.add( 'burner', Burner())
burner.ID_fuel = 3
burner.hFuel = -1200
burner.Wfuel = 1.899
burner.dPqP = .055


hpt = self.add( 'hpt', TurbinePRmap())
hpt.eff = .9133
hpt.PR = 2.670

duct3 = self.add( 'duct3', Duct())
duct3.dPqP = .005

lpt = self.add( 'lpt', TurbinePRmap())
lpt.eff = .9323
lpt.PR = 4.886

duct4 = self.add( 'duct4', Duct())
duct4.dPqP = .01

prinoz = self.add( 'prinoz', NozzleConvergent())
prinoz.cfg = .9978
self.connect('fc.Fl_O.Ps', 'prinoz.PsExh')

hpshaft = self.add( 'hpshaft', Shaft())
hpspeed = self.add( 'hpspeed', Nmech())
hpspeed.Nmech = 8000

lpshaft = self.add( 'lpshaft', Shaft() )
lpspeed = self.add( 'lpspeed', Nmech())
hpspeed.Nmech = 2000

#inter component connections
self.connect( 'fc.Fl_O', 'inlet.Fl_I' )
self.connect( 'inlet.Fl_O', 'fan.Fl_I' )
self.connect( 'fan.Fl_O', 'split.Fl_I' )
self.connect( 'split.Fl_O2', 'bypduct.Fl_I' )
self.connect( 'bypduct.Fl_O', 'bypnoz.Fl_I' )
self.connect( 'split.Fl_O1', 'duct1.Fl_I' )
self.connect( 'duct1.Fl_O', 'lpc.Fl_I' )
self.connect( 'lpc.Fl_O', 'duct2.Fl_I' )
self.connect( 'duct2.Fl_O', 'hpc.Fl_I' )
self.connect( 'hpc.Fl_O', 'burner.Fl_I' )
self.connect( 'burner.Fl_O', 'hpt.Fl_I')
self.connect( 'hpt.Fl_O', 'duct3.Fl_I' )
self.connect( 'duct3.Fl_O', 'lpt.Fl_I' )
self.connect( 'lpt.Fl_O', 'duct4.Fl_I' )
self.connect( 'duct4.Fl_O', 'prinoz.Fl_I' )
self.connect( 'hpc.Fl_bld1', 'hpt.Fl_bld1' )
self.connect( 'hpc.Fl_bld2', 'hpt.Fl_bld2' )

self.connect( 'hpspeed.Nmech', ['hpshaft.Nmech','hpc.Nmech', 'hpt.Nmech'] )
self.connect( 'lpspeed.Nmech', ['lpshaft.Nmech','fan.Nmech','lpc.Nmech', 'lpt.Nmech'] )
self.connect( 'hpc.trq', 'hpshaft.trq1' )
self.connect( 'hpt.trq', 'hpshaft.trq2' )
self.connect( 'fan.trq', 'lpshaft.trq1' )
self.connect( 'lpc.trq', 'lpshaft.trq2' )
self.connect( 'lpt.trq', 'lpshaft.trq3' )

hpspeed.Nmech = 8000
lpspeed.Nmech = 2000

driver = self.driver
comp_list = [
'inlet',
'fan',
'split',
'bypduct',
'bypnoz',
'lpc',
'hpc',
'burner',
'hpt',
'lpt',
'prinoz',
'hpshaft',
'lpshaft',
'fc'
]

solver = self.add('solver',BroydenSolver())

solver.workflow.add( comp_list )
driver.workflow.add('solver')

from collections import OrderedDict
TF1 = Turbofan()

TF1.run()

#TF1.run()

print 'high shaft torques'
print TF1.hpshaft.trqNet
print TF1.hpshaft.trq1
print TF1.hpshaft.trq2

print 'Low shaft torques'
print TF1.lpshaft.trqNet
print TF1.lpshaft.trq1
print TF1.lpshaft.trq2
print TF1.lpshaft.trq3

print TF1.hpc.trq
print TF1.hpt.trq


print 'fc'
print TF1.fc.Fl_O.Pt
print TF1.fc.Fl_O.Ps
print TF1.fc.Fl_O.Tt
print TF1.fc.Fl_O.W

print 'inlet'
print TF1.inlet.Fl_O.Pt
print TF1.inlet.Fl_O.Tt
print TF1.inlet.Fl_O.W

print 'split'
print TF1.split.Fl_O1.Pt
print TF1.split.Fl_O1.Tt
print TF1.split.Fl_O1.W

print 'split'
print TF1.split.Fl_O2.Pt
print TF1.split.Fl_O2.Tt
print TF1.split.Fl_O2.W

print 'bypduct'
print TF1.bypduct.Fl_O.Pt
print TF1.bypduct.Fl_O.Tt
print TF1.bypduct.Fl_O.W

print 'lpc'
print TF1.lpc.Fl_O.Pt
print TF1.lpc.Fl_O.Tt
print TF1.lpc.Fl_O.W

print 'hpc'
print TF1.hpc.Fl_O.Pt
print TF1.hpc.Fl_O.Tt
print TF1.hpc.Fl_O.W

print TF1.hpc.Fl_bld1.Pt
print TF1.hpc.Fl_bld1.Tt
print TF1.hpc.Fl_bld1.W

print TF1.hpc.Fl_bld2.Pt
print TF1.hpc.Fl_bld2.Tt
print TF1.hpc.Fl_bld2.W

print 'burner'
print TF1.burner.Fl_O.Pt
print TF1.burner.Fl_O.Tt
print TF1.burner.Fl_O.W

print 'hpt'
print TF1.hpt.Fl_I.ht
print TF1.hpt.Fl_O.Pt
print TF1.hpt.Fl_O.Tt
print TF1.hpt.Fl_O.W

print 'lpt'
print TF1.lpt.Fl_O.Pt
print TF1.lpt.Fl_O.Tt
print TF1.lpt.Fl_O.W

print TF1.hpshaft.trqNet
print TF1.burner.Wfuel/(TF1.prinoz.Fg+TF1.bypnoz.Fg-TF1.fc.Fram)*3600.


13 changes: 13 additions & 0 deletions Turbofan/api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from splitterT import SplitterBPR
from start import FlowStart, FlowStartStatic
from inletT import Inlet
from nozzleT import Nozzle
from ductT import Duct
from compressor import Compressor
from heat_exchanger import HeatExchanger
from cycle_component import CycleComponent
from flowstation import FlowStation, FlowStationVar

from flightconditions import FlightConditions
from burner import Burner
from turbine import Turbine
29 changes: 23 additions & 6 deletions src/pycycle/api.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,26 @@
from splitter import SplitterBPR, SplitterW
from start import FlowStart, FlowStartStatic
from inlet import Inlet
from nozzle import Nozzle
from duct import Duct
#-------------------------------------------------
# load in flowstation/thermo info
#-------------------------------------------------
from flowstation import FlowStation, FlowStationVar

#-------------------------------------------------
# load in component info
#-------------------------------------------------
from burner import Burner
from compressor import Compressor
from compressor_rline import CompressorRline
from duct import Duct
from flightconditions import FlightConditions
from heat_exchanger import HeatExchanger
from inlet import Inlet
from nozzle_convergent import NozzleConvergent
from nozzle import Nozzle
from shaft import Shaft, Nmech
from splitter_bpr import SplitterBPR
from start import FlowStart
from turbine_prmap import TurbinePRmap

from cycle_component import CycleComponent
from flowstation import FlowStation, FlowStationVar



43 changes: 43 additions & 0 deletions src/pycycle/burner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
from openmdao.main.api import Component
from openmdao.lib.datatypes.api import Float, VarTree, Int

from pycycle.flowstation import FlowStation, FlowStationVar
from pycycle.cycle_component import CycleComponent


class Burner(CycleComponent):
"""The burner takes mixes one cantera flow with another at cantera reactant
and user supplied enthalpy. If this cantera reactant is fuel, burning will
occur"""

#IO Variables
ID_fuel = Int( 0, iotype="in", desc="reactant id number of the flow being mixed (fuel being burned)", units = "lbm/s" )
dPqP = Float( 0.0, iotype="in", desc="pressure differential as a fraction of incomming pressure", units = "lbf/inch**2" )
hFuel = Float( 0.0, iotype="in", desc="enthalpy of incoming fuel", units = "Btu/lbm" )
Wfuel = Float( 0.0, iotype="in", desc="fuel weight flow", units = "lbm/s" )

#flow connections
Fl_I = FlowStationVar( iotype="in", desc="incoming flow stream to the burner", copy=None )
Fl_O = FlowStationVar( iotype="out", desc="flow stream leaving the burner", copy=None )


def execute(self):
Fl_I = self.Fl_I
Fl_O = self.Fl_O

#set the exit station to the inlet as a starting point
Fl_O.copy_from( Fl_I )

#mix the new reactant with the flow
Fl_O.burn( self.ID_fuel, self.Wfuel, self.hFuel )

#apply the pressure drop
Fl_O.setTotal_hP( Fl_O.ht, Fl_O.Pt*(1-self.dPqP) )


if __name__ == "__main__":
from openmdao.main.api import set_as_top

c = set_as_top(Burner())
c.run()

Loading