OpenConcept¶
OpenConcept is a new toolkit for the conceptual design of aircraft. OpenConcept was developed in order to model and optimize aircraft with electric propulsion at low computational cost. The tools are built on top of NASA Glenn’s OpenMDAO framework, which in turn is written in Python.
The following charts show more than 250 individually optimized hybrid-electric light twin aircraft (similar to a King Air C90GT). Optimizing hundreds of configurations can be done in a couple of hours on a standard laptop computer.

The reason for OpenConcept’s efficiency is the analytic derivatives built into each analysis routine and component. Accurate, efficient derivatives enable the use of Newton nonlinear equation solutions and gradient-based optimization at low computational cost.
Getting Started¶
- Clone the repo to disk
- Navigate to the root openconcept folder
- Run python setup.py install to install the package
- Navigate to the examples folder
- Run python TBM850.py to test OpenConcept on a single-engine turboprop aircraft (the TBM 850)
- Look at the examples/aircraft data/TBM850.py folder to play with the assumptions / config / geometry and see the effects on the output result
examples/HybridTwin.py is set up to do MDO in a grid of specific energies and design ranges and save the results to disk. Visualization utilities will be added soon (to produce contour plots as shown in this Readme)
Dependencies¶
This toolkit requires the use of OpenMDAO 2.3.0 or later and will evolve rapidly as general utilities are moved from OpenConcept into the main OpenMDAO repository. OpenMDAO requires a late numpy and scipy.
Please Cite Us!¶
Please cite this software by reference to the conference paper:
Plaintext:
Benjamin J. Brelje and Joaquim R.R.A. Martins. “Development of a Conceptual Design Model for Aircraft Electric Propulsion with Efficient Gradients”, 2018 AIAA/IEEE Electric Aircraft Technologies Symposium, AIAA Propulsion and Energy Forum, (AIAA 2018-4979) DOI: TBD
Bibtex:
@inproceedings{Brelje2018,
Address = {{C}incinnati,~{OH}},
Author = {Benjamin J. Brelje and Joaquim R. R. A. Martins},
Booktitle = {2018 AIAA/IEEE Electric Aircraft Technologies Symposium},
Month = jul,
Title = {Development of a Conceptual Design Model for Aircraft Electric Propulsion with Efficient Gradients},
Year = 2018,
Number = {AIAA-2018-4979},
}
Contributing¶
A contributor’s guide is coming third (after completing documentation and automatic testing coverage). I’m open to pull requests and issues in the meantime. Stay tuned. The development roadmap is here.
Features¶
OpenConcept features will be documented here.
Propulsion Modeling¶
OpenConcept is designed to facilitate bottoms-up modeling of aircraft propulsion architectures with conceptual-level fidelity. Electric and fuel-burning components are supported.
Single Turboprop Example¶
This example illustrates the simples possible case (turboprop engine connected to a propeller). The propulsion system is instantiated as an OpenMDAO Group.
Source: `examples/propulsion_layouts/simple_turboprop.py`
class TurbopropPropulsionSystem(Group):
"""This is an example model of the simplest possible propulsion system
consisting of a constant-speed prop and a turboshaft.
This is the Pratt and Whitney Canada PT6A-66D with 4-bladed
propeller used by the SOCATA-DAHER TBM-850.
Inputs
------
ac|propulsion|engine|rating : float
The maximum rated shaft power of the engine
ac|propulsion|propeller|diameter : float
Diameter of the propeller
Options
-------
num_nodes : float
Number of analysis points to run (default 1)
"""
def initialize(self):
self.options.declare('num_nodes', default=1, desc="Number of mission analysis points to run")
def setup(self):
nn = self.options['num_nodes']
# rename incoming design variables
dvlist = [['ac|propulsion|engine|rating', 'eng1_rating', 850, 'hp'],
['ac|propulsion|propeller|diameter', 'prop1_diameter', 2.3, 'm']]
self.add_subsystem('dvs', DVLabel(dvlist),
promotes_inputs=["*"], promotes_outputs=["*"])
# introduce model components
self.add_subsystem('eng1',
SimpleTurboshaft(num_nodes=nn, weight_inc=0.14 / 1000, weight_base=104),
promotes_inputs=["throttle"], promotes_outputs=["fuel_flow"])
self.add_subsystem('prop1',
SimplePropeller(num_nodes=nn, num_blades=4,
design_J=2.2, design_cp=0.55),
promotes_inputs=["fltcond|*"], promotes_outputs=["thrust"])
# connect design variables to model component inputs
self.connect('eng1_rating', 'eng1.shaft_power_rating')
self.connect('eng1_rating', 'prop1.power_rating')
self.connect('prop1_diameter', 'prop1.diameter')
# connect components to each other
self.connect('eng1.shaft_power_out', 'prop1.shaft_power_in')
Series Hybrid Example¶
This example illustrates the complexities which arise when electrical components are included.
Source: `examples.propulsion_layouts.simple_series_hybrid.py`
class SingleSeriesHybridElectricPropulsionSystem(Group):
"""This is an example model of a series-hybrid propulsion system. One motor
draws electrical load from two sources in a fractional split| a battery pack,
and a turbogenerator setup. The control inputs are the power split fraction and the
motor throttle setting; the turboshaft throttle matches the power level necessary
to drive the generator at the required power level.
Fuel flows and prop thrust should be fairly accurate.
Heat constraints haven't yet been incorporated.
The "pilot" controls thrust by varying the motor throttles from 0 to 100+% of rated power.
She may also vary the percentage of battery versus fuel being
used by varying the power_split_fraction.
This module alone cannot produce accurate fuel flows, battery loads, etc.
You must do the following, either with an implicit solver or with the optimizer:
- Set eng1.throttle such that gen1.elec_power_out = hybrid_split.power_out_A
The battery does not track its own state of charge (SOC);
it is connected to elec_load simply so that the discharge rate can be compared to
the discharge rate capability of the battery. SOC and fuel flows should be time-integrated
at a higher level (in the mission analysis codes).
Inputs
------
ac|propulsion|engine|rating : float
Turboshaft range extender power rating (scalar, kW)
ac|propulsion|propeller|diameter : float
Propeller diameter (scalar, m)
ac|propulsion|motor|rating : float
Motor power rating (scalar, kW)
ac|propulsion|generator|rating : float
Range extender elec gen rating (scalar, kW)
ac|weights|W_battery : float
Battery weight (scalar, kg)
TODO list all the control inputs
Outputs
-------
thrust : float
Propulsion system total thrust (vector, N)
fuel_flow : float
Fuel flow consumed by the turboshaft (vector, kg/s)
Options
-------
num_nodes : float
Number of analysis points to run (default 1)
specific_energy : float
Battery specific energy (default 300 Wh/kg)
"""
def initialize(self):
self.options.declare('num_nodes', default=1, desc="Number of mission analysis points to run")
self.options.declare('specific_energy', default=300, desc="Battery spec energy in Wh/kg")
def setup(self):
nn = self.options['num_nodes']
e_b = self.options['specific_energy']
# define design variables that are independent of flight condition or control states
dvlist = [['ac|propulsion|engine|rating', 'eng_rating', 260.0, 'kW'],
['ac|propulsion|propeller|diameter', 'prop_diameter', 2.5, 'm'],
['ac|propulsion|motor|rating', 'motor_rating', 240.0, 'kW'],
['ac|propulsion|generator|rating', 'gen_rating', 250.0, 'kW'],
['ac|weights|W_battery', 'batt_weight', 2000, 'kg']]
self.add_subsystem('dvs', DVLabel(dvlist), promotes_inputs=["*"], promotes_outputs=["*"])
# introduce model components
self.add_subsystem('motor1', SimpleMotor(efficiency=0.97, num_nodes=nn))
self.add_subsystem('prop1', SimplePropeller(num_nodes=nn),
promotes_inputs=["fltcond|*"], promotes_outputs=['thrust'])
self.connect('motor1.shaft_power_out', 'prop1.shaft_power_in')
self.add_subsystem('hybrid_split', PowerSplit(rule='fraction', num_nodes=nn))
self.connect('motor1.elec_load', 'hybrid_split.power_in')
self.add_subsystem('eng1',
SimpleTurboshaft(num_nodes=nn,
weight_inc=0.14 / 1000,
weight_base=104),
promotes_outputs=["fuel_flow"])
self.add_subsystem('gen1',SimpleGenerator(efficiency=0.97, num_nodes=nn))
self.connect('eng1.shaft_power_out', 'gen1.shaft_power_in')
self.add_subsystem('batt1', SimpleBattery(num_nodes=nn, specific_energy=e_b))
self.connect('hybrid_split.power_out_A', 'batt1.elec_load')
# need to use the optimizer to drive hybrid_split.power_out_B to the
# same value as gen1.elec_power_out.
# create a residual equation for power in vs power out from the generator
self.add_subsystem('eng_gen_resid',
AddSubtractComp(output_name='eng_gen_residual',
input_names=['gen_power_available', 'gen_power_required'],
vec_size=nn, units='kW',
scaling_factors=[1, -1]))
self.connect('hybrid_split.power_out_B', 'eng_gen_resid.gen_power_required')
self.connect('gen1.elec_power_out', 'eng_gen_resid.gen_power_available')
# add the weights of all the motors and props
# (forward-compatibility for twin series hybrid layout)
addweights = AddSubtractComp(output_name='motors_weight',
input_names=['motor1_weight'],
units='kg')
addweights.add_equation(output_name='propellers_weight',
input_names=['prop1_weight'],
units='kg')
self.add_subsystem('add_weights', subsys=addweights,
promotes_inputs=['*'],promotes_outputs=['*'])
self.connect('motor1.component_weight', 'motor1_weight')
self.connect('prop1.component_weight', 'prop1_weight')
#connect design variables to model component inputs
self.connect('eng_rating', 'eng1.shaft_power_rating')
self.connect('prop_diameter', ['prop1.diameter'])
self.connect('motor_rating', ['motor1.elec_power_rating'])
self.connect('motor_rating', ['prop1.power_rating'])
self.connect('gen_rating', 'gen1.elec_power_rating')
self.connect('batt_weight', 'batt1.battery_weight')
Source Docs¶
openconcept.analysis¶
aerodynamics.py¶
Aerodynamic analysis routines usable for multiple purposes / flight phases
-
class
openconcept.analysis.aerodynamics.
PolarDrag
(**kwargs)[source]¶ Bases:
openmdao.core.explicitcomponent.ExplicitComponent
Calculates drag force based on drag polar formulation
Inputs: - fltcond|CL (float) – Lift coefficient (vector, dimensionless)
- fltcond|q (float) – Dynamic pressure (vector, Pascals)
- ac|geom|wing|S_ref (float) – Reference wing area (scalar, m**2)
- ac|geom|wing|AR (float) – Wing aspect ratio (scalar, dimensionless)
- CD0 (float) – Zero-lift drag coefficient (scalar, dimensionless)
- e (float) – Wing Oswald efficiency (scalar, dimensionless)
Outputs: drag (float) – Drag force (vector, Newtons)
Options: num_nodes (int) – Number of analysis points to run (sets vec length) (default 1)
-
class
openconcept.analysis.aerodynamics.
Lift
(**kwargs)[source]¶ Bases:
openmdao.core.explicitcomponent.ExplicitComponent
Calculates lift force based on CL, dynamic pressure, and wing area
Inputs: - fltcond|CL (float) – Lift coefficient (vector, dimensionless)
- fltcond|q (float) – Dynamic pressure (vector, Pascals)
- ac|geom|wing|S_ref (float) – Reference wing area (scalar, m**2)
Outputs: lift (float) – Lift force (vector, Newtons)
Options: num_nodes (int) – Number of analysis points to run (sets vec length) (default 1)
-
class
openconcept.analysis.aerodynamics.
StallSpeed
(**kwargs)[source]¶ Bases:
openmdao.core.explicitcomponent.ExplicitComponent
Calculates stall speed based on CLmax, wing area, and weight
Inputs: - CLmax (float) – Maximum lfit coefficient (scalar, dimensionless)
- weight (float) – Dynamic pressure (scalar, kg)
- ac|geom|wing|S_ref (float) – Reference wing area (scalar, m**2)
Outputs: Vstall_eas (float) – Stall speed (scalar, m/s)
mission.py¶
Analysis routines for simulating a mission profile with climb, cruise, and descent
-
class
openconcept.analysis.mission.
MissionFlightConditions
(**kwargs)[source]¶ Bases:
openmdao.core.explicitcomponent.ExplicitComponent
Generates vectors of flight conditions for a mission profile
Inputs: - mission|climb|vs (float) – Vertical speed in the climb segment (scalar, m/s)
- mission|descent|vs (float) – Vertical speed in the descent segment (should be neg; scalar, m/s)
- mission|climb|Ueas (float) – Indicated/equiv. airspeed during climb (scalar, m/s)
- mission|cruise|Ueas (float) – Indicated/equiv. airspeed in cruise (scalar, m/s)
- mission|descent|Ueas (float) – Indicated/equiv. airspeed during descent (scalar, m/s)
- mission|takeoff|h (float) – Takeoff (and landing, for now) altitude (scalar, m)
- mission|cruise|h (float) – Cruise altitude (scalar, m)
Outputs: - fltcond|mission|vs (float) – Vertical speed vector for all mission phases / analysis points (vector, m/s)
- fltcond|mission|Ueas (float) – Equivalent airspeed vector for all mission phases / analysis points (vector, m/s)
- fltcond|mission|h (float) – Altitude at each analysis point (vector, m)
- mission|climb|time (float) – Time to ascent from end of takeoff to start of cruise (scalar, s)
- mission|descent|time (float) – Time to descend from end of cruise to landing (scalar, s)
- mission|climb|dt (float) – Timestep length during climb phase (scalar, s) Note: this represents the timestep for the Simpson subinterval, not the whole inteval
- mission|descent|dt (float) – Timestep length during descent phase (scalar, s) Note: this represents the timestep for the Simpson subinterval, not the whole inteval
Options: n_int_per_seg (int) – Number of Simpson’s rule intervals to use per mission segment. The total number of points is 2 * n_int_per_seg + 1
-
class
openconcept.analysis.mission.
MissionNoReserves
(**kwargs)[source]¶ Bases:
openmdao.core.group.Group
This analysis group calculates energy/fuel consumption and feasibility for a given mission profile.
This component should be instantiated in the top-level aircraft analysis / optimization script. Suggested variable promotion list: “ac|aero|*”, “ac|geom|*”, “fltcond|mission|*”, “mission|*”
Inputs List:
- From aircraft config:
- ac|aero|polar|CD0_cruise
- ac|aero|polar|e
- ac|geom|wing|S_ref
- ac|geom|wing|AR
- From mission config:
- mission|weight_initial
- From mission flight condition generator:
- fltcond|mission|vs
- mission|climb|time
- mission|climb|dt
- mission|descent|time
- mission|descent|dt
- From standard atmosphere model/splitter:
- fltcond|mission|Utrue
- fltcond|mission|q
- From propulsion model:
- mission|battery_load
- mission|fuel_flow
- mission|thrust
Outputs: - mission|total_fuel (float) – Total fuel burn for climb, cruise, and descent (scalar, kg)
- mission|total_battery_energy (float) – Total energy consumption for climb, cruise, and descent (scalar, kJ)
- thrust_resid.thrust_residual (float) – Imbalance between thrust and drag for use with Newton solver (scalar, N)
-
class
openconcept.analysis.mission.
ExplicitThrustResidual
(**kwargs)[source]¶ Bases:
openmdao.core.explicitcomponent.ExplicitComponent
Computes force imbalance in the aircraft x axis. Enables Newton solve for throttle at steady flight.
Inputs: - drag (float) – Aircraft drag force at each analysis point (vector, N)
- fltcond|mission|singamma (float) – Sine of the flight path angle for all mission phases (vector, dimensionless)
- mission|weights (float) – Aircraft weight at each analysis point (vector, kg)
- mission|thrust (float) – Aircraft thrust force at each analysis point (vector, N)
Outputs: thrust_residual (float) – Imbalance in x-axis force at each analysis point (vector, N)
Options: n_int_per_seg (int) – Number of Simpson’s rule intervals to use per mission segment. The total number of points is 2 * n_int_per_seg + 1
-
class
openconcept.analysis.mission.
ComputeDesignMissionResiduals
(**kwargs)[source]¶ Bases:
openmdao.core.explicitcomponent.ExplicitComponent
Computes weight margins to ensure feasible mission profiles
For aircraft including battery energy, use ComputeDesignMissionResidualsBattery instead
Inputs: - ac|weights|MTOW (float) – Maximum takeoff weight (scalar, kg)
- ac|weights|W_fuel_max (float) – Max fuel weight (inc. vol limits; scalar, kg)
- mission|payload (float) – Payload weight including pax (scalar, kg)
- mission|total_fuel (float) – Fuel consume during the mission profile (not including TO; scalar, kg)
- OEW (float) – Operational empty weight (scalar, kg)
- takeoff|total_fuel (float) – Fuel consumed during takeoff (only if include_takeoff option is True)
Outputs: - mission|fuel_capacity_margin (float) – Excess fuel capacity for this mission (scalar, kg) Positive is good
- mission|MTOW_margin (float) – Excess takeoff weight avail. for this mission (scalar, kg) Positive is good
- fuel_burn (float) – Total fuel burn including takeoff and the mission (scalar, kg) Only when include_takeoff is True
Options: include_takeoff (bool) – Set to True to enable takeoff fuel burn input
-
class
openconcept.analysis.mission.
ComputeDesignMissionResidualsBattery
(**kwargs)[source]¶ Bases:
openconcept.analysis.mission.ComputeDesignMissionResiduals
Computes weight and energy margins to ensure feasible mission profiles.
This routine is applicable to electric and hybrid architectures. For fuel-only designs, use ComputeDesignMissionResiduals instead.
Inputs: - ac|weights|MTOW (float) – Maximum takeoff weight (scalar, kg)
- ac|weights|W_battery (float) – Battery weight (scalar, kg)
- ac|weights|W_fuel_max (float) – Max fuel weight (inc. vol limits; scalar, kg)
- battery_max_energy (float) – Maximum energy of the battery at 100% SOC (scalar, MJ)
- mission|payload (float) – Payload weight including pax (scalar, kg)
- mission|total_battery_energy (float) – Battery energy consumed during the mission profile (scalar, MJ)
- mission|total_fuel (float) – Fuel consumed during the mission profile (not including TO; scalar, kg)
- OEW (float) – Operational empty weight (scalar, kg)
- takeoff|total_battery_energy (float) – Battery energy consumed during takeoff (only if include_takeoff option is True)
- takeoff|total_fuel (float) – Fuel consumed during takeoff (only if include_takeoff option is True)
Outputs: - mission|battery_margin (float) – Excess battery energy for this mission (scalar, kg)
- mission|fuel_capacity_margin (float) – Excess fuel capacity for this mission (scalar, kg) Positive is good
- mission|MTOW_margin (float) – Excess takeoff weight avail. for this mission (scalar, kg) Positive is good
- battery_energy_used (float) – Total battery energy used including takeoff and the mission (scalar, MJ) Only when include_takeoff is True
- fuel_burn (float) – Total fuel burn including takeoff and the mission (scalar, kg) Only when include_takeoff is True
Options: include_takeoff (bool) – Set to True to enable takeoff fuel burn input
-
class
openconcept.analysis.mission.
MissionGroundspeeds
(**kwargs)[source]¶ Bases:
openmdao.core.explicitcomponent.ExplicitComponent
Computes groundspeed for vectorial true airspeed and true vertical speed.
This is a helper function for the main mission analysis routine MissionNoReserves and shouldn’t be instantiated directly.
Inputs: - fltcond|mission|vs (float) – Vertical speed for all mission phases (vector, m/s)
- fltcond|mission|Utrue (float) – True airspeed for all mission phases (vector, m/s)
Outputs: - mission|groundspeed (float) – True groundspeed for all mission phases (vector, m/s)
- fltcond|mission|cosgamma (float) – Cosine of the flght path angle for all mission phases (vector, dimensionless)
- fltcond|mission|singamma (float) – Sine of the flight path angle for all mission phases (vector, dimensionless)
Options: n_int_per_seg (int) – Number of Simpson’s rule intervals to use per mission segment. The total number of points is 2 * n_int_per_seg + 1
-
class
openconcept.analysis.mission.
MissionClimbDescentRanges
(**kwargs)[source]¶ Bases:
openmdao.core.explicitcomponent.ExplicitComponent
Computes range over the ground during the climb and descent phases
This is a helper function for the main mission analysis routine MissionNoReserves and shouldn’t be instantiated directly.
Inputs: - mission|groundspeed (float) – True groundspeed for all mission phases (vector, m/s)
- mission|climb|time (float) – Time elapsed during the climb phase (scalar, s)
- mission|descent|time (float) – Time elapsed during the descent phase (scalar, s)
Outputs: - mission|climb|range (float) – Distance over the ground during climb phase (scalar, m)
- mission|descent|range (float) – Distance over the ground during descent phase (scalar , m)
Options: n_int_per_seg (int) – Number of Simpson’s rule intervals to use per mission segment. The total number of points is 2 * n_int_per_seg + 1
-
class
openconcept.analysis.mission.
MissionTimings
(**kwargs)[source]¶ Bases:
openmdao.core.explicitcomponent.ExplicitComponent
Computes cruise distance, time, and dt for a given total mission range
This is a helper function for the main mission analysis routine MissionNoReserves and shouldn’t be instantiated directly.
Inputs: - mission|range (float) – Total specified range for the given mission (vector, m)
- mission|groundspeed (float) – True groundspeed for all mission phases (vector, m/s)
- mission|climb|range (float) – Distance over the ground during climb phase (scalar, m)
- mission|descent|range (float) – Distance over the ground during descent phase (scalar , m)
Outputs: - mission|cruise|range (float) – Distance over the ground during the cruise phase (scalar, m)
- mission|cruise|time (float) – Time elapsed during cruise phase (scalar, s)
- mission|cruise|dt (float) – Simpson subinterval timestep during the cruise phase (scalar, s)
Options: n_int_per_seg (int) – Number of Simpson’s rule intervals to use per mission segment. The total number of points is 2 * n_int_per_seg + 1
-
class
openconcept.analysis.mission.
MissionSegmentFuelBurns
(**kwargs)[source]¶ Bases:
openmdao.core.explicitcomponent.ExplicitComponent
Integrates delta fuel between each analysis point
This is a helper function for the main mission analysis routine MissionNoReserves and shouldn’t be instantiated directly.
Takes 3 * nn fuel flow rates; produces 3 * (nn - 1) fuel burns
Inputs: - mission|fuel_flow (float) – Fuel flow rate for all analysis points (vector, kg/s)
- mission|climb|dt (float) – Timestep length during climb phase (scalar, s) Note: this represents the timestep for the Simpson subinterval, not the whole inteval
- mission|cruise|dt (float) – Timestep length during descent phase (scalar, s) Note: this represents the timestep for the Simpson subinterval, not the whole inteval
- mission|descent|dt (float) – Timestep length during descent phase (scalar, s) Note: this represents the timestep for the Simpson subinterval, not the whole inteval
Outputs: mission|segment_fuel (float) – Fuel burn increment between each analysis point (vector, kg) Note: if the number of analysis points in one phase is nn, the number of segment fuel burns is nn - 1
Options: n_int_per_seg (int) – Number of Simpson’s rule intervals to use per mission segment. The total number of points is 2 * n_int_per_seg + 1
-
class
openconcept.analysis.mission.
MissionSegmentBatteryEnergyUsed
(**kwargs)[source]¶ Bases:
openmdao.core.explicitcomponent.ExplicitComponent
Integrates battery energy used between each analysis point
This is a helper function for the main mission analysis routine MissionNoReserves and shouldn’t be instantiated directly.
Takes 3 * nn battery loads; produces 3 * (nn - 1) energy increments
Inputs: - mission|battery_load (float) – Battery load / power for all analysis points (vector, kW)
- mission|climb|dt (float) – Timestep length during climb phase (scalar, s) Note: this represents the timestep for the Simpson subinterval, not the whole inteval
- mission|cruise|dt (float) – Timestep length during descent phase (scalar, s) Note: this represents the timestep for the Simpson subinterval, not the whole inteval
- mission|descent|dt (float) – Timestep length during descent phase (scalar, s) Note: this represents the timestep for the Simpson subinterval, not the whole inteval
Outputs: mission|segment_battery_energy_used (float) – Battery energy increment between each analysis point (vector, kW*s) Note: if the number of analysis points in one phase is nn, the number of segment energies is nn - 1
Options: n_int_per_seg (int) – Number of Simpson’s rule intervals to use per mission segment. The total number of points is 2 * n_int_per_seg + 1
-
class
openconcept.analysis.mission.
MissionSegmentWeights
(**kwargs)[source]¶ Bases:
openmdao.core.explicitcomponent.ExplicitComponent
Computes aircraft weight at each analysis point including fuel burned
This is a helper function for the main mission analysis routine MissionNoReserves and shouldn’t be instantiated directly.
Inputs: - mission|segment_fuel (float) – Fuel burn increment between each analysis point (vector, kg) Note: if the number of analysis points in one phase is nn, the number of segment fuel burns is nn - 1
- mission|weight_initial (float) – Weight immediately following takeoff (scalar, kg)
Outputs: mission|weights (float) – Aircraft weight at each analysis point (vector, kg)
Options: n_int_per_seg (int) – Number of Simpson’s rule intervals to use per mission segment. The total number of points is 2 * n_int_per_seg + 1
-
class
openconcept.analysis.mission.
MissionSegmentCL
(**kwargs)[source]¶ Bases:
openmdao.core.explicitcomponent.ExplicitComponent
Computes lift coefficient at each analysis point
This is a helper function for the main mission analysis routine MissionNoReserves and shouldn’t be instantiated directly.
Inputs: - mission|weights (float) – Aircraft weight at each analysis point (vector, kg)
- fltcond|mission|q (float) – Dynamic pressure at each analysis point (vector, Pascal)
- ac|geom|wing|S_ref (float) – Reference wing area (scalar, m**2)
- fltcond|mission|cosgamma (float) – Cosine of the flght path angle for all mission phases (vector, dimensionless)
Outputs: fltcond|mission|CL (float) – Lift coefficient (vector, dimensionless)
Options: n_int_per_seg (int) – Number of Simpson’s rule intervals to use per mission segment. The total number of points is 2 * n_int_per_seg + 1
takeoff.py¶
Analysis routines for simulating the takeoff phase and determining takeoff field length
-
class
openconcept.analysis.takeoff.
TakeoffTotalDistance
(**kwargs)[source]¶ Bases:
openmdao.core.group.Group
This analysis group calculates takeoff field length and fuel/energy consumption.
This component should be instantiated in the top-level aircraft analysis / optimization script.
Suggested variable promotion list: ‘ac|aero*’, ‘ac|weights|MTOW’, ‘ac|geom|*’, ‘fltcond|takeoff|*’, ‘takeoff|battery_load’, ‘takeoff|thrust’,’takeoff|fuel_flow’,’mission|takeoff|v*’
Inputs List:
- From aircraft config:
- ac|aero|polar|CD0_TO
- ac|aero|polar|e
- ac|geom|wing|S_ref
- ac|geom|wing|AR
- ac|weights|MTOW
- From Newton solver:
- mission|takeoff|v1
- From takeoff flight condition generator:
- mission|takeoff|vr
- From standard atmosphere model/splitter:
- fltcond|takeoff|q
- fltcond|takeoff|Utrue
- From propulsion model:
- takeoff|battery_load
- takeoff|fuel_flow
- takeoff|thrust
Outputs: - takeoff|total_fuel (float) – Total fuel burn for takeoff (scalar, kg)
- takeoff|total_battery_energy (float) – Total energy consumption for takeoff (scalar, kJ)
- takeoff|distance (float) – Takeoff distance with given propulsion settings (scalar, m)
- takeoff|distance_abort (float) – Takeoff distance if maximum braking applied at v1 speed (scalar, m)
Options: - n_int_per_seg (int) – Number of Simpson’s rule intervals to use per mission segment. The total number of points is 2 * n_int_per_seg + 1
- track_battery (bool) – Set to True to track battery energy consumption during takeoff (default False)
- track_fuel (bool) – Set to True to track fuel burned during takeoff (default False)
-
openconcept.analysis.takeoff.
takeoff_check
(prob)[source]¶ Checks to ensure positive accelerations during each takeoff phase.
In some cases, the numeric integration scheme used to calculate TOFL can give a spurious result if the airplane can’t accelerate through to V1. This function detects this case and raises an error. It should be called following every model.run_driver or run_model call.
Parameters: prob (OpenMDAO problem object) – The OpenMDAO problem object
Inputs: - ‘takeoff._rate_to_integrate_v0v1’ (float)
- ‘takeoff._rate_to_integrate_v1vr’ (float)
- ‘takeoff._rate_to_integrate_v1v0’ (float)
Raises: ValueError if negative distances are produced
-
class
openconcept.analysis.takeoff.
ComputeBalancedFieldLengthResidual
(**kwargs)[source]¶ Bases:
openmdao.core.explicitcomponent.ExplicitComponent
Computes a residual equation so Newton solver can set v1 to analyze balanced field length
- This residual is equal to zero if:
- The rejected takeoff and engine-out takeoff distances are equal, or:
- V1 is equal to VR and the engine out takeoff distance is longer than the RTO distance
Since this is a discontinous function, the partial derivatives are written in a special way to ‘coax’ the V1 value into the right setting with a Newton step. It’s kind of a hack.
Inputs: - takeoff|distance (float) – Engine-out takeoff distance (scalar, m)
- takeoff|distance_abort (float) – Distance to full-stop when takeoff is rejected at V1 (scalar, m)
- mission|takeoff|v1 (float) – Decision speed (scalar, m/s)
- mission|takeoff|vr (float) – Rotation speed (scalar, m/s)
Outputs: - BFL_residual (float) – Difference between OEI TO distance and RTO distance for diagnostic purposes (scalar, m/s)
- v1vr_diff (float) – Difference between decision and rotation speed for diagnostic purposes (scalar, m/s)
- BFL_combined (float) – Residual equation combining both criteria with special partial derivatives. Should be used for the Newton solver when doing takeoff field length analysis (scalar, m)
-
class
openconcept.analysis.takeoff.
TakeoffFlightConditions
(**kwargs)[source]¶ Bases:
openmdao.core.explicitcomponent.ExplicitComponent
Generates flight condition vectors for takeoff segments
Inputs: - mission|takeoff|h (float) – Runway altitude (scalar, m)
- mission|takeoff|v1 (float) – Takeoff decision speed (scalar, m/s)
- Vstall_eas (float) – Flaps down stall airspeed (scalar, m/s)
Outputs: - mission|takeoff|vr – Takeoff rotation speed (set as multiple of stall speed). (scalar, m/s)
- mission|takeoff|v2 – Takeoff safety speed (set as multiple of stall speed). (scalar, m/s)
- fltcond|takeoff|Ueas – Takeoff indicated/equiv. airspeed (vector, m/s)
- fltcond|takeoff|h – Takeoff altitude turned into a vector (vector, m/s)
Options: - n_int_per_seg (int) – Number of Simpson’s rule intervals to use per mission segment. The total number of points is 2 * n_int_per_seg + 1
- vr_multiple (float) – Rotation speed multiplier on top of stall speed (default 1.1)
- v2_multiple (float) – Climb out safety speed multiplier on top of stall speed (default 1.2)
-
class
openconcept.analysis.takeoff.
TakeoffCLs
(**kwargs)[source]¶ Bases:
openmdao.core.explicitcomponent.ExplicitComponent
Computes lift coefficient at every takeoff and transition analysis point.
This is a helper function for the main TOFL analysis group TakeoffTotalDistance and shoudln’t be instantiated in the top-level model directly.
During the ground roll, CL is assumed constant. During rotation and transition, a 1.2g maneuver is assumed
Inputs: - weight (float) – Takeoff weight (scalar, kg)
- fltcond|takeoff|q (float) – Dynamic pressure at each analysis point (vector, Pascals)
- ac|geom|wing|S_ref (float) – Wing reference area (scalar, m**2)
Outputs: CL_takeoff (float) – Wing lift coefficient at each TO analysis point (vector, dimensionless)
Options: - n_int_per_seg (int) – Number of Simpson’s rule intervals to use per mission segment. The total number of points is 2 * n_int_per_seg + 1
- ground_CL (float) – Assumed CL during takeoff roll (default 0.1)
-
class
openconcept.analysis.takeoff.
TakeoffAccels
(**kwargs)[source]¶ Bases:
openmdao.core.explicitcomponent.ExplicitComponent
Computes acceleration during takeoff run and returns the inverse for the integrator.
This is a helper function for the main TOFL analysis group TakeoffTotalDistance and shoudln’t be instantiated in the top-level model directly.
This returns the INVERSE of the accelerations during the takeoff run. Inverse acceleration is required due to integration wrt velocity: int( dr/dt * dt / dv) dv = int( v / a) dv
Inputs: - weight (float) – Takeoff weight (scalar, kg)
- drag (float) – Aircraft drag at each TO analysis point (vector, N)
- lift (float) – Aircraft lift at each TO analysis point (vector, N)
- takeoff|thrust (float) – Thrust at each TO analysis point (vector, N)
Outputs: _inverse_accel (float) – Inverse of the acceleration at ecah time point (vector, s**2/m)
Options: - n_int_per_seg (int) – Number of Simpson’s rule intervals to use per mission segment. The total number of points is 2 * n_int_per_seg + 1
- free_rolling_friction_coeff (float) – Rolling coefficient without brakes applied (default 0.03)
- braking_friction_coeff (float) – Rolling coefficient with max braking applied (default 0.40)
-
class
openconcept.analysis.takeoff.
TakeoffV2ClimbAngle
(**kwargs)[source]¶ Bases:
openmdao.core.explicitcomponent.ExplicitComponent
Computes climb out angle based on excess thrust.
This is a helper function for the main TOFL analysis group TakeoffTotalDistance and shoudln’t be instantiated in the top-level model directly.
Inputs: - drag_v2 (float) – Aircraft drag at v2 (climb out) flight condition (scalar, N)
- weight (float) – Takeoff weight (scalar, kg)
- takeoff|thrust_v2 (float) – Thrust at the v2 (climb out) flight condition (scalar, N)
Outputs: takeoff|climb|gamma (float) – Climb out flight path angle (scalar, rad)
-
class
openconcept.analysis.takeoff.
TakeoffTransition
(**kwargs)[source]¶ Bases:
openmdao.core.explicitcomponent.ExplicitComponent
Computes distance and altitude at end of circular transition.
This is a helper function for the main TOFL analysis group TakeoffTotalDistance and shoudln’t be instantiated in the top-level model directly.
Based on TO distance analysis method in Raymer book. Obstacle clearance height set for GA / Part 23 aircraft Override for analyzing Part 25 aircraft
Inputs: - fltcond|takeoff|Utrue_vtrans – Transition true airspeed (generally avg of vr and v2) (scalar, m/s)
- takeoff|climb|gamma (float) – Climb out flight path angle (scalar, rad)
Outputs: - s_transition (float) – Horizontal distance during transition to v2 climb out (scalar, m)
- h_transition (float) – Altitude at transition point (scalar, m)
Options: h_obstacle (float) – Obstacle height to clear (in meters) (default 10.66, equiv. 35 ft)
-
class
openconcept.analysis.takeoff.
TakeoffClimb
(**kwargs)[source]¶ Bases:
openmdao.core.explicitcomponent.ExplicitComponent
Computes ground distance from end of transition until obstacle is cleared.
This is a helper function for the main TOFL analysis group TakeoffTotalDistance and shoudln’t be instantiated in the top-level model directly.
Analysis based on Raymer book.
Inputs: - takeoff|climb|gamma (float) – Climb out flight path angle (scalar, rad)
- h_transition (float) – Altitude at transition point (scalar, m)
Outputs: s_climb (float) – Horizontal distance from end of transition until obstacle is cleared (scalar, m)
Options: h_obstacle (float) – Obstacle height to clear (in meters) (default 10.66, equiv. 35 ft)
openconcept.analysis.atmospherics¶
atmospherics_data.py¶
This module provides 1976 Standard Atmosphere constants and calculations.
Adapted from: J.P. Jasa, J.T. Hwang, and J.R.R.A. Martins: Design and Trajectory Optimization of a Morphing Wing Aircraft 2018 AIAA/ASCE/AHS/ASC Structures, Structural Dynamics, and Materials Conference; AIAA SciTech Forum, January 2018
compute_atmos_props.py¶
-
class
openconcept.analysis.atmospherics.compute_atmos_props.
ComputeAtmosphericProperties
(**kwargs)[source]¶ Bases:
openmdao.core.group.Group
Computes pressure, density, temperature, dyn pressure, and true airspeed
Inputs: - fltcond|h (float) – Altitude (vector, km)
- fltcond|Ueas (float) – Equivalent airspeed (vector, m/s)
Outputs: - fltcond|p (float) – Pressure (vector, Pa)
- fltcond|rho (float) – Density (vector, kg/m3)
- fltcond|T (float) – Temperature (vector, K)
- fltcond|Utrue (float) – True airspeed (vector, m/s)
- fltcond|q (float) – Dynamic pressure (vector, Pa)
Options: num_nodes (int) – Number of analysis points to run (sets vec length) (default 1)
-
class
openconcept.analysis.atmospherics.compute_atmos_props.
InputConverter
(**kwargs)[source]¶ Bases:
openmdao.core.explicitcomponent.ExplicitComponent
This component adds a unitized interface to the Hwang and Jasa model.
Inputs: - fltcond|h (float) – Altitude (vector, km)
- fltcond|Ueas (float) – Equivalent airspeed (vector, m/s)
Outputs: - h_km (float) – Altitude in km to pass to the standard atmosphere modules (vector, unitless)
- v_m_s (float) – Airspeed in m/s to pass to the standard atmosphere modules (vector, unitless)
Options: num_nodes (int) – Number of analysis points to run (sets vec length) (default 1)
-
class
openconcept.analysis.atmospherics.compute_atmos_props.
OutputConverter
(**kwargs)[source]¶ Bases:
openmdao.core.explicitcomponent.ExplicitComponent
This component adds a unitized interface to the Hwang and Jasa model.
Inputs: - p_MPa (float) – Pressure in megapascals from the standard atm model (vector, unitless)
- T_1e2_K (float) – Tempreature in 100K units from the std atm model (vector, unitless)
- rho_kg_m3 (float) – Density in kg / m3 from the std atm model (vector, unitless)
Outputs: - fltcond|p (float) – Pressure with units (vector, Pa)
- fltcond|rho (float) – Density with units (vector, kg/m3)
- fltcond|T (float) – Temperature with units (vector, K)
Options: num_nodes (int) – Number of analysis points to run (sets vec length) (default 1)
density_comp.py¶
-
class
openconcept.analysis.atmospherics.density_comp.
DensityComp
(**kwargs)[source]¶ Bases:
openmdao.core.explicitcomponent.ExplicitComponent
This component computes density from pressure and temperature.
Adapted from: J.P. Jasa, J.T. Hwang, and J.R.R.A. Martins: Design and Trajectory Optimization of a Morphing Wing Aircraft 2018 AIAA/ASCE/AHS/ASC Structures, Structural Dynamics, and Materials Conference; AIAA SciTech Forum, January 2018
dynamic_pressure_comp.py¶
-
class
openconcept.analysis.atmospherics.dynamic_pressure_comp.
DynamicPressureComp
(**kwargs)[source]¶ Bases:
openmdao.core.explicitcomponent.ExplicitComponent
Calculates dynamic pressure from true airspeed and density.
Inputs: - fltcond|Utrue (float) – True airspeed (vector, m/s)
- fltcond|rho (float) – Density (vector, m/s)
Outputs: fltcond|q (float) – Dynamic pressure (vector, Pa)
Options: num_nodes (int) – Number of analysis points to run (sets vec length) (default 1)
mach_number_comp.py¶
-
class
openconcept.analysis.atmospherics.mach_number_comp.
MachNumberComp
(**kwargs)[source]¶ Bases:
openmdao.core.explicitcomponent.ExplicitComponent
This component computes Mach number from stagnation Mach number, density, speed of sound, and pressure.
Adapted from: J.P. Jasa, J.T. Hwang, and J.R.R.A. Martins: Design and Trajectory Optimization of a Morphing Wing Aircraft 2018 AIAA/ASCE/AHS/ASC Structures, Structural Dynamics, and Materials Conference; AIAA SciTech Forum, January 2018
pressure_comp.py¶
-
class
openconcept.analysis.atmospherics.pressure_comp.
PressureComp
(**kwargs)[source]¶ Bases:
openmdao.core.explicitcomponent.ExplicitComponent
This component computes pressure from altitude.
Adapted from: J.P. Jasa, J.T. Hwang, and J.R.R.A. Martins: Design and Trajectory Optimization of a Morphing Wing Aircraft 2018 AIAA/ASCE/AHS/ASC Structures, Structural Dynamics, and Materials Conference; AIAA SciTech Forum, January 2018
speed_comp.py¶
-
class
openconcept.analysis.atmospherics.speed_comp.
SpeedComp
(**kwargs)[source]¶ Bases:
openmdao.core.explicitcomponent.ExplicitComponent
This component computes airspeed from Mach number and speed of sound.
Adapted from: J.P. Jasa, J.T. Hwang, and J.R.R.A. Martins: Design and Trajectory Optimization of a Morphing Wing Aircraft 2018 AIAA/ASCE/AHS/ASC Structures, Structural Dynamics, and Materials Conference; AIAA SciTech Forum, January 2018
speedofsound_comp.py¶
-
class
openconcept.analysis.atmospherics.speedofsound_comp.
SpeedOfSoundComp
(**kwargs)[source]¶ Bases:
openmdao.core.explicitcomponent.ExplicitComponent
This component computes speed of sound from temperature.
Adapted from: J.P. Jasa, J.T. Hwang, and J.R.R.A. Martins: Design and Trajectory Optimization of a Morphing Wing Aircraft 2018 AIAA/ASCE/AHS/ASC Structures, Structural Dynamics, and Materials Conference; AIAA SciTech Forum, January 2018
temperature_comp.py¶
-
class
openconcept.analysis.atmospherics.temperature_comp.
TemperatureComp
(**kwargs)[source]¶ Bases:
openmdao.core.explicitcomponent.ExplicitComponent
This component computes temperature from altitude.
Adapted from: J.P. Jasa, J.T. Hwang, and J.R.R.A. Martins: Design and Trajectory Optimization of a Morphing Wing Aircraft 2018 AIAA/ASCE/AHS/ASC Structures, Structural Dynamics, and Materials Conference; AIAA SciTech Forum, January 2018
true_airspeed.py¶
-
class
openconcept.analysis.atmospherics.true_airspeed.
TrueAirspeedComp
(**kwargs)[source]¶ Bases:
openmdao.core.explicitcomponent.ExplicitComponent
Computes true airspeed from equivalent airspeed and density
Inputs: - fltcond|rho (float) – Density (vector, kg/m3)
- fltcond|Ueas (float) – Equivalent airspeed (vector, m/s)
Outputs: fltcond|q (float) – Dynamic pressure (vector, Pa)
Options: num_nodes (int) – Number of analysis points to run (sets vec length) (default 1)
openconcept.components¶
battery.py¶
-
class
openconcept.components.battery.
SimpleBattery
(**kwargs)[source]¶ Bases:
openmdao.core.explicitcomponent.ExplicitComponent
A simple battery which tracks power limits and generates heat.
Specific energy assumption INCLUDING internal losses should be used The efficiency parameter only generates heat
Inputs: - battery_weight (float) – Weight of the battery pack (scalar, kg)
- elec_load (float) – Electric power draw upstream (vector, W)
Outputs: - max_energy (float) – Total energy in the battery at 100% SOC (scalar, Wh)
- heat_out (float) – Waste heat produced (vector, W)
- component_cost (float) – Nonrecurring cost of the component (scalar, USD)
- component_sizing_margin (float) – Equal to 1 when producing full rated power (vector, dimensionless)
Options: - num_nodes (int) – Number of analysis points to run (sets vec length; default 1)
- efficiency (float) – Shaft power efficiency. Sensible range 0.0 to 1.0 (default 1.0)
- specific_power (float) – Rated power per unit weight (default 5000, W/kg)
- specific_energy (float) – Battery energy per unit weight NOTE UNITS (default 300, !!!! Wh/kg)
- cost_inc (float) – Cost per unit weight (default 50, USD/kg)
- cost_base (float) – Base cost (default 1 USD)
generator.py¶
-
class
openconcept.components.generator.
SimpleGenerator
(**kwargs)[source]¶ Bases:
openmdao.core.explicitcomponent.ExplicitComponent
A simple generator which transforms shaft power into electrical power.
Inputs: - shaft_power_in (float) – Shaft power in to the generator (vector, W)
- elec_power_rating (float) – Electric (not mech) design power (scalar, W)
Outputs: - elec_power_out (float) – Electric power produced by the generator (vector, W)
- heat_out (float) – Waste heat produced (vector, W)
- component_cost (float) – Nonrecurring cost of the component (scalar, USD)
- component_weight (float) – Weight of the component (scalar, kg)
- component_sizing_margin (float) – Equal to 1 when producing full rated power (vector, dimensionless)
Options: - num_nodes (int) – Number of analysis points to run (sets vec length; default 1)
- efficiency (float) – Shaft power efficiency. Sensible range 0.0 to 1.0 (default 1)
- weight_inc (float) – Weight per unit rated power (default 1/5000, kg/W)
- weight_base (float) – Base weight (default 0, kg)
- cost_inc (float) – Cost per unit rated power (default 0.134228, USD/W)
- cost_base (float) – Base cost (default 1 USD) B
motor.py¶
-
class
openconcept.components.motor.
SimpleMotor
(**kwargs)[source]¶ Bases:
openmdao.core.explicitcomponent.ExplicitComponent
A simple motor which creates shaft power and draws electrical load.
Inputs: - throttle (float) – Power control setting. Should be [0, 1]. (vector, dimensionless)
- elec_power_rating (float) – Electric (not mech) design power. (scalar, W)
Outputs: - shaft_power_out (float) – Shaft power output from motor (vector, W)
- elec_load (float) – Electrical load consumed by motor (vector, W)
- heat_out (float) – Waste heat produced (vector, W)
- component_cost (float) – Nonrecurring cost of the component (scalar, USD)
- component_weight (float) – Weight of the component (scalar, kg)
- component_sizing_margin (float) – Equal to 1 when producing full rated power (vector, dimensionless)
Options: - num_nodes (int) – Number of analysis points to run (sets vec length; default 1)
- efficiency (float) – Shaft power efficiency. Sensible range 0.0 to 1.0 (default 1)
- weight_inc (float) – Weight per unit rated power (default 1/5000, kg/W)
- weight_base (float) – Base weight (default 0, kg)
- cost_inc (float) – Cost per unit rated power (default 0.134228, USD/W)
- cost_base (float) – Base cost (default 1 USD) B
propeller.py¶
-
class
openconcept.components.propeller.
SimplePropeller
(**kwargs)[source]¶ Bases:
openmdao.core.group.Group
This propeller is representative of a constant-speed prop.
The technology may be old. A general, empirical efficiency map for a constant speed turboprop is used for most of the flight regime. A static thrust coefficient map (from Raymer) is used for advance ratio < 0.2 (low speed). Linear interpolation from static thrust to dynamic thrust tables at J = 0.1 to 0.2.
Inputs: - shaft_power_in (float) – Shaft power driving the prop (vector, W)
- diameter (float) – Prop diameter (scalar, m)
- rpm (float) – Prop RPM (vector, RPM)
- fltcond|rho (float) – Air density (vector, kg/m**3)
- fltcond|Utrue (float) – True airspeed (vector, m/s)
Outputs: - thrust (float) – Propeller thrust (vector, N)
- component_weight (float) – Prop weight (scalar, kg)
Options: - num_nodes (int) – Number of analysis points to run (sets vec length; default 1)
- num_blades (int) – Number of propeller blades (default 4)
- design_cp (float) – Design cruise power coefficient (cp)
- design_J (float) – Design advance ratio (J)
splitter.py¶
-
class
openconcept.components.splitter.
PowerSplit
(**kwargs)[source]¶ Bases:
openmdao.core.explicitcomponent.ExplicitComponent
A power split mechanism for mechanical or electrical power.
Inputs: - power_in (float) – Power fed to the splitter. (vector, W)
- power_rating (float) – Maximum rated power of the split mechanism. (scalar, W)
- power_split_fraction – If ‘rule’ is set to ‘fraction’, sets percentage of input power directed to Output A (minus losses). (vector, dimensionless)
- power_split_amount – If ‘rule’ is set to ‘fixed’, sets amount of input power to Output A (minus losses). (vector, W)
Outputs: - power_out_A (float) – Power sent to first output (vector, W)
- power_out_B (float) – Power sent to second output (vector, W)
- heat_out (float) – Waste heat produced (vector, W)
- component_cost (float) – Nonrecurring cost of the component (scalar, USD)
- component_weight (float) – Weight of the component (scalar, kg)
- component_sizing_margin (float) – Equal to 1 when fed full rated power (vector, dimensionless)
Options: - num_nodes (int) – Number of analysis points to run (sets vec length; default 1)
- rule (str) – Power split control rule to use
- efficiency (float) – Component efficiency (default 1)
- weight_inc (float) – Weight per unit rated power (default 0, kg/W)
- weight_base (float) – Base weight (default 0, kg)
- cost_inc (float) – Nonrecurring cost per unit power (default 0, USD/W)
- cost_base (float) – Base cost (default 0 USD)
turboshaft.py¶
-
class
openconcept.components.turboshaft.
SimpleTurboshaft
(**kwargs)[source]¶ Bases:
openmdao.core.explicitcomponent.ExplicitComponent
A simple turboshaft which generates shaft power consumes fuel.
This model assumes constant power specific fuel consumption (PSFC).
Inputs: - shaft_power_rating (float) – Rated power of the turboshaft (scalar, W)
- throttle (float) – Engine throttle. Controls power and fuel flow. Produces 100% of rated power at throttle = 1. Should be in range 0 to 1 or slightly above 1. (vector, dimensionless)
Outputs: - shaft_power_out (float) – Shaft power produced by the engine (vector, W)
- fuel_flow (float) – Fuel flow consumed (vector, kg/s) FUEL FLOW IS NEGATIVE!
- component_cost (float) – Nonrecurring cost of the component (scalar, USD)
- component_weight (float) – Weight of the component (scalar, kg)
- component_sizing_margin (float) – Equal to 1 when producing full rated power (vector, dimensionless)
Options: - num_nodes (int) – Number of analysis points to run (sets vec length; default 1)
- psfc (float) – Power specific fuel consumption. (default 0.6*1.69e-7 kg/W/s) Conversion from lb/hp/hr to kg/W/s is 1.69e-7
- weight_inc (float) – Weight per unit rated power Override this with a reasonable value for your power class (default 0, kg/W)
- weight_base (float) – Base weight This is a bad assumption for most turboshafts (default 0, kg)
- cost_inc (float) – Nonrecurring cost per unit power (default 1.04, USD/W)
- cost_base (float) – Base cost (default 0 USD)
openconcept.utilities¶
dict_indepvarcomp.py¶
-
class
openconcept.utilities.dict_indepvarcomp.
DictIndepVarComp
(data_dict, **kwargs)[source]¶ Bases:
openmdao.core.indepvarcomp.IndepVarComp
Create indep variables from an external file with a Python dictionary.
Outputs from this component are read from a Python dictionary and given a name matching their location in the data tree.
For example, let’s assume we have stored some data about a vehicle in a dictionary which can be accessed using the Python expression vehicledata[‘wheels’][‘diameter’]. The structured_name in this case is ‘wheels|diameter’.
The user instantiates a component as DictIndepVarComp(vehicledata) and adds an output as follows: component_instance.add_output_from_dict(‘wheels|diameter’).
Outputs are created after initialization and are user-defined.
-
_data_dict
¶ dict – A structured dictionary object with input data to read from.
-
__init__
(data_dict, **kwargs)[source]¶ Initialize the component and store the data dictionary as an attribute.
Parameters: data_dict (dict) – A structured dictionary object with input data to read from
-
add_output_from_dict
(structured_name, separator='|', **kwargs)[source]¶ Create a new output based on data from the data dictionary
Parameters: - structured_name (string) – A string matching the file structure in the dictionary object Pipe symbols indicate treeing down one level Example ‘aero:CLmax_flaps30’ accesses data_dict[‘aero’][‘CLmax_flaps30’]
- separator (string) – Separator to tree down into the data dict. Default ‘:’ probably shouldn’t be overridden
-
dvlabel.py¶
-
class
openconcept.utilities.dvlabel.
DVLabel
(vars_list)[source]¶ Bases:
openmdao.core.explicitcomponent.ExplicitComponent
Helper component that is needed when variables must be passed directly from input to output of an element with no other component in between.
This component is adapted from Justin Gray’s pyCycle software.
Inputs: Inputs to this component are set upon initialization. Outputs: Outputs from this component are set upon initialization. Options: vars_list (iterable) – A list of lists. One outer list entry per variable. Format: [[‘input name’,’output name’,’val’,’units’]]
linearinterp.py¶
-
class
openconcept.utilities.linearinterp.
LinearInterpolator
(**kwargs)[source]¶ Bases:
openmdao.core.explicitcomponent.ExplicitComponent
Create a linearly interpolated set of points including two end points
Inputs: - start_val (float) – Starting value (scalar; units set from “units” option)
- end_val (float) – Ending value (scalar; units set from “units” option)
Outputs: vec (float) – Vector of linearly interpolated points (scalar; units set from “units” opt)
Options: - units (str, None) – Units for inputs and outputs
- num_nodes (int) – Number of linearly interpolated points to produce (minimum/default 2)
openconcept.utilities.math¶
add_subtract_comp.py¶
Definition of the Add/Subtract Component.
-
class
openconcept.utilities.math.add_subtract_comp.
AddSubtractComp
(output_name=None, input_names=None, vec_size=1, length=1, val=1.0, scaling_factors=None, **kwargs)[source]¶ Bases:
openmdao.core.explicitcomponent.ExplicitComponent
Compute a vectorized element-wise addition or subtraction.
Use the add_equation method to define any number of add/subtract relations User defines the names of the input and output variables using add_equation(output_name=’my_output’, input_names=[‘a’,’b’, ‘c’, …])
\[result = a * \textrm{scaling factor}_a + b * \textrm{scaling factor}_b + c * \textrm{scaling factor}_c + ...\]- where:
- all inputs shape (vec_size, n)
- b is of shape (vec_size, n)
- c is of shape (vec_size, n)
Result is of shape (vec_size, n)
All input vectors must be of the same shape, specified by the options ‘vec_size’ and ‘length’. Use scaling factor -1 for subtraction.
-
_add_systems
¶ list – List of equation systems to be initialized with the system.
-
__init__
(output_name=None, input_names=None, vec_size=1, length=1, val=1.0, scaling_factors=None, **kwargs)[source]¶ Allow user to create an addition/subtracton system with one-liner.
Parameters: - output_name (str) – (required) name of the result variable in this component’s namespace.
- input_names (iterable of str) – (required) names of the input variables for this system
- vec_size (int) – Length of the first dimension of the input and output vectors (i.e number of rows, or vector length for a 1D vector) Default is 1
- length (int) – Length of the second dimension of the input and ouptut vectors (i.e. number of columns) Default is 1 which results in input/output vectors of size (vec_size,)
- scaling_factors (iterable of numeric) – Scaling factors to apply to each input. Use [1,1,…] for addition, [1,-1,…] for subtraction Must be same length as input_names Default is None which results in a scaling factor of 1 on each input (element-wise addition)
- val (float or list or tuple or ndarray) – The initial value of the variable being added in user-defined units. Default is 1.0.
- **kwargs (str) – Any other arguments to pass to the addition system (same as add_output method for ExplicitComponent) Examples include units (str or None), desc (str)
-
initialize
()[source]¶ Declare options.
Parameters: complex (Boolean) – Set True to enable complex math (e.g. for complex step verification)
-
add_equation
(output_name, input_names, vec_size=1, length=1, val=1.0, units=None, res_units=None, desc='', lower=None, upper=None, ref=1.0, ref0=0.0, res_ref=None, var_set=0, scaling_factors=None)[source]¶ Add an addition/subtraction relation.
Parameters: - output_name (str) – (required) name of the result variable in this component’s namespace.
- input_names (iterable of str) – (required) names of the input variables for this system
- vec_size (int) – Length of the first dimension of the input and output vectors (i.e number of rows, or vector length for a 1D vector) Default is 1
- length (int) – Length of the second dimension of the input and ouptut vectors (i.e. number of columns) Default is 1 which results in input/output vectors of size (vec_size,)
- scaling_factors (iterable of numeric) – Scaling factors to apply to each input. Use [1,1,…] for addition, [1,-1,…] for subtraction Must be same length as input_names Default is None which results in a scaling factor of 1 on each input (element-wise addition)
- val (float or list or tuple or ndarray) – The initial value of the variable being added in user-defined units. Default is 1.0.
- units (str or None) – Units in which the output variables will be provided to the component during execution. Default is None, which means it has no units.
- res_units (str or None) – Units in which the residuals of this output will be given to the user when requested. Default is None, which means it has no units.
- desc (str) – description of the variable.
- lower (float or list or tuple or ndarray or Iterable or None) – lower bound(s) in user-defined units. It can be (1) a float, (2) an array_like consistent with the shape arg (if given), or (3) an array_like matching the shape of val, if val is array_like. A value of None means this output has no lower bound. Default is None.
- upper (float or list or tuple or ndarray or or Iterable None) – upper bound(s) in user-defined units. It can be (1) a float, (2) an array_like consistent with the shape arg (if given), or (3) an array_like matching the shape of val, if val is array_like. A value of None means this output has no upper bound. Default is None.
- ref (float or ndarray) – Scaling parameter. The value in the user-defined units of this output variable when the scaled value is 1. Default is 1.
- ref0 (float or ndarray) – Scaling parameter. The value in the user-defined units of this output variable when the scaled value is 0. Default is 0.
- res_ref (float or ndarray) – Scaling parameter. The value in the user-defined res_units of this output’s residual when the scaled value is 1. Default is 1.
- var_set (hashable object) – For advanced users only. ID or color for this variable, relevant for reconfigurability. Default is 0.
combine_split_comp.py¶
Definition of the Vector Combiner/Splitter Component.
-
class
openconcept.utilities.math.combine_split_comp.
VectorConcatenateComp
(output_name=None, input_names=None, vec_sizes=None, length=1, val=1.0, **kwargs)[source]¶ Bases:
openmdao.core.explicitcomponent.ExplicitComponent
Concatenate one or more sets of more than one vector into one or more output vectors.
Use the add_relation method to define any number of concat relationships User defines the names of the input and output variables using add_relation(output_name=’my_output’, input_names=[‘a’,’b’, ‘c’, …],vec_sizes=[10,10,5,…])
For each relation declared: All input vectors must be of the same second dimension, specified by the option ‘length’. The number of vec_sizes given must match the number of inputs declared. Input units must be compatible with output units for each relation.
-
_add_systems
¶ list – List of equation systems to be initialized with the system.
-
__init__
(output_name=None, input_names=None, vec_sizes=None, length=1, val=1.0, **kwargs)[source]¶ Allow user to create an addition/subtracton system with one-liner.
Parameters: - output_name (str) – (required) name of the result variable in this component’s namespace.
- input_names (iterable of str) – (required) names of the input variables for this system
- vec_sizes (iterable of int) – (required) Lengths of the first dimension of each input vector (i.e number of rows, or vector length for a 1D vector)
- length (int) – Length of the second dimension of the input and ouptut vectors (i.e. number of columns) Default is 1 (i.e. a vector of scalars)
- val (float or list or tuple or ndarray) – The initial value of the variable being added in user-defined units. Default is 1.0.
- **kwargs (str) – Any other arguments to pass to the addition system (same as add_output method for ExplicitComponent) Examples include units (str or None), desc (str)
-
initialize
()[source]¶ Declare options.
Parameters: complex (Boolean) – Set True to enable complex math (e.g. for complex step verification)
-
add_relation
(output_name, input_names, vec_sizes, length=1, val=1.0, units=None, res_units=None, desc='', lower=None, upper=None, ref=1.0, ref0=0.0, res_ref=None, var_set=0)[source]¶ Add a concatenation relation.
Parameters: - output_name (str) – (required) name of the result variable in this component’s namespace.
- input_names (iterable of str) – (required) names of the input variables for this system
- vec_sizes (iterable of int) – (required) Lengths of the first dimension of each input vector (i.e number of rows, or vector length for a 1D vector)
- length (int) – Length of the second dimension of the input and ouptut vectors (i.e. number of columns) Default is 1 (i.e. a vector of scalars)
- val (float or list or tuple or ndarray) – The initial value of the variable being added in user-defined units. Default is 1.0.
- units (str or None) – Units in which the output variables will be provided to the component during execution. Default is None, which means it has no units.
- res_units (str or None) – Units in which the residuals of this output will be given to the user when requested. Default is None, which means it has no units.
- desc (str) – description of the variable.
- lower (float or list or tuple or ndarray or Iterable or None) – lower bound(s) in user-defined units. It can be (1) a float, (2) an array_like consistent with the shape arg (if given), or (3) an array_like matching the shape of val, if val is array_like. A value of None means this output has no lower bound. Default is None.
- upper (float or list or tuple or ndarray or or Iterable None) – upper bound(s) in user-defined units. It can be (1) a float, (2) an array_like consistent with the shape arg (if given), or (3) an array_like matching the shape of val, if val is array_like. A value of None means this output has no upper bound. Default is None.
- ref (float or ndarray) – Scaling parameter. The value in the user-defined units of this output variable when the scaled value is 1. Default is 1.
- ref0 (float or ndarray) – Scaling parameter. The value in the user-defined units of this output variable when the scaled value is 0. Default is 0.
- res_ref (float or ndarray) – Scaling parameter. The value in the user-defined res_units of this output’s residual when the scaled value is 1. Default is 1.
- var_set (hashable object) – For advanced users only. ID or color for this variable, relevant for reconfigurability. Default is 0.
-
-
class
openconcept.utilities.math.combine_split_comp.
VectorSplitComp
(output_names=None, input_name=None, vec_sizes=None, length=1, val=1.0, **kwargs)[source]¶ Bases:
openmdao.core.explicitcomponent.ExplicitComponent
Splits one or more vectors into one or more sets of 2+ vectors.
Use the add_relation method to define any number of splitter relationships User defines the names of the input and output variables using add_relation(output_names=[‘a’,’b’, ‘c’, …],input_name=’my_input’,vec_sizes=[10,10,5,…])
For each relation declared: All output vectors must be of the same second dimension, specified by the option ‘length’. The first dim length of the input vector must equal the sum of the first dim lengths of the output vectors. The number of vec_sizes given must match the number of outputs declared. Input units must be compatible with output units for each relation.
-
_add_systems
¶ list – List of equation systems to be initialized with the system.
-
__init__
(output_names=None, input_name=None, vec_sizes=None, length=1, val=1.0, **kwargs)[source]¶ Allow user to create an addition/subtracton system with one-liner.
Parameters: - output_names (iterable of str) – (required) names of the output (split) variables in this component’s namespace.
- input_name (str) – (required) names of the input variable for this system
- vec_sizes (iterable of int) – (required) Lengths of the first dimension of each input vector (i.e number of rows, or vector length for a 1D vector)
- length (int) – Length of the second dimension of the input and ouptut vectors (i.e. number of columns) Default is 1 (i.e. a vector of scalars)
- val (float or list or tuple or ndarray) – The initial value of the variable being added in user-defined units. Default is 1.0.
- **kwargs (str) – Any other arguments to pass to the addition system (same as add_output method for ExplicitComponent) Examples include units (str or None), desc (str)
-
initialize
()[source]¶ Declare options.
Parameters: complex (Boolean) – Set True to enable complex math (e.g. for complex step verification)
-
add_relation
(output_names, input_name, vec_sizes, length=1, val=1.0, units=None, res_units=None, desc='', lower=None, upper=None, ref=1.0, ref0=0.0, res_ref=None, var_set=0)[source]¶ Add a concatenation relation.
Parameters: - output_names (iterable of str) – (required) names of the output (split) variables in this component’s namespace.
- input_name (str) – (required) names of the input variable for this system
- vec_sizes (iterable of int) – (required) Lengths of the first dimension of each input vector (i.e number of rows, or vector length for a 1D vector)
- length (int) – Length of the second dimension of the input and ouptut vectors (i.e. number of columns) Default is 1 (i.e. a vector of scalars)
- val (float or list or tuple or ndarray) – The initial value of the variable being added in user-defined units. Default is 1.0.
- units (str or None) – Units in which the output variables will be provided to the component during execution. Default is None, which means it has no units.
- res_units (str or None) – Units in which the residuals of this output will be given to the user when requested. Default is None, which means it has no units.
- desc (str) – description of the variable.
- lower (float or list or tuple or ndarray or Iterable or None) – lower bound(s) in user-defined units. It can be (1) a float, (2) an array_like consistent with the shape arg (if given), or (3) an array_like matching the shape of val, if val is array_like. A value of None means this output has no lower bound. Default is None.
- upper (float or list or tuple or ndarray or or Iterable None) – upper bound(s) in user-defined units. It can be (1) a float, (2) an array_like consistent with the shape arg (if given), or (3) an array_like matching the shape of val, if val is array_like. A value of None means this output has no upper bound. Default is None.
- ref (float or ndarray) – Scaling parameter. The value in the user-defined units of this output variable when the scaled value is 1. Default is 1.
- ref0 (float or ndarray) – Scaling parameter. The value in the user-defined units of this output variable when the scaled value is 0. Default is 0.
- res_ref (float or ndarray) – Scaling parameter. The value in the user-defined res_units of this output’s residual when the scaled value is 1. Default is 1.
- var_set (hashable object) – For advanced users only. ID or color for this variable, relevant for reconfigurability. Default is 0.
-
multiply_divide_comp.py¶
Definition of the Element Multiply Component.
-
class
openconcept.utilities.math.multiply_divide_comp.
ElementMultiplyDivideComp
(output_name=None, input_names=None, vec_size=1, length=1, val=1.0, scaling_factor=1, divide=None, input_units=None, **kwargs)[source]¶ Bases:
openmdao.core.explicitcomponent.ExplicitComponent
Compute a vectorized element-wise multiplication and/or division.
Use the add_equation method to define any number of mult/div relations User defines the names of the input and output variables using add_equation(output_name=’my_output’, input_names=[‘a’,’b’, ‘c’, …], divide=[False,False,True,…])
\[result = (a * b / c ....) * \textrm{scaling factor}\]- where:
- all inputs shape (vec_size, n)
- b is of shape (vec_size, n)
- c is of shape (vec_size, n)
Result is of shape (vec_size, n)
All input vectors must be of the same shape, specified by the options ‘vec_size’ and ‘length’. Use scaling factor -1 for subtraction.
-
_add_systems
¶ list – List of equation systems to be initialized with the system.
-
__init__
(output_name=None, input_names=None, vec_size=1, length=1, val=1.0, scaling_factor=1, divide=None, input_units=None, **kwargs)[source]¶ Allow user to create an multiplication system with one-liner.
Parameters: - output_name (str) – (required) name of the result variable in this component’s namespace.
- input_names (iterable of str) – (required) names of the input variables for this system
- vec_size (int) – Length of the first dimension of the input and output vectors (i.e number of rows, or vector length for a 1D vector) Default is 1
- length (int) – Length of the second dimension of the input and ouptut vectors (i.e. number of columns) Default is 1 which results in input/output vectors of size (vec_size,)
- scaling_factor (numeric) – Scaling factor to apply to the whole system Default is 1
- divide (iterable of bool or None) – True to use division operator, False to use mult operator Default is None which results in mult of every input Length is same as number of inputs
- val (float or list or tuple or ndarray) – The initial value of the variable being added in user-defined units. Default is 1.0.
- input_units (iterable of str) – Units for each of the input vectors in order. Output units will be dimensionally consistent.
- **kwargs (str) – Any other arguments to pass to the addition system (same as add_output method for ExplicitComponent) Examples include units (str or None), desc (str)
-
initialize
()[source]¶ Declare options.
Parameters: complex (Boolean) – Set True to enable complex math (e.g. for complex step verification)
-
add_equation
(output_name, input_names, vec_size=1, length=1, val=1.0, res_units=None, desc='', lower=None, upper=None, ref=1.0, ref0=0.0, res_ref=None, var_set=0, scaling_factor=1, divide=None, input_units=None)[source]¶ Add a multiplication relation.
Parameters: - output_name (str) – (required) name of the result variable in this component’s namespace.
- input_names (iterable of str) – (required) names of the input variables for this system
- vec_size (int) – Length of the first dimension of the input and output vectors (i.e number of rows, or vector length for a 1D vector) Default is 1
- length (int) – Length of the second dimension of the input and ouptut vectors (i.e. number of columns) Default is 1 which results in input/output vectors of size (vec_size,)
- scaling_factor (numeric) – Scaling factor to apply to the whole system Default is 1
- divide (iterable of bool or None) – True to use division operator, False to use mult operator Default is None which results in mult of every input Length is same as number of inputs
- val (float or list or tuple or ndarray) – The initial value of the variable being added in user-defined units. Default is 1.0.
- input_units (iterable of str) – Units for each of the input vectors in order. Output units will be dimensionally consistent.
- res_units (str or None) – Units in which the residuals of this output will be given to the user when requested. Default is None, which means it has no units.
- desc (str) – description of the variable.
- lower (float or list or tuple or ndarray or Iterable or None) – lower bound(s) in user-defined units. It can be (1) a float, (2) an array_like consistent with the shape arg (if given), or (3) an array_like matching the shape of val, if val is array_like. A value of None means this output has no lower bound. Default is None.
- upper (float or list or tuple or ndarray or or Iterable None) – upper bound(s) in user-defined units. It can be (1) a float, (2) an array_like consistent with the shape arg (if given), or (3) an array_like matching the shape of val, if val is array_like. A value of None means this output has no upper bound. Default is None.
- ref (float or ndarray) – Scaling parameter. The value in the user-defined units of this output variable when the scaled value is 1. Default is 1.
- ref0 (float or ndarray) – Scaling parameter. The value in the user-defined units of this output variable when the scaled value is 0. Default is 0.
- res_ref (float or ndarray) – Scaling parameter. The value in the user-defined res_units of this output’s residual when the scaled value is 1. Default is 1.
- var_set (hashable object) – For advanced users only. ID or color for this variable, relevant for reconfigurability. Default is 0.
simpson_integration.py¶
-
openconcept.utilities.math.simpson_integration.
simpson_integral
(dts, q, n_segments=1, n_simpson_intervals_per_segment=2)[source]¶ This method integrates a rate over time using Simpson’s rule
A “segment” is defined as a portion of the quantity vector q with a constant delta t (or delta x, etc) dts = list of doubles representing the time steps for each segment. This is the data timestep - the interval timestep is 2x this q = the data to be integrated n_segments = how many segments n_simpson_intervals_per_segment = how many simpson intervals to use per segment. Each one requires 2*N+1 data points
Returns: - delta_q (float) – Amount of q accumulated during each interval (vector)
- int_q (float) – Total amount of q accumulated during all phases (scalar)
-
openconcept.utilities.math.simpson_integration.
simpson_partials
(dts, q, n_segments=1, n_simpson_intervals_per_segment=2)[source]¶ This method integrates a rate over time using Simpson’s rule
A “segment” is defined as a portion of the quantity vector q with a constant delta t (or delta x, etc) dts = list of doubles representing the time steps for each segment. This is the data timestep - the interval timestep is 2x this q = the data to be integrated n_segments = how many segments n_simpson_intervals_per_segment = how many simpson intervals to use per segment. Each one requires 2*N+1 data points
Returns: - delta_q (float) – Amount of q accumulated during each interval (vector)
- int_q (float) – Total amount of q accumulated during all phases (scalar)
-
openconcept.utilities.math.simpson_integration.
simpson_integral_every_node
(dts, q, n_segments=1, n_simpson_intervals_per_segment=2)[source]¶ This method integrates a rate over time using Simpson’s rule and assumes that q linearly changes within the Simpson subintervals. Unlike the intervals above, this method returns a vector of length nn-1 instead of nn-1/2 A “segment” is defined as a portion of the quantity vector q with a constant delta t (or delta x, etc) dts = list of doubles representing the time steps for each segment. This is the data timestep - the interval timestep is 2x this q = the data to be integrated n_segments = how many segments n_simpson_intervals_per_segment = how many simpson intervals to use per segment. Each one requires 2*N+1 data points
returns: delta_q = amount of q accumulated during each interval (corresponds to the intervals between q, 2x as often as the simpson subintervals) int_q = total amount of q accumulated during all phases
-
class
openconcept.utilities.math.simpson_integration.
IntegrateQuantity
(**kwargs)[source]¶ Bases:
openmdao.core.explicitcomponent.ExplicitComponent
This component integrates a first-order rate quantity vector over a differential with CONSTANT spacing using Simpson’s 3rd order method. Inputs: rate (vector) - rate of change of a quantity q with respect to the differential. E.g. if your differential is time, the rate should be dq/dt. Length must be 2*N+1 lower_limit (scalar) - the lower limit of the integral. e.g. if your differential var is time, lower_limit is t0 upper_limit (scalar) - the upper limit of the integral. e.g. if your differential var is time, upper limit is tf Outputs: delta_quantity: the total change in the quantity over the integral period. E.g. if integrating rate dq/dt wrt t, output is total change in q Options: num_intervals: Number of Simpson integration intevals to use. Length of the rate input vector will be 2*N+1 quantity_units: Units of quantity (not including the rate) e.g. kg NOT kg/s diff_units: Units of the differential (not incuding the quantity) e.g. s, not kg/s
Example 1: integrate v (dr/dt) with respect to time over constant time spacing during a fixed-time segment Example 2: integrate v / a, a.k.a [(dr/dt) * (dt/dv)] wrt velocity over constant velocity spacing during a segment with known starting and ending velocities
sum_comp.py¶
Definition of the Element Summation Component.
-
class
openconcept.utilities.math.sum_comp.
SumComp
(output_name=None, input_name=None, vec_size=1, length=1, val=1.0, scaling_factor=1, **kwargs)[source]¶ Bases:
openmdao.core.explicitcomponent.ExplicitComponent
Compute a vectorized summation.
Use the add_equation method to define any number of summations User defines the names of the input and output variables using add_equation(output_name=’my_output’, input_name=’my_input’)
Use option axis = None to sum over all array elements. Default behavior sums along the columns.
\[\textrm{result}_j = \sum_{i=1} ^\text{vec_size} a_{ij} * \textrm{scaling factor}\]- where
- a is shape (vec_size, n)
- b is of shape (vec_size, n)
- c is of shape (vec_size, n)
Result is of shape (1, n) or (1, )
-
_add_systems
¶ list – List of equation systems to be initialized with the system.
-
__init__
(output_name=None, input_name=None, vec_size=1, length=1, val=1.0, scaling_factor=1, **kwargs)[source]¶ Allow user to create an multiplication system with one-liner.
Parameters: - output_name (str) – (required) name of the result variable in this component’s namespace.
- input_name (str) – (required) name of the input variable for this system
- vec_size (int) – Length of the first dimension of the input and output vectors (i.e number of rows, or vector length for a 1D vector) Default is 1
- length (int) – Length of the second dimension of the input and ouptut vectors (i.e. number of columns) Default is 1 which results in input/output vectors of size (vec_size,)
- scaling_factor (numeric) – Scaling factor to apply to the whole system Default is 1
- val (float or list or tuple or ndarray) – The initial value of the variable being added in user-defined units. Default is 1.0.
- **kwargs (str) – Any other arguments to pass to the addition system (same as add_output method for ExplicitComponent) Examples include units (str or None), desc (str)
-
initialize
()[source]¶ Declare options.
Parameters: axis (int or None) – Sum along this axis. Default 0 sums along first dimension. None sums all elements into a scalar. 1 sums along rows.
-
add_equation
(output_name, input_name, vec_size=1, length=1, val=1.0, units=None, res_units=None, desc='', lower=None, upper=None, ref=1.0, ref0=0.0, res_ref=None, var_set=0, scaling_factor=1)[source]¶ Add a multiplication relation.
Parameters: - output_name (str) – (required) name of the result variable in this component’s namespace.
- input_name (iterable of str) – (required) names of the input variables for this system
- vec_size (int) – Length of the first dimension of the input and output vectors (i.e number of rows, or vector length for a 1D vector) Default is 1
- length (int) – Length of the second dimension of the input and ouptut vectors (i.e. number of columns) Default is 1 which results in input/output vectors of size (vec_size,)
- scaling_factor (numeric) – Scaling factor to apply to the whole system Default is 1
- val (float or list or tuple or ndarray) – The initial value of the variable being added in user-defined units. Default is 1.0.
- units (str or None) – Units in which the output variables will be provided to the component during execution. Default is None, which means it has no units.
- res_units (str or None) – Units in which the residuals of this output will be given to the user when requested. Default is None, which means it has no units.
- desc (str) – description of the variable.
- lower (float or list or tuple or ndarray or Iterable or None) – lower bound(s) in user-defined units. It can be (1) a float, (2) an array_like consistent with the shape arg (if given), or (3) an array_like matching the shape of val, if val is array_like. A value of None means this output has no lower bound. Default is None.
- upper (float or list or tuple or ndarray or or Iterable None) – upper bound(s) in user-defined units. It can be (1) a float, (2) an array_like consistent with the shape arg (if given), or (3) an array_like matching the shape of val, if val is array_like. A value of None means this output has no upper bound. Default is None.
- ref (float or ndarray) – Scaling parameter. The value in the user-defined units of this output variable when the scaled value is 1. Default is 1.
- ref0 (float or ndarray) – Scaling parameter. The value in the user-defined units of this output variable when the scaled value is 0. Default is 0.
- res_ref (float or ndarray) – Scaling parameter. The value in the user-defined res_units of this output’s residual when the scaled value is 1. Default is 1.
- var_set (hashable object) – For advanced users only. ID or color for this variable, relevant for reconfigurability. Default is 0.
Development Roadmap¶
OpenConcept is in its infancy and is basically the product of one conference paper and a few months of work by one person.
- Known issues to be addressed include:
- No support for compressibility in the standard atmosphere / airspeed calculations
- No support for additional mission phases (especially a diversion/reserve mission)
- Spotty automated testing coverage
- Spotty documentation coverage
- Difficulty accessing / plotting optimized aircraft results (I hacked together some custom OpenMDAO/matplotlib code for this)
- Upcoming major features will include:
- Heat exchanger / coolant loop components
- Future ideas include:
- OpenAeroStruct integration (once OAS is upgraded to OpenMDAO 2.x)
I can use feedback on the design of the API; in particular, the airplane data structure.