Skip to main content

This is an open-source, unsteady aerodynamics solver for analyzing flapping-wing flight.

Project description

Logo


build coverage source rank python license types code style


Flapping Wings in Ground Effect

This is Ptera Software: a fast, easy-to-use, and open-source package for analyzing flapping-wing flight.

Quick Start

Install the package with pip (requires Python 3.11, 3.12, or 3.13):

pip install pterasoftware

Then run a simulation. The following snippet defines a simple rectangular wing, solves for its aerodynamics using the steady horseshoe vortex lattice method (VLM), and visualizes the results:

import pterasoftware as ps

airplane = ps.geometry.airplane.Airplane(
    wings=[
        ps.geometry.wing.Wing(
            wing_cross_sections=[
                ps.geometry.wing_cross_section.WingCrossSection(
                    airfoil=ps.geometry.airfoil.Airfoil(
                        name="naca2412",
                    ),
                    num_spanwise_panels=8,
                    control_surface_symmetry_type="asymmetric",
                    spanwise_spacing="cosine",
                ),
                ps.geometry.wing_cross_section.WingCrossSection(
                    airfoil=ps.geometry.airfoil.Airfoil(
                        name="naca2412",
                    ),
                    num_spanwise_panels=None,
                    Lp_Wcsp_Lpp=(0, 5, 0),
                    control_surface_symmetry_type="asymmetric",
                ),
            ],
            symmetric=True,
            symmetryNormal_G=(0, 1, 0),
            symmetryPoint_G_Cg=(0, 0, 0),
        ),
    ],
)

operating_point = ps.operating_point.OperatingPoint()

problem = ps.problems.SteadyProblem(
    airplanes=[airplane], operating_point=operating_point
)

solver = (
    ps.steady_horseshoe_vortex_lattice_method.SteadyHorseshoeVortexLatticeMethodSolver(
        steady_problem=problem
    )
)

solver.run()

ps.output.draw(solver=solver, scalar_type="lift", show_streamlines=True)

Features

  1. Various Aerodynamic Simulation Methods
    • Steady simulations can be run with a standard horseshoe vortex-lattice method (VLM) or a ring VLM.
    • Unsteady simulations use a ring unsteady VLM (UVLM) solver.
    • Unsteady simulations support both fixed and free wakes.
    • Unsteady simulations implement vortex aging to reduce numerical instabilities.
    • All three solvers support surface effects (e.g., ground effect) via the method of images.
  2. Customizable Aircraft Geometry
    • Aircraft can be defined as a collection of one or more wings of any dimensions and positions.
    • Wings can be defined as a collection of two or more wing cross sections of any dimensions and positions.
    • Wing cross sections can be specified to match the mean camber line of an airfoil.
    • The package comes with a massive database of airfoils to choose from, courtesy of the UIUC Airfoil Coordinates Database.
    • Wings are automatically discretized into panels with customizable sizes and spacings.
  3. Customizable Aircraft Motion
    • The relative motion of wings and wing cross sections can be defined using any time-dependent functions of sweep, pitch, and heave angles.
  4. Customizable Operating Points
    • Parameters such as the free-stream velocity, density, angle of attack, angle of sideslip, etc. can be changed by the user.
  5. High-Speed Simulations
    • Using Just-In-Time compilation, Ptera Software can solve many unsteady flapping-wing simulations in less than a minute!
    • Steady simulations take only seconds!
  6. Simulations of Formation Flight
    • Since v2.0.0, Ptera Software has supported simulations with more than one airplane.
    • This feature can be used to analyze the aerodynamics of flapping-wing formation flight!
  7. Save and Load Simulation Results
    • Save solved simulations to JSON files and load them back without re-running.
    • Uses JSON serialization instead of pickle, avoiding arbitrary code execution vulnerabilities.
    • Supports gzip compression for reduced file sizes.
    • Loaded objects are fully compatible with all output and visualization functions.
  8. Features for Flapping-Wing Vehicle Design
    • Ptera Software is focused on developing features to facilitate designing flapping-wing vehicles.
    • For example, use the functions in the trim module to automatically search for a trim operating point for steady and unsteady simulations of aircraft.
  9. A Basic GUI
    • This is still in its alpha stage, but we will be adding more functionality soon.

Installation

As a Package

If you haven't already, install Ptera Software from PyPI (see Quick Start above):

pip install pterasoftware

Your IDE should automatically provide docstring hints for the available classes and functions. For more detailed documentation, visit the Ptera Software documentation site.

From Source

If you want to browse the example scripts or dig into the source code, you will need a local copy of the repository. Follow the environment setup instructions in the Contributing Guidelines to clone the repository, create a virtual environment, and install dependencies.

Once set up, the examples/ directory contains scripts that demonstrate the full range of Ptera Software's features and solvers. These scripts are also available on the documentation site.

Example Output

This package currently supports three different solvers, a steady horseshoe VLM, a steady ring VLM, and an unsteady ring VLM (UVLM). Here are examples of the output you can expect to receive from each of them.

Steady Horseshoe VLM

Example Steady Horseshoe VLM Output

Steady Ring VLM

Example Steady Ring VLM Output

Unsteady Ring VLM

Example Unsteady Ring VLM Animation Output

Validation

Since the release of version 1.0.0, Ptera Software is now validated against experimental flapping-wing data! See the validation/ directory to run the test case and read a report on the software's accuracy.

Documentation

For detailed API documentation and guides, visit the Ptera Software documentation site.

How to Contribute

The primary goal of this project is to increase the open-source community's understanding and appreciation for unsteady aerodynamics in general and flapping-wing flight in particular. This will only happen through your participation. Feel free to request features, report bugs or security issues, and provide suggestions.

Before contributing, make sure to read through the Contributing Guidelines for how to best help out.

Contributors

Supporters

  • Peter Sharpe
  • Suhas Kodali
  • Ramesh Agarwal
  • E. Farrell Helbling
  • Raphael Zufferey
  • Joseph Katz
  • Allen Plotkin
  • Austin Stover

Background

Ptera Software grew out of a desire to make flapping-wing aerodynamics accessible without expensive commercial CFD tools or hard-to-use open-source alternatives. Initially built on AeroSandbox with the support of Peter Sharpe and Suhas Kodali, it has developed into an actively-maintained UVLM package that is well documented, tested, and validated. We hope that with your help, we will increase the open-source community's interest and understanding of biological flight.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pterasoftware-5.0.0.tar.gz (4.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pterasoftware-5.0.0-py3-none-any.whl (4.5 MB view details)

Uploaded Python 3

File details

Details for the file pterasoftware-5.0.0.tar.gz.

File metadata

  • Download URL: pterasoftware-5.0.0.tar.gz
  • Upload date:
  • Size: 4.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for pterasoftware-5.0.0.tar.gz
Algorithm Hash digest
SHA256 973cba3e2baa7397c364521c120a95d393d42409cb55161ed15e5ef303f65b1c
MD5 2f902aa247283aadd4100c26d3526e36
BLAKE2b-256 97909fafaead606a27ab5e561d7112fb4bdd561aab061b23aa8843fa1b405c2d

See more details on using hashes here.

File details

Details for the file pterasoftware-5.0.0-py3-none-any.whl.

File metadata

  • Download URL: pterasoftware-5.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for pterasoftware-5.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2331734a73e8e9a5271af98215fbbde8d55c9dbbf4918624f3d35401c7093f6e
MD5 c76b5c4936d66b4f4b3488ec6dbf5dd4
BLAKE2b-256 043fcb1618bfabdc680fefad5ee0ebde934f4d805011db496c5674f082eb35f2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page