OpenAeroStruct

repository·main·Indexed 42 days ago

https://github.com/mdolab/openaerostruct

A lightweight Python tool for aerostructural optimization that couples aerodynamic (VLM) and structural (3D spatial beam) models using the OpenMDAO framework to simulate and optimize lifting surfaces. It supports B-spline geometry control, composite material modeling using the Tsai-Wu failure criterion, and Free-Form Deformation (FFD) via the pyGeo library.

Tokens
13.1K
Snippets
39
Records
74
Agent score
54%

What's inside OpenAeroStruct

  1. Overview of OpenAeroStruct

    main

    OpenAeroStruct is a lightweight tool for aerostructural optimization built on top of the NASA OpenMDAO framework. It performs coupled simulations by combining:

    1. Aerodynamics: A vortex-lattice method (VLM).
    2. Structures: A 3-dimensional spatial beam model with 6 degrees of freedom per node.
    3. Optimization: An optimizer that wraps these aerodynamic and structural analyses.

    The tool is designed for simulating lifting surfaces and includes visualization tools to interpret analysis and optimization results (e.g., eXtended Design Structure Matrix (XDSM) plots).

  2. Configure Parallel Groups for Multipoint Analysis

    main

    To enable parallelization, instead of adding individual flight condition components (e.g., AS_point_0) directly under the prob.model, you must add them under a ParallelGroup object. This allows OpenMDAO to manage the parallel execution of the independent points.

    from mpi4py import MPI
    import om
    
    prob = om.Problem()
    # ... setup indep_var_comp and AerostructGeometry ...
    
    # Instead of prob.model.add_comp(...), use a ParallelGroup
    with prob.model.add_subsystem('parallel', om.ParallelGroup) as parallel:
        parallel.add_comp('AS_point_0', ...)
        parallel.add_comp('AS_point_1', ...)
  3. How geometry design variables work via B-splines

    main

    OpenAeroStruct uses B-spline interpolation to control geometry. Instead of directly manipulating nodal mesh points, design variables (specifically those defined as arrays along the span) control B-spline knots (control points).

    This approach provides two main benefits:

    1. Decoupling: You can choose the number of design variables independently of the aerodynamic mesh fidelity.
    2. Smoothness: The B-spline interpolation ensures smooth geometric transitions across the span.

    The design variables influence a blue interpolated curve which then modifies the underlying aerodynamic mesh.

  4. Use the Wingbox structural model

    main

    OpenAeroStruct supports a wingbox-based structural model in addition to the standard tubular-spar model. This model is designed for more realistic preliminary structural sizing of commuter to long-range transport aircraft.

    To use the wingbox model, set the fem_model_type key to 'wingbox' in your surface dictionary.

    Key Requirements for Wingbox Airfoil Coordinates:

    • Provide coordinates for the portion of the chord that will be structural (e.g., 10% to 60% chord).
    • Ensure the first and last x-coordinates (chordwise) of the upper and lower curves are identical.
    • Ensure the original airfoil chord length is normalized to 1.
    • Note: Currently, the same airfoil coordinates are applied to all segments along the wing.
    # In the surface dictionary:
    surface_dict = {
        'name': 'wing',
        'symmetry': True,
        'S_ref_type': 'area',
        'fem_model_type': 'wingbox',  # Use 'wingbox' instead of 'tube'
        'airfoil_coords': [upper_x, upper_y, lower_x, lower_y],
        # ... other settings
    }
  5. Enforce C0 continuity using the construction-based approach

    main

    The construction-based approach enforces C0 continuity (smoothness at junctions) by assigning B-spline control points located at section edges to the same independent variable controlled by the optimizer.

    This approach is highly efficient as it avoids adding explicit linear constraints to the optimizer. It is applicable to geometric parameters that use B-spline parametrization in OAS, including:

    • Chord distribution
    • Twist distribution
    • Shear distribution (all three directions)
    • Thickness and radius distributions for structural spars

    Note on Mesh Shifting: The multi-section unification component automatically shifts sections to maintain leading edge coincidence during span, sweep, or dihedral changes. However, if you are using the constraint-based approach simultaneously, it is advised to disable mesh shifting by setting shift_uni_mesh = False in the multi-section geometry group to avoid interference.

    # Disable mesh shifting to avoid interference with constraints
    multi_section_geometry_group.shift_uni_mesh = False
  6. Simulate multiple lifting surfaces simultaneously

    main

    OpenAeroStruct allows for the simultaneous simulation of an arbitrary collection of lifting surfaces (e.g., a wing and a tail for a conventional aircraft).

    Important Normalization Rule: The moment coefficient is always normalized with respect to the Mean Aerodynamic Chord (MAC) of the first surface in the list. To ensure correct physical results, always place your primary lifting surface (e.g., the main wing) as the first entry in the surface list.

  7. Enforce C0 continuity using the constraint-based approach

    main

    The constraint-based approach involves explicitly setting position constraints that join the surface points at section junctions within a specified tolerance.

    This method is useful when you require a high degree of customization in how sections are attached to each other. Constraints can be enforced at the leading and/or trailing edge of each segment junction in any combination of x, y, or z directions.

    Trade-offs:

    • Pros: Highly customizable attachment logic.
    • Cons: Increases the number of linear constraints (at least two per segment junction), which can grow quickly for problems with many sections.
  8. Handle multiple lifting surfaces

    main

    OpenAeroStruct supports configurations with multiple lifting surfaces (e.g., a main wing and a tail).

    Key behaviors:

    • Most components operate on a single lifting surface in isolation.
    • AssembleAIC: This component is global; it considers all lifting surfaces when constructing the Aerodynamic Influence Coefficient (AIC) matrix.
    • VLMForces: This component also requires information from all lifting surfaces to function correctly.
  9. Default Solvers in OpenAeroStruct

    main

    OpenAeroStruct uses specific default solvers for different parts of the aerostructural analysis:

    • Nonlinear Coupling: The default nonlinear solver is NonlinearBlockGS.
    • Aerodynamic/Structural Analysis: Uses Scipy's LU factorization (scipy.sparse.linalg.splu for structural FEM and scipy.linalg.lu_factor/lu_solve for VLM).
    • Derivative Computation: The default is DirectSolver, which utilizes LU factorization and back substitution.

    Default settings are defined in openaerostruct/integration/aerostruct_groups.py.

  10. How OpenAeroStruct uses OpenMDAO

    main

    OpenAeroStruct is built on the OpenMDAO framework. To use OpenAeroStruct effectively, you should understand the following OpenMDAO core abstractions:

    • Component: The smallest unit of computational work.
    • Group: A container used to build up model hierarchies (e.g., Geometry or AeroPoint groups).
    • Driver: Controls the iterative model execution process, such as an Optimizer or DOE.
    • Problem: The top-level class that contains the entire model and provides the execution API (e.g., prob.run_model() or prob.run_driver()).