mdolab / openaerostruct Goto Github PK
View Code? Open in Web Editor NEWOpenAeroStruct is a lightweight tool that performs aerostructural optimization using OpenMDAO.
License: Apache License 2.0
OpenAeroStruct is a lightweight tool that performs aerostructural optimization using OpenMDAO.
License: Apache License 2.0
Cloning from master branch, and adding the following conditions (before the call to OAS_prob.run()
:
OAS_prob.prob['wing.thickness_cp'] = np.array([ 4.5279479027781128e-01,1.9036800154838401e-01,9.8321106961832772e-02])
OAS_prob.prob['alpha'] = -4.0948666786020738e-01
OAS_prob.prob['wing.twist_cp'] = np.array([ -3.2162315517514468e+00,7.1314196111774741e+00,-3.2470369225802571e+00])
Crashes with
Traceback (most recent call last):
File "run_aerostruct.py", line 132, in <module>
OAS_prob.run()
File "/Users/brendan/Documents/SFI/codeother/openaeroversions/aerotest/OpenAeroStruct/run_classes.py", line 587, in run
self.prob.run_once()
File "/usr/local/lib/python3.6/site-packages/openmdao/core/problem.py", line 1170, in run_once
driver.run_once(self)
File "/usr/local/lib/python3.6/site-packages/openmdao/core/driver.py", line 786, in run_once
system.solve_nonlinear(metadata=metadata)
File "/usr/local/lib/python3.6/site-packages/openmdao/core/group.py", line 739, in solve_nonlinear
self.nl_solver.solve(params, unknowns, resids, self, metadata)
File "/usr/local/lib/python3.6/site-packages/openmdao/solvers/solver_base.py", line 23, in wrapper
fn(driver, params, unknowns, resids, system, metadata)
File "/usr/local/lib/python3.6/site-packages/openmdao/solvers/run_once.py", line 51, in solve
system.children_solve_nonlinear(local_meta)
File "/usr/local/lib/python3.6/site-packages/openmdao/core/group.py", line 759, in children_solve_nonlinear
sub.solve_nonlinear(sub.params, sub.unknowns, sub.resids, metadata)
File "/usr/local/lib/python3.6/site-packages/openmdao/core/group.py", line 739, in solve_nonlinear
self.nl_solver.solve(params, unknowns, resids, self, metadata)
File "/usr/local/lib/python3.6/site-packages/openmdao/solvers/solver_base.py", line 23, in wrapper
fn(driver, params, unknowns, resids, system, metadata)
File "/usr/local/lib/python3.6/site-packages/openmdao/solvers/nl_gauss_seidel.py", line 132, in solve
system.children_solve_nonlinear(local_meta)
File "/usr/local/lib/python3.6/site-packages/openmdao/core/group.py", line 759, in children_solve_nonlinear
sub.solve_nonlinear(sub.params, sub.unknowns, sub.resids, metadata)
File "/usr/local/lib/python3.6/site-packages/openmdao/core/group.py", line 739, in solve_nonlinear
self.nl_solver.solve(params, unknowns, resids, self, metadata)
File "/usr/local/lib/python3.6/site-packages/openmdao/solvers/solver_base.py", line 23, in wrapper
fn(driver, params, unknowns, resids, system, metadata)
File "/usr/local/lib/python3.6/site-packages/openmdao/solvers/run_once.py", line 51, in solve
system.children_solve_nonlinear(local_meta)
File "/usr/local/lib/python3.6/site-packages/openmdao/core/group.py", line 757, in children_solve_nonlinear
sub._sys_solve_nonlinear(sub.params, sub.unknowns, sub.resids)
File "/usr/local/lib/python3.6/site-packages/openmdao/core/component.py", line 609, in _sys_solve_nonlinear
self.solve_nonlinear(params, unknowns, resids)
File "/Users/brendan/Documents/SFI/codeother/openaeroversions/aerotest/OpenAeroStruct/vlm.py", line 973, in solve_nonlinear
self.lup = lu_factor(params['AIC'])
File "/usr/local/lib/python3.6/site-packages/scipy/linalg/decomp_lu.py", line 58, in lu_factor
a1 = asarray_chkfinite(a)
File "/usr/local/lib/python3.6/site-packages/numpy/lib/function_base.py", line 1215, in asarray_chkfinite
"array must not contain infs or NaNs")
ValueError: array must not contain infs or NaNs
Cloning from master branch, and adding the following conditions (before the call to OAS_prob.run()
:
OAS_prob.prob['alpha'] = -5.4772415561327445
OAS_prob.prob['wing.thickness_cp'] = np.array([ 0.14340327207903325, 0.3639890838470242, 0.2653579033716302])
OAS_prob.prob['wing.twist_cp'] = np.array([ -8.541536161392285, 5.030094299899314, -4.063335448175808])
This returns a solution with
Fuelburn: -74795.1319562
wing_perf.failure -0.315245694701
wing_perf.thickness_intersects [-0.08346824 -0.28824473]
That is, the thickness doesn't intersect, the wing doesn't fail, but the fuelburn is negative.
We currently have analytic derivs for this comp, but they are dense and use multiple Python for loops.
Instead, we want to use a sparse formulation and use vectorized math to get the derivatives.
Translate this part to Python:
https://github.com/mdolab/OpenAeroStruct/blob/master/openaerostruct/structures/vonmises_tube.py#L104
Can probably use Dr. Hwang's version from here as a base: https://github.com/hwangjt/OpenAeroStruct/blob/v2/openaerostruct_v2/structures/components/fea_vonmises_comp.py
Korn equation, etc, from https://github.com/shamsheersc19/OpenAeroStruct/tree/mpt_wingbox
We've introduced a large number of VLM components and they're flat in the aerodynamics
folder.
They can be better named and organized.
Numpy's assert_almost_equal doesn't fail with NANs while OM's does so switch to those throughout
Currently it's a dense Jacobian formulation for the partial derivatives.
Switch to using a sparse formulation; should be a quick chane.
For the workshop:
Currently throws
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1540, in __call__
return self.func(*args)
File "/home/neil/hg/OpenAeroStruct/openaerostruct/utils/plot_wing.py", line 654, in auto_ref
self.check_length()
File "/home/neil/hg/OpenAeroStruct/openaerostruct/utils/plot_wing.py", line 631, in check_length
self.num_iters = int(db.keys()[-1].split('|')[-1])
IndexError: list index out of range
Move this to Python: https://github.com/mdolab/OpenAeroStruct/blob/master/openaerostruct/transfer/displacement_transfer.py#L116
Might be able to use Dr. Hwang's version as a base: https://github.com/hwangjt/OpenAeroStruct/blob/v2/openaerostruct_v2/aerostruct/disp_transfer_group.py
Currently this component only has analytic derivatives for the non-symmetric wing; need to add analytic derivatives for symmetric wing case
In analyzing wing-tail configurations it may be useful to set the tail twist to a scalar, such that it's only used for trimming. This throws an error in plot_wing:
File "/home/neil/hg/OpenAeroStruct/openaerostruct/utils/plot_wing.py", line 314, in load_db
new_twist.append(np.hstack((twist[0], twist[0][::-1][1:])))
IndexError: invalid index to scalar variable.
Better vectorize the matrix assembly and also get derivatives on python level
Not all of the new VLM components have derivative unit tests yet.
Copy the form from other tests for these components
Get analytic derivs for this: https://github.com/mdolab/OpenAeroStruct/blob/master/openaerostruct/functionals/moment_coefficient.py#L141
Given that the new implementation (vectorized, fully Python) implementation works well and matches all previous tests, we now need to remove all of the old code
Running the aerostructural test case gives
NL: NLBGS Failed to Converge in 50 iterations
even when the number of iterations is bumped to 100. Might need a little bit of digging.
Additionally, the test finishes with a relative error of E-3 rather than the required E-8. Not sure what's different between local and travis tests.
This would be for engines, batteries, etc.
Will need to consider how to add these to the structural model correctly (which nodes, etc)
Most of the code ported over doesn't have documentation; go through and add explanations for each component
Not sure how important this is, but I received a ComplexWarning:
/home/neil/hg/OpenAeroStruct/openaerostruct/geometry/utils.py:74: ComplexWarning: Casting complex values to real discards the imaginary part
row[:] = np.einsum("ikj, ij -> ik", mats, row - quarter_chord)
Currently does not work but also does not raise any errors.
The docs were kind of stitched together from a variety of ideas at different times.
Go through these docs holistically and update / rearrange as necessary.
One of the thickness values doesn't change during the optimization
Want to remove this part and make it Python-only:
https://github.com/mdolab/OpenAeroStruct/blob/master/openaerostruct/aerodynamics/geometry.py#L155
Can use this as a base:
https://github.com/hwangjt/OpenAeroStruct/blob/v2/openaerostruct_v2/aerodynamics/components/mesh/vlm_normals_comp.py
Currently using CS
Copy physics from Sham's wingbox branch: https://github.com/shamsheersc19/OpenAeroStruct/tree/mpt_wingbox for the Korn equation
Certain codes raise Error which does not seem to be a defined python Error, which raises NameError when raised. Found in geometry/utils.py but potentially in other locations too.
Currently the derivatives for these components are computed using cs.
We may need to split up these components to make computing the analytic derivatives easier.
Evaluate the complexity and feasibility of reorganizing these components.
We can vectorize the assembly of the matrix and also use dot and cross products from OM library
Certain tasks, such as writing the mesh to .xyz format for Tecplot, have helper scripts floating around. It would be good to collect/consolidate them, add documentation, and ship them with OAS.
Write this part in Python: https://github.com/mdolab/OpenAeroStruct/blob/master/openaerostruct/transfer/load_transfer.py#L108
Might be able to use this as a base:
https://github.com/hwangjt/OpenAeroStruct/blob/v2/openaerostruct_v2/aerostruct/load_transfer_group.py
Produce and visualize sectional cl curves in both the streamwise and chordwise directions
This component will probably need to be broken up into multiple smaller components
https://github.com/mdolab/OpenAeroStruct/blob/master/openaerostruct/geometry/geometry_mesh.py#L158
Getting plot_wing to work when run_model() is called instead of run_driver(), for example to view a user-specified mesh.
OAS does have many tests, but there are some key files and lines not being tested fully.
Look at the reports at https://coveralls.io/github/mdolab/OpenAeroStruct and find files that don't have good coverage (they have a low % covered).
Add tests mimicking existing tests to cover these files.
Currently, the amount of fuel burn for the 2.5g structural case is too high because it's supposing that we're flying the entire mission at that loading.
In reality, we should use the 1g fuel burn case for the mass added in all cases.
Use balance comps as needed to make a trimmed drag polar
Ensure that all tests pass and compare the timings to see the hit that we take for using Python only
Some objects that need to be recorded are not pickleable and throws
RuntimeWarning: Trying to record options which cannot be pickled on system with name: twist_bsp. Use the 'options_excludes' recording option on system objects to avoid attempting to record options which cannot be pickled. Skipping recording options for this system.
We are unnecessarily allocating some Jacobian information when we declare all partials this way.
Do a find all in the project and change all instances of these to use the correct declare, such as declare_partials('A', 'thickness')
, etc.
If the component requires further work or sparsification to make it good, create a new issue for that.
The Jacobian stays fixed for this component, but the derivatives are currently computed in compute_partials, which is unnecessary.
Set up the Jacobian once in setup() and set the derivatives there.
Follow previous-created resources to obtain the induced drag using Trefftz plane analysis. Example of resource: http://docs.desktop.aero/appliedaero/potential3d/InducedDrag.html
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.