Skip to content

Commit 1fa5fe4

Browse files
authored
Merge pull request OpenMDAO#86 from swryan/4.3.0
Updated version/notes for 4.3.0 release
2 parents a026b6e + 72600aa commit 1fa5fe4

5 files changed

Lines changed: 170 additions & 86 deletions

File tree

.bumpversion.cfg

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[bumpversion]
2+
current_version = 4.3.0
3+
commit = False
4+
tag = False
5+
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+))?
6+
serialize =
7+
{major}.{minor}.{patch}-{release}
8+
{major}.{minor}.{patch}
9+
10+
[bumpversion:file:pycycle/__init__.py]
11+
search = __version__ = '{current_version}'
12+
replace = __version__ = '{new_version}'
13+
14+
[bumpversion:part:release]
15+
optional_value = rel
16+
values =
17+
dev
18+
rel
19+

example_cycles/high_bypass_turbofan.py

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,29 @@ def initialize(self):
1818

1919
def setup(self):
2020
#Setup the problem by including all the relavant components here - comp, burner, turbine etc
21-
21+
2222
#Create any relavent short hands here:
2323
design = self.options['design']
24-
24+
2525
USE_TABULAR = False
26-
if USE_TABULAR:
26+
if USE_TABULAR:
2727
self.options['thermo_method'] = 'TABULAR'
2828
self.options['thermo_data'] = pyc.AIR_JETA_TAB_SPEC
2929
FUEL_TYPE = 'FAR'
30-
else:
30+
else:
3131
self.options['thermo_method'] = 'CEA'
3232
self.options['thermo_data'] = pyc.species_data.janaf
3333
FUEL_TYPE = 'Jet-A(g)'
3434

35-
35+
3636
#Add subsystems to build the engine deck:
3737
self.add_subsystem('fc', pyc.FlightConditions())
3838
self.add_subsystem('inlet', pyc.Inlet())
39-
40-
# Note variable promotion for the fan --
39+
40+
# Note variable promotion for the fan --
4141
# the LP spool speed and the fan speed are INPUTS that are promoted:
4242
# Note here that promotion aliases are used. Here Nmech is being aliased to LP_Nmech
43-
# check out: http://openmdao.org/twodocs/versions/latest/features/core_features/grouping_components/add_subsystem.html?highlight=alias
43+
# check out: https://openmdao.org/newdocs/versions/latest/features/core_features/working_with_groups/add_subsystem.html?highlight=alias
4444
self.add_subsystem('fan', pyc.Compressor(map_data=pyc.FanMap,
4545
bleed_names=[], map_extrap=True), promotes_inputs=[('Nmech','LP_Nmech')])
4646
self.add_subsystem('splitter', pyc.Splitter())
@@ -63,22 +63,22 @@ def setup(self):
6363
self.add_subsystem('byp_bld', pyc.BleedOut(bleed_names=['bypBld']))
6464
self.add_subsystem('duct15', pyc.Duct())
6565
self.add_subsystem('byp_nozz', pyc.Nozzle(nozzType='CV', lossCoef='Cv'))
66-
66+
6767
#Create shaft instances. Note that LP shaft has 3 ports! => no gearbox
6868
self.add_subsystem('lp_shaft', pyc.Shaft(num_ports=3),promotes_inputs=[('Nmech','LP_Nmech')])
6969
self.add_subsystem('hp_shaft', pyc.Shaft(num_ports=2),promotes_inputs=[('Nmech','HP_Nmech')])
7070
self.add_subsystem('perf', pyc.Performance(num_nozzles=2, num_burners=1))
71-
71+
7272
# Now use the explicit connect method to make connections -- connect(<from>, <to>)
73-
73+
7474
#Connect the inputs to perf group
7575
self.connect('inlet.Fl_O:tot:P', 'perf.Pt2')
7676
self.connect('hpc.Fl_O:tot:P', 'perf.Pt3')
7777
self.connect('burner.Wfuel', 'perf.Wfuel_0')
7878
self.connect('inlet.F_ram', 'perf.ram_drag')
7979
self.connect('core_nozz.Fg', 'perf.Fg_0')
8080
self.connect('byp_nozz.Fg', 'perf.Fg_1')
81-
81+
8282
#LP-shaft connections
8383
self.connect('fan.trq', 'lp_shaft.trq_0')
8484
self.connect('lpc.trq', 'lp_shaft.trq_1')
@@ -89,7 +89,7 @@ def setup(self):
8989
#Ideally expanding flow by conneting flight condition static pressure to nozzle exhaust pressure
9090
self.connect('fc.Fl_O:stat:P', 'core_nozz.Ps_exhaust')
9191
self.connect('fc.Fl_O:stat:P', 'byp_nozz.Ps_exhaust')
92-
92+
9393
#Create a balance component
9494
# Balances can be a bit confusing, here's some explanation -
9595
# State Variables:
@@ -102,7 +102,7 @@ def setup(self):
102102
# (lpt_PR) LPT press ratio to balance shaft power on the low spool
103103
# (hpt_PR) HPT press ratio to balance shaft power on the high spool
104104
# Ref: look at the XDSM diagrams in the pyCycle paper and this:
105-
# http://openmdao.org/twodocs/versions/latest/features/building_blocks/components/balance_comp.html
105+
# http://openmdao.org/newdocs/versions/latest/features/building_blocks/components/balance_comp.html
106106

107107
balance = self.add_subsystem('balance', om.BalanceComp())
108108
if design:
@@ -116,7 +116,7 @@ def setup(self):
116116
self.connect('balance.FAR', 'burner.Fl_I:FAR')
117117
self.connect('burner.Fl_O:tot:T', 'balance.lhs:FAR')
118118
self.promotes('balance', inputs=[('rhs:FAR', 'T4_MAX')])
119-
119+
120120
# Note that for the following two balances the mult val is set to -1 so that the NET torque is zero
121121
balance.add_balance('lpt_PR', val=1.5, lower=1.001, upper=8,
122122
eq_units='hp', use_mult=True, mult_val=-1)
@@ -131,11 +131,11 @@ def setup(self):
131131
self.connect('hp_shaft.pwr_out_real', 'balance.rhs:hpt_PR')
132132

133133
else:
134-
134+
135135
#In OFF-DESIGN mode we need to redefine the balances:
136136
# State Variables:
137137
# (W) Inlet mass flow rate to balance core flow area
138-
# LHS: core_nozz.Throat:stat:area == Area from DESIGN calculation
138+
# LHS: core_nozz.Throat:stat:area == Area from DESIGN calculation
139139
#
140140
# (FAR) Fuel-air ratio to balance Thrust req.
141141
# LHS: perf.Fn == RHS: Thrust requirement (set when TF is instantiated)
@@ -146,13 +146,13 @@ def setup(self):
146146
# (lp_Nmech) LP spool speed to balance shaft power on the low spool
147147
# (hp_Nmech) HP spool speed to balance shaft power on the high spool
148148

149-
if self.options['throttle_mode'] == 'T4':
149+
if self.options['throttle_mode'] == 'T4':
150150
balance.add_balance('FAR', val=0.017, lower=1e-4, eq_units='degR')
151151
self.connect('balance.FAR', 'burner.Fl_I:FAR')
152152
self.connect('burner.Fl_O:tot:T', 'balance.lhs:FAR')
153153
self.promotes('balance', inputs=[('rhs:FAR', 'T4_MAX')])
154154

155-
elif self.options['throttle_mode'] == 'percent_thrust':
155+
elif self.options['throttle_mode'] == 'percent_thrust':
156156
balance.add_balance('FAR', val=0.017, lower=1e-4, eq_units='lbf', use_mult=True)
157157
self.connect('balance.FAR', 'burner.Fl_I:FAR')
158158
self.connect('perf.Fn', 'balance.rhs:FAR')
@@ -177,12 +177,12 @@ def setup(self):
177177
self.connect('balance.hp_Nmech', 'HP_Nmech')
178178
self.connect('hp_shaft.pwr_in_real', 'balance.lhs:hp_Nmech')
179179
self.connect('hp_shaft.pwr_out_real', 'balance.rhs:hp_Nmech')
180-
180+
181181
# Specify the order in which the subsystems are executed:
182-
182+
183183
# self.set_order(['balance', 'fc', 'inlet', 'fan', 'splitter', 'duct4', 'lpc', 'duct6', 'hpc', 'bld3', 'burner', 'hpt', 'duct11',
184184
# 'lpt', 'duct13', 'core_nozz', 'byp_bld', 'duct15', 'byp_nozz', 'lp_shaft', 'hp_shaft', 'perf'])
185-
185+
186186
# Set up all the flow connections:
187187
self.pyc_connect_flow('fc.Fl_O', 'inlet.Fl_I')
188188
self.pyc_connect_flow('inlet.Fl_O', 'fan.Fl_I')
@@ -207,13 +207,13 @@ def setup(self):
207207
self.pyc_connect_flow('hpc.cool2', 'lpt.cool2', connect_stat=False)
208208
self.pyc_connect_flow('bld3.cool3', 'hpt.cool3', connect_stat=False)
209209
self.pyc_connect_flow('bld3.cool4', 'hpt.cool4', connect_stat=False)
210-
210+
211211
#Specify solver settings:
212212
newton = self.nonlinear_solver = om.NewtonSolver()
213213
newton.options['atol'] = 1e-8
214214

215215
# set this very small, so it never activates and we rely on atol
216-
newton.options['rtol'] = 1e-99
216+
newton.options['rtol'] = 1e-99
217217
newton.options['iprint'] = 2
218218
newton.options['maxiter'] = 50
219219
newton.options['solve_subsystems'] = True
@@ -318,7 +318,7 @@ def setup(self):
318318
self.set_input_defaults('DESIGN.HP_Nmech', 14705.7, units='rpm')
319319

320320
# --- Set up bleed values -----
321-
321+
322322
self.pyc_add_cycle_param('inlet.ram_recovery', 0.9990)
323323
self.pyc_add_cycle_param('duct4.dPqP', 0.0048)
324324
self.pyc_add_cycle_param('duct6.dPqP', 0.0101)
@@ -346,7 +346,7 @@ def setup(self):
346346
self.pyc_add_cycle_param('lpt.cool2:frac_P', 0.0)
347347
self.pyc_add_cycle_param('hp_shaft.HPX', 250.0, units='hp')
348348

349-
self.od_pts = ['OD_full_pwr', 'OD_part_pwr']
349+
self.od_pts = ['OD_full_pwr', 'OD_part_pwr']
350350

351351
self.od_MNs = [0.8, 0.8]
352352
self.od_alts = [35000.0, 35000.0]
@@ -394,20 +394,20 @@ def setup(self):
394394

395395
prob.set_val('DESIGN.hpc.PR', 9.369)
396396
prob.set_val('DESIGN.hpc.eff', 0.8707)
397-
397+
398398
prob.set_val('DESIGN.hpt.eff', 0.8888)
399399
prob.set_val('DESIGN.lpt.eff', 0.8996)
400-
400+
401401
prob.set_val('DESIGN.fc.alt', 35000., units='ft')
402402
prob.set_val('DESIGN.fc.MN', 0.8)
403-
403+
404404
prob.set_val('DESIGN.T4_MAX', 2857, units='degR')
405-
prob.set_val('DESIGN.Fn_DES', 5900.0, units='lbf')
405+
prob.set_val('DESIGN.Fn_DES', 5900.0, units='lbf')
406406

407407
prob.set_val('OD_full_pwr.T4_MAX', 2857, units='degR')
408408
prob.set_val('OD_part_pwr.PC', 0.8)
409409

410-
410+
411411
# Set initial guesses for balances
412412
prob['DESIGN.balance.FAR'] = 0.025
413413
prob['DESIGN.balance.W'] = 100.
@@ -416,15 +416,15 @@ def setup(self):
416416
prob['DESIGN.fc.balance.Pt'] = 5.2
417417
prob['DESIGN.fc.balance.Tt'] = 440.0
418418

419-
419+
420420
for pt in ['OD_full_pwr', 'OD_part_pwr']:
421421

422422
# initial guesses
423423
prob[pt+'.balance.FAR'] = 0.02467
424424
prob[pt+'.balance.W'] = 300
425425
prob[pt+'.balance.BPR'] = 5.105
426-
prob[pt+'.balance.lp_Nmech'] = 5000
427-
prob[pt+'.balance.hp_Nmech'] = 15000
426+
prob[pt+'.balance.lp_Nmech'] = 5000
427+
prob[pt+'.balance.hp_Nmech'] = 15000
428428
prob[pt+'.hpt.PR'] = 3.
429429
prob[pt+'.lpt.PR'] = 4.
430430
prob[pt+'.fan.map.RlineMap'] = 2.0
@@ -437,43 +437,43 @@ def setup(self):
437437
prob.set_solver_print(level=2, depth=1)
438438

439439
flight_env = [(0.8, 35000), (0.7, 35000), (0.55, 35000), (0.46, 35000), (0.4, 35000),
440-
(0.4, 20000), (0.6, 20000), (0.8, 20000),
440+
(0.4, 20000), (0.6, 20000), (0.8, 20000),
441441
(0.8, 10000), (0.6, 10000), (0.4, 10000), (0.2, 10000), (0.001, 10000),
442442
(.001, 1000), (0.2, 1000), (0.4, 1000), (0.6, 1000),
443443
(0.6, 0), (0.4, 0), (0.2, 0), (0.001, 0)]
444444

445445
viewer_file = open('hbtf_view.out', 'w')
446446
first_pass = True
447-
for MN, alt in flight_env:
447+
for MN, alt in flight_env:
448448

449-
# NOTE: You never change the MN,alt for the
449+
# NOTE: You never change the MN,alt for the
450450
# design point because that is a fixed reference condition.
451451

452452
print('***'*10)
453453
print(f'* MN: {MN}, alt: {alt}')
454454
print('***'*10)
455455
prob['OD_full_pwr.fc.MN'] = MN
456456
prob['OD_full_pwr.fc.alt'] = alt
457-
457+
458458
prob['OD_part_pwr.fc.MN'] = MN
459459
prob['OD_part_pwr.fc.alt'] = alt
460460

461-
for PC in [1, 0.9, 0.8, .7]:
461+
for PC in [1, 0.9, 0.8, .7]:
462462
print(f'## PC = {PC}')
463463
prob['OD_part_pwr.PC'] = PC
464464
prob.run_model()
465465

466-
if first_pass:
466+
if first_pass:
467467
viewer(prob, 'DESIGN', file=viewer_file)
468-
first_pass = False
468+
first_pass = False
469469
viewer(prob, 'OD_part_pwr', file=viewer_file)
470470

471471
# run throttle back up to full power
472-
for PC in [1, 0.85]:
472+
for PC in [1, 0.85]:
473473
prob['OD_part_pwr.PC'] = PC
474474
prob.run_model()
475475

476-
476+
477477

478478
print()
479479
print("Run time", time.time() - st)

pycycle/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '4.2.1'
1+
__version__ = '4.3.0'

pycycle/docs/index.rst

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ pyCycle is a open-source thermodynamic cycle analysis tool designed integrating
99
The pyCycle project implements 1D thermodynamic cycle analysis equations similar to the NPSS code and has been validated against this tool. While the thermodynamic equations are similar to NPSS and other available cycle analysis tools, pyCycle is focused on applying advanced methods for supporting gradient-based optimization through the implementation of analytic derivatives. This feature enables efficient exploration of large design spaces when pyCycle is coupled with other disciplinary analysis tools.
1010

1111

12-
.. warning::
12+
.. warning::
1313

14-
pyCycle is built on top of OpenMDAO and relies extensively its linear and nonlinear solver library.
14+
pyCycle is built on top of OpenMDAO and relies extensively its linear and nonlinear solver library.
1515
pyCycle was also designed with a user interface that is very similar to the NPSS cycle modeling library.
16-
If you're not comfortable with either OpenMDAO or NPSS, then you may find this library difficult to understand and use.
16+
If you're not comfortable with either OpenMDAO or NPSS, then you may find this library difficult to understand and use.
1717

1818
Installation
1919
************
@@ -24,13 +24,13 @@ Installation of pyCycle requires two pieces of software. First, if you do not h
2424
pip install pycycle
2525
2626
27-
.. _OpenMDAO Getting Started: http://openmdao.org/twodocs/versions/latest/getting_started/index.html
27+
.. _OpenMDAO Getting Started: https://openmdao.org/newdocs/versions/latest/getting_started/getting_started.html
2828

2929
Tutorials
3030
**********
3131

32-
This section provides several tutorials showing how to build thermodynamic cycle models in pyCycle.
33-
For users unfamiliar with OpenMDAO, a review of the OpenMDAO User Guide is highly recommended before completing the pyCycle tutorials.
32+
This section provides several tutorials showing how to build thermodynamic cycle models in pyCycle.
33+
For users unfamiliar with OpenMDAO, a review of the OpenMDAO User Guide is highly recommended before completing the pyCycle tutorials.
3434
The tutorials in this section will demonstrate how models are constructed and executed in pyCycle, starting with a simple turboject then moving to a more complicated turbofan model.
3535
Additional models showing more features available with pyCycle are provided in the Examples section.
3636

@@ -40,14 +40,14 @@ Additional models showing more features available with pyCycle are provided in t
4040
:name: tutorials
4141

4242
tutorials/index.rst
43-
43+
4444
Reference Guide
4545
****************
4646

4747
The reference guide intended for users looking for explanation of a particular feature in detail or documentation of the arguments/options/settings for a specific cycle element, map or viewer.
4848

49-
.. toctree::
50-
:maxdepth: 1
49+
.. toctree::
50+
:maxdepth: 1
5151
:name: reference_guide
5252

5353
reference_guide/elements/index.rst
@@ -56,21 +56,12 @@ The reference guide intended for users looking for explanation of a particular f
5656

5757

5858

59-
Examples
59+
Examples
6060
********
6161
The examples in this section provide a more comprehensive demsonstration of the features of pyCycle and advanced modeling methods.
6262

63-
.. toctree::
64-
:maxdepth: 1
63+
.. toctree::
64+
:maxdepth: 1
6565
:name: examples
6666

6767
examples/index.rst
68-
69-
70-
71-
72-
73-
74-
75-
76-

0 commit comments

Comments
 (0)