Skip to main content

A direct Python interface for Mark Drela and Harold Youngren's famous AVL code.

Project description

pyAVL

Downloads

Documentation

pyAVL is a stripped down version of Mark Drela and Harold Youngren's famous AVL code wrapped in python with f2py. This allows one to more easily conduct large parameter sweeps in AVL or to include AVL into a larger model. Additionally, this wrapper provides access to more data than is available through traditional file output. Unlike in the output files which is limit to about 4 digits, the user has access to the full double precision data.

Installation

The best way to get pyAVL is to install it through pip

pip install pyavl-wrapper

This version even comes packaged with OpenBLAS for faster analysis.

Currently, only Linux and macOS are supported. The process of building on Windows still has issues. For now Windows users will have to use pyAVL through Windows subsystem for Linux (WSL).

building locally

If you want to make pyAVL locally then you have to clone the repository and use the following process.

In the root directory run

pip install . 

Basic usage

The API of pyAVL was made to mirror the usage of AVL through its text interface. The user loads in a geometry file, adds constraints, and then executes analysis runs.

The AVL wrapper is implemented in the AVLSolver class. To use this wrapper, first one must initialize the AVLSolver object with a geometry file and optionally a mass file. After, the user can add constraints and then execute the run to generate data. Below is a basic example of this workflow.

from pyavl import AVLSolver
import numpy as np

avl_solver = AVLSolver(geo_file="aircraft.avl")
avl_solver.add_constraint("alpha", 0.00)

# control surface names from geometry file
avl_solver.add_constraint("Elevator", 0.00, con_var="Cm pitch moment")
avl_solver.add_constraint("Rudder", 0.00, con_var="Cn yaw moment")

avl_solver.set_case_parameter("Mach", 0.3)

# This is the method that acutally runs the analysis
avl_solver.execute_run()

print("----------------- alpha sweep ----------------")
print("   Angle        Cl           Cd          Cdi          Cdv          Cm")
for alpha in range(10):
    avl_solver.add_constraint("alpha", alpha)
    avl_solver.execute_run()
    run_data = avl_solver.get_case_total_data()
    print(
        f' {alpha:10.6f}   {run_data["CL"]:10.6f}   {run_data["CD"]:10.6f}   {run_data["CDi"]:10.6f}   {run_data["CDv"]:10.6f}   {run_data["CM"]:10.6f}'
    )

print("----------------- CL sweep ----------------")
print("   Angle        Cl           Cd          Cdff          Cdv          Cm")
for cl in np.arange(0.6,1.6,0.1):
    avl_solver.add_trim_condition("CL", cl)
    avl_solver.execute_run()
    run_data = avl_solver.get_case_total_data()
    alpha = avl_solver.get_case_parameter("alpha")
    print(
        f' {alpha:10.6f}   {run_data["CL"]:10.6f}   {run_data["CD"]:10.6f}   {run_data["CDi"]:10.6f}   {run_data["CDv"]:10.6f}   {run_data["CM"]:10.6f}'
    )

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

pyavl_wrapper-1.6.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.2 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

pyavl_wrapper-1.6.4-cp311-cp311-macosx_12_0_arm64.whl (8.8 MB view hashes)

Uploaded CPython 3.11 macOS 12.0+ ARM64

pyavl_wrapper-1.6.4-cp311-cp311-macosx_10_9_x86_64.whl (14.1 MB view hashes)

Uploaded CPython 3.11 macOS 10.9+ x86-64

pyavl_wrapper-1.6.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.2 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pyavl_wrapper-1.6.4-cp310-cp310-macosx_12_0_arm64.whl (8.8 MB view hashes)

Uploaded CPython 3.10 macOS 12.0+ ARM64

pyavl_wrapper-1.6.4-cp310-cp310-macosx_10_9_x86_64.whl (14.1 MB view hashes)

Uploaded CPython 3.10 macOS 10.9+ x86-64

pyavl_wrapper-1.6.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.2 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pyavl_wrapper-1.6.4-cp39-cp39-macosx_12_0_arm64.whl (8.7 MB view hashes)

Uploaded CPython 3.9 macOS 12.0+ ARM64

pyavl_wrapper-1.6.4-cp39-cp39-macosx_10_9_x86_64.whl (14.1 MB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

Supported by

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