p-chambers / occ_airconics

Aircraft Configuration through Integrated Cross-disciplinary Scripting, Python package built on PythonOCC
http://occ-airconics.readthedocs.io/en/latest/index.html
BSD 3-Clause "New" or "Revised" License
14 stars 9 forks source link

Features request #18

Open TsingQAQ opened 7 years ago

TsingQAQ commented 7 years ago

Hi chamber,

=====New Feature needed:==========

I think there are some features which may make this code better a lot if done:

  1. Add a control segment part(I think it may be better to split a wing(lifting_surface) to several wing segments to provide more freedom for none conventional wing buiding or control segment building, especially for some wing with kinks)
  2. Output the surface mesh: found that some work to generate surface mesh using pythonocc on the web, I think if this could be doen the geometry can be a common geometry model for high fidelity analysis like CFD.
  3. FFD for optimization.

    ===== Bug: =====

    There are also some thing I think could get better:

  4. Display/Modeling Accuracy: The airfoil generated display accuracy is rather disturbing that the curve looks like some straight lines and there are some sharp coners on the curve, the surface are also encountered with the same problem, As the goal of this code is believed to build a model for high fidelity analysis, the quality of the curve and surface must be good enough to do this work.
    1. the scaleFactor din't scale the section airfoil: In the example of wing construction, the airfoil chord length are not scaled like the wing. qq 20170121105243 qq 20170121105800 qq 20170121175320

      ==================

      Ps. I wouner if your work have any relationship with Multidisciplinary Design Optimization Lab, I found that they've build a similar code called pyACDT(not opensource though) to build Aircraft, and using a CAD free approach to perform high fidelity optimization.

      =================

      Thanks angain chamber for aircraft optimization there are not many good opensource codes like your work, since MDO needs many tools, codes to construct the whole platform to analysis, your work will be appreaciated for many beginners like me in this area. Great work.

Will

p-chambers commented 7 years ago

Hi Will,

You raise a number of issues here, some of which may need to be a separate issue. I'll try address most of them here:

Feature requests

  1. Add a control segment part(I think it may be better to split a wing(lifting_surface) to several wing segments to provide more freedom for none conventional wing buiding or control segment building, especially for some wing with kinks) ...this is the main issue that I will leave this feature request open for.

The multi-segment approach is, indeed, the conventional approach to wing design. The approach taken by AirCONICS [1] aims to improve the flexibility of wing design using leading edge attached functionals, for which you can pass a spanwise coordinate to obtain the shape at any location. I recommend looking at the box wing example to see how this works for non-conventional surface design. Control segments are more difficult due to the continuous lofting, and we are currently addressing how to achieve that.

  1. Output the surface mesh

I'm hesitant to work on this as pythonocc have yet to release a conda build that works with SMESH: see tpaviot/pythonocc-core#307. It looks like it's possible to build the two together, but I don't see it as a valuable contribution to the current project until adding SMESH as a dependency no longer increases the difficulty of installation.

  1. FFD for optimization.

PyGem may be a good place to start on that. Please raise a separate feature request for this.

Bugs

  1. Display/Modeling Accuracy: The airfoil generated display accuracy is rather disturbing that the curve looks like some straight lines and there are some sharp coners on the curve, the surface are also encountered with the same problem

I believe that this is, unfortunately, an issue with the renderer/Tesselator from opencascade. If you have access to another CAD renderer that can load STEP or IGES files, I would recommend you export one of the example geometries (with the export_STEPFile method) and see what it looks like - the rendering on the documentation pages is the transonic airliner example as rendered by Rhino, so I'm convinced there is not an issue with the mathematical quality of the NURBS shape. Regardless, I will raise this on the pythonocc repo and see if they have any suggestions for better settings for the rendering.

Edit: this issue can be solved by setting the display.Context.DefaultDrawer() deviation settings. I will probably change the default settings for the problematic examples in the next release, but for now, this can be fixed (although might take longer to render) with:

# increase the quality, as this shape has high curvature
drawer = display.Context.DefaultDrawer().GetObject()
drawer.SetDeviationAngle(drawer.DeviationAngle() / 100.)
drawer.SetDeviationCoefficient(drawer.DeviationCoefficient() / 100.)
  1. the scaleFactor din't scale the section airfoil: In the example of wing construction, the airfoil chord length are not scaled like the wing.

It was my thinking that the users would not need a scaled and translated/transformed airfoil section since these are recreated when the parameters are changed, and the transformation takes time. If this is a feature is worth the added compute time, please raise a separate feature request and describe the use case.

Ps. I wouner if your work have any relationship with Multidisciplinary Design Optimization Lab, I found that they've build a similar code called pyACDT

pyACDT is in a similar category, and seems to be a pretty extensive library. Key selling points of using occ_airconics would be the highly flexible lifting surface shape parameterisation [1], open source philosophy, and basis on a well supported and fast CAD kernel. I'd like to also point out the additional interactive usage available through the pythonocc jupyter notebook renderer, which groups the code and rendering together in a pretty cool way (see examples).

I should add that occ_airconics is in its infancy, and as such, the functionality most certainly needs some expansion. Hopefully, with time, the project will gain input from the open source community and become a more useful tool for aircraft MDO.

Thanks,

Paul

References

[1] Sóbester, A. (2014), Four Suggestions for Better Parametric Geometries, AIAA SciTech.