Giter Site home page Giter Site logo

openconcept's Introduction

OpenConcept - A conceptual design toolkit with efficient gradients implemented in the OpenMDAO framework

Authors: Benjamin J. Brelje and Eytan J. Adler

Build Coverage Documentation PyPI PyPI - Downloads

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.

OpenConcept is capable of modeling a wide range of propulsion systems, including detailed thermal management systems. The following figure (from this paper) shows one such system that is modeled in the N3_HybridSingleAisle_Refrig.py example.

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.

Example charts

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.

Documentation

Automatically-generated documentation is available at (https://mdolab-openconcept.readthedocs-hosted.com/en/latest/).

To build the docs locally, install the sphinx_mdolab_theme via pip. Then enter the doc folder in the root directory and run make html. The built documentation can be viewed by opening _build/html/index.html. OpenAeroStruct is required (also installable via pip) to build the OpenAeroStruct portion of the source docs.

Getting Started

OpenConcept can be pip installed directly from PyPI

pip install openconcept

To run the examples or edit the source code:

  1. Clone the repo to disk (git clone https://github.com/mdolab/openconcept)
  2. Navigate to the root openconcept folder
  3. Run pip install -e . to install the package (the -e can be omitted if not editing the source)

Get started by following the tutorials in the documentation to learn the most important parts of OpenConcept. The features section of the documentation describes most of the components and system models available in OpenConcept.

Requirements

OpenConcept is tested regularly on builds with the oldest and latest supported package versions. The package versions in the oldest and latest builds are the following:

Package Oldest Latest
Python 3.8 3.11
OpenMDAO 3.21 3.30
NumPy 1.20 1.26
SciPy 1.7.0 latest
OpenAeroStruct latest latest

Citation

Please cite this software by reference to the conference paper:

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: 10.2514/6.2018-4979

@inproceedings{Brelje2018a,
	address = {{C}incinnati,~{OH}},
	author = {Benjamin J. Brelje and Joaquim R. R. A. Martins},
	booktitle = {Proceedings of the AIAA/IEEE Electric Aircraft Technologies Symposium},
	doi = {10.2514/6.2018-4979},
	month = {July},
	title = {Development of a Conceptual Design Model for Aircraft Electric Propulsion with Efficient Gradients},
	year = {2018}
}

If using the integrated OpenAeroStruct VLM or aerostructural aerodynamic models, please cite the following conference paper:

Eytan J. Adler and Joaquim R. R. A. Martins, "Efficient Aerostructural Wing Optimization Considering Mission Analysis", Journal of Aircraft, 2022. DOI: 10.2514/1.c037096

@article{Adler2022d,
	author = {Adler, Eytan J. and Martins, Joaquim R. R. A.},
	doi = {10.2514/1.c037096},
	issn = {1533-3868},
	journal = {Journal of Aircraft},
	month = {December},
	publisher = {American Institute of Aeronautics and Astronautics},
	title = {Efficient Aerostructural Wing Optimization Considering Mission Analysis},
	year = {2022}
}

openconcept's People

Contributors

bbrelje avatar bernardopacini avatar ewu63 avatar eytanadler avatar kanekosh avatar mariejvaucher avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

openconcept's Issues

Add autodocs

No documentation. Add docstrings for sphinx throughout

RTD is broken

Description

#26 broke RTD, which apparently relied on the environment.yml file. Either add it back or change RTD setup to fix docs building.

Trajectory linkage broken after OpenMDAO 3.4 update

Hi,

I'm a Ph.D. student working at Prof. Kennedy's group at Georgia Tech. I'm doing research about electric propulsion aircraft and using the OpenConcept library. I meet some issues when running the examples TBM850.py, and the issue shows below:

(File "/Users/libao/git/openconcept/openconcept/analysis/trajectories.py", line 14, in find_integrators_in_model
next_namespace = subsys.name
AttributeError: 'str' object has no attribute 'name')

I try to switch my interpreter from python 3.8.3 to python 2.7, the issue still exists. By the way, the OpenMDAO version I used is 3.4.1. I attached a screenshot of my terminal for the issue in case you want to have a look.

截屏2020-10-16 下午1 50 34

Thank you,
Bao Li

Make compatible with scipy 1.1

For unknown reasons the scipyoptimizedriver breaks when used with Scipy 1.1 or higher. This is probably an openmdao bug but can't be sure

Broken N2 diagrams in docs

Description

The N2 diagrams in the OpenConcept documentation are broken. For example, the one in the minimal example tutorial looks like this:
image

`takeoff|h` does not work as expected with takeoff phases

Description

The takeoff|h parameter does set the takeoff and landing altitudes for the BasicMission and MissionWithReserve (though the ground roll in the BasicMission uses its own fltcond|h value). However, the takeoff phase altitudes in the FullMissionAnalysis and FullMissionWithReserve are actually set via each takeoff phases fltcond|h. The takeoff's rotation phase does have an h_initial variable which sets its initial altitude, but then only the obstacle height is connected to the climb phase's initial altitude (not h_initial + obstacle height as you may expect).

We typically leave the takeoff altitude at 0 ft. In this case, everything works as expected, so this does not mean that past cases are wrong. However, future users may adjust this value and they would not get the expected result if they are using the BasicMission with the ground roll phase or either full mission with takeoff phases.

Add more detailed docs

Description of feature

Add more detail to the docs. Some initial ideas are

  • Beginners guide: introduction to building a simple aircraft model (discussing the necessary parts) and mission analysis
  • Advanced guide: discuss introducing more complex propulsion models, thermal models (unsteady components), or mission profiles
  • Tour of existing tools: describe the existing models that can be used for each discipline and where they can be found
  • Developer's guide: what you need to know for developing your own models (for propulsion, hydrogen, aerodynamics, etc.)

OpenMDAO v3.31 internal `_setup_procs` change breaks `PhaseGroup` and `IntegratorGroup`

Description

OpenMDAO v3.31 changes the om.Group _setup_procs method function signature from _setup_procs(pathname, comm, mode, prob_meta) to _setup_procs(pathname, comm, prob_meta) . This breaks the four instances of _setup_procs in openconcept/mission/mission_groups.py. I'm not sure the best way to handle it because fixing it will break OpenConcept's backward compatibility with all versions of OpenMDAO before v3.31. The best solution would be to find a workaround that doesn't need to use the hidden methods.

For now, I'm adding an upper bound of v3.30 on the OpenMDAO version.

Numpy array size error in MissionFlightConditions

Hi!

When trying out the TBM850 example I got a vector size mismatch (see traceback at the end).

Some of the vars have a shape (n, 1), and some (n,).

I fixed with adding the two lines below to MissionFlightConditions to get the same shape for all vectors:

    def compute(self, inputs, outputs):

        n_int_per_seg = self.options['n_int_per_seg']
        nn = n_int_per_seg*2 + 1
        hvec_climb = np.linspace(inputs['mission|takeoff|h'],inputs['mission|cruise|h'],nn)
        hvec_desc = np.linspace(inputs['mission|cruise|h'],inputs['mission|takeoff|h'],nn)
        hvec_cruise = np.ones(nn)*inputs['mission|cruise|h']
        hvec_climb = np.reshape(hvec_climb, hvec_climb.size) 
        hvec_desc = np.reshape(hvec_desc, hvec_desc.size)
        ...

I did not modify anything in the code before trying. Package versions as in the reqs, I am running it on Windows, and I tried with Python 2.7 and 3.7.

Is this a known issue, or something wrong with my installation?

Traceback:

======Analyzing Fuel Burn for Given Mision============
Traceback (most recent call last):
  File "D:/Documents/GitHub/openconcept/examples/TBM850.py", line 318, in <module>
    prob.run_model()
  File "D:\Documents\GitHub\openconcept\venv37\lib\site-packages\openmdao\core\problem.py", line 461, in run_model
    return self.model.run_solve_nonlinear()
  File "D:\Documents\GitHub\openconcept\venv37\lib\site-packages\openmdao\core\system.py", line 2546, in run_solve_nonlinear
    result = self._solve_nonlinear()
  File "D:\Documents\GitHub\openconcept\venv37\lib\site-packages\openmdao\core\group.py", line 1592, in _solve_nonlinear
    result = self._nonlinear_solver.solve()
  File "D:\Documents\GitHub\openconcept\venv37\lib\site-packages\openmdao\solvers\solver.py", line 633, in solve
    fail, abs_err, rel_err = self._run_iterator()
  File "D:\Documents\GitHub\openconcept\venv37\lib\site-packages\openmdao\solvers\solver.py", line 361, in _run_iterator
    norm0, norm = self._iter_initialize()
  File "D:\Documents\GitHub\openconcept\venv37\lib\site-packages\openmdao\solvers\nonlinear\newton.py", line 216, in _iter_initialize
    subsys._solve_nonlinear()
  File "D:\Documents\GitHub\openconcept\venv37\lib\site-packages\openmdao\core\explicitcomponent.py", line 218, in _solve_nonlinear
    failed = self.compute(self._inputs, self._outputs)
  File "D:\Documents\GitHub\openconcept\openconcept\analysis\mission.py", line 143, in compute
    outputs['fltcond|mission|h'] = np.concatenate([hvec_climb,hvec_cruise,hvec_desc])
ValueError: all the input arrays must have same number of dimensions

Move away from Travis CI

Description

Travis is going to be disabled soon. If we want to continue to maintain this project, then we probably want to move to an alternate CI provider. Given that there is no complex dependency, it is probably better to use GitHub actions for this, especially since this is a public repo and should be fairly straightforward to set up.

Fix deprecation warnings from OpenMDAO

Description

On OpenMDAO 3.16 the following deprecation warnings are issued:

examples/tests/test_example_aircraft.py::TBMAnalysisTestCase::test_values_TBM
examples/tests/test_example_aircraft.py::CaravanAnalysisTestCase::test_values_Caravan
examples/tests/test_example_aircraft.py::HybridTwinThermalTestCase::test_values_thermalhybridtwin
examples/tests/test_example_aircraft.py::HybridTwinTestCase::test_values_hybridtwin
examples/tests/test_example_aircraft.py::KingAirTestCase::test_values_kingair
  /home/eytan/.local/lib/python3.8/site-packages/openmdao/core/component.py:511: OMDeprecationWarning: 'analysis.rotate.transition' <class TakeoffTransition>: Passing `src_indices` as an arg to `add_input('fltcond|Utrue', ...` is deprecated and will become an error in a future release.  Add `src_indices` to a `promotes` or `connect` call instead.
    warn_deprecation(f"{self.msginfo}: Passing `src_indices` as an arg to "

examples/tests/test_example_aircraft.py::TBMAnalysisTestCase::test_values_TBM
examples/tests/test_example_aircraft.py::CaravanAnalysisTestCase::test_values_Caravan
examples/tests/test_example_aircraft.py::HybridTwinThermalTestCase::test_values_thermalhybridtwin
examples/tests/test_example_aircraft.py::HybridTwinTestCase::test_values_hybridtwin
examples/tests/test_example_aircraft.py::KingAirTestCase::test_values_kingair
  /home/eytan/.local/lib/python3.8/site-packages/openmdao/core/component.py:511: OMDeprecationWarning: 'analysis.rotate.transition' <class TakeoffTransition>: Passing `src_indices` as an arg to `add_input('gamma', ...` is deprecated and will become an error in a future release.  Add `src_indices` to a `promotes` or `connect` call instead.
    warn_deprecation(f"{self.msginfo}: Passing `src_indices` as an arg to "

examples/tests/test_example_aircraft.py::TBMAnalysisTestCase::test_values_TBM
examples/tests/test_example_aircraft.py::CaravanAnalysisTestCase::test_values_Caravan
examples/tests/test_example_aircraft.py::HybridTwinThermalTestCase::test_values_thermalhybridtwin
examples/tests/test_example_aircraft.py::HybridTwinTestCase::test_values_hybridtwin
examples/tests/test_example_aircraft.py::KingAirTestCase::test_values_kingair
  /home/eytan/.local/lib/python3.8/site-packages/openmdao/core/component.py:511: OMDeprecationWarning: 'analysis.rotate.v2climb' <class TakeoffClimb>: Passing `src_indices` as an arg to `add_input('gamma', ...` is deprecated and will become an error in a future release.  Add `src_indices` to a `promotes` or `connect` call instead.
    warn_deprecation(f"{self.msginfo}: Passing `src_indices` as an arg to "

examples/tests/test_example_aircraft.py::TBMAnalysisTestCase::test_values_TBM
examples/tests/test_example_aircraft.py::CaravanAnalysisTestCase::test_values_Caravan
examples/tests/test_example_aircraft.py::HybridTwinThermalTestCase::test_values_thermalhybridtwin
examples/tests/test_example_aircraft.py::HybridTwinTestCase::test_values_hybridtwin
examples/tests/test_example_aircraft.py::KingAirTestCase::test_values_kingair
  /home/eytan/.local/lib/python3.8/site-packages/openmdao/core/component.py:511: OMDeprecationWarning: 'analysis.rotate.v2climb' <class TakeoffClimb>: Passing `src_indices` as an arg to `add_input('fltcond|Utrue', ...` is deprecated and will become an error in a future release.  Add `src_indices` to a `promotes` or `connect` call instead.
    warn_deprecation(f"{self.msginfo}: Passing `src_indices` as an arg to "

examples/tests/test_example_aircraft.py: 4 warnings
openconcept/components/tests/test_N3.py: 4 warnings
openconcept/components/tests/test_cfm56.py: 2 warnings
  /home/eytan/.local/lib/python3.8/site-packages/openmdao/utils/options_dictionary.py:332: OMDeprecationWarning: 'train:throttle' is not a valid python name and will become an invalid option name in a future release. You can prevent this warning (and future exceptions) by declaring this option using a valid python name.
    warn_deprecation(f"'{name}' is not a valid python name and will become an invalid "

examples/tests/test_example_aircraft.py: 4 warnings
openconcept/components/tests/test_N3.py: 4 warnings
openconcept/components/tests/test_cfm56.py: 2 warnings
  /home/eytan/.local/lib/python3.8/site-packages/openmdao/utils/options_dictionary.py:332: OMDeprecationWarning: 'train:fltcond|h' is not a valid python name and will become an invalid option name in a future release. You can prevent this warning (and future exceptions) by declaring this option using a valid python name.
    warn_deprecation(f"'{name}' is not a valid python name and will become an invalid "

examples/tests/test_example_aircraft.py: 4 warnings
openconcept/components/tests/test_N3.py: 4 warnings
openconcept/components/tests/test_cfm56.py: 2 warnings
  /home/eytan/.local/lib/python3.8/site-packages/openmdao/utils/options_dictionary.py:332: OMDeprecationWarning: 'train_fltcond|h' is not a valid python name and will become an invalid option name in a future release. You can prevent this warning (and future exceptions) by declaring this option using a valid python name.
    warn_deprecation(f"'{name}' is not a valid python name and will become an invalid "

examples/tests/test_example_aircraft.py: 4 warnings
openconcept/components/tests/test_N3.py: 4 warnings
openconcept/components/tests/test_cfm56.py: 2 warnings
  /home/eytan/.local/lib/python3.8/site-packages/openmdao/utils/options_dictionary.py:332: OMDeprecationWarning: 'train:fltcond|M' is not a valid python name and will become an invalid option name in a future release. You can prevent this warning (and future exceptions) by declaring this option using a valid python name.
    warn_deprecation(f"'{name}' is not a valid python name and will become an invalid "

examples/tests/test_example_aircraft.py: 4 warnings
openconcept/components/tests/test_N3.py: 4 warnings
openconcept/components/tests/test_cfm56.py: 2 warnings
  /home/eytan/.local/lib/python3.8/site-packages/openmdao/utils/options_dictionary.py:332: OMDeprecationWarning: 'train_fltcond|M' is not a valid python name and will become an invalid option name in a future release. You can prevent this warning (and future exceptions) by declaring this option using a valid python name.
    warn_deprecation(f"'{name}' is not a valid python name and will become an invalid "

examples/tests/test_example_aircraft.py: 4 warnings
openconcept/components/tests/test_N3.py: 4 warnings
openconcept/components/tests/test_cfm56.py: 2 warnings
  /home/eytan/.local/lib/python3.8/site-packages/openmdao/utils/options_dictionary.py:332: OMDeprecationWarning: 'train:thrust' is not a valid python name and will become an invalid option name in a future release. You can prevent this warning (and future exceptions) by declaring this option using a valid python name.
    warn_deprecation(f"'{name}' is not a valid python name and will become an invalid "

examples/tests/test_example_aircraft.py: 4 warnings
openconcept/components/tests/test_N3.py: 4 warnings
openconcept/components/tests/test_cfm56.py: 2 warnings
  /home/eytan/.local/lib/python3.8/site-packages/openmdao/utils/options_dictionary.py:332: OMDeprecationWarning: 'train:fuel_flow' is not a valid python name and will become an invalid option name in a future release. You can prevent this warning (and future exceptions) by declaring this option using a valid python name.
    warn_deprecation(f"'{name}' is not a valid python name and will become an invalid "

examples/tests/test_example_aircraft.py::B738TestCase::test_values_B738
examples/tests/test_example_aircraft.py::B738VLMTestCase::test_values_B738
examples/tests/test_example_aircraft.py::B738AerostructTestCase::test_values_B738
openconcept/components/tests/test_cfm56.py::CFM56TestCase::test_defaults
openconcept/components/tests/test_cfm56.py::CFM56TestCase::test_vectorized
  /home/eytan/.local/lib/python3.8/site-packages/openmdao/utils/options_dictionary.py:332: OMDeprecationWarning: 'train:T4' is not a valid python name and will become an invalid option name in a future release. You can prevent this warning (and future exceptions) by declaring this option using a valid python name.
    warn_deprecation(f"'{name}' is not a valid python name and will become an invalid "

Steps to reproduce issue

  1. OpenMDAO 3.16.0, Python 3.8.11
  2. Run python -m pytest

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.