Skip to main content

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

Project description

pyAVL is not obsolete, use OptVL

I will no longer be working on pyAVL and will be removing it soon. OptVL is a more advanced version and where developement will continue.


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

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

pyavl_wrapper-1.8.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

pyavl_wrapper-1.8.1-cp311-cp311-macosx_12_0_arm64.whl (8.6 MB view details)

Uploaded CPython 3.11macOS 12.0+ ARM64

pyavl_wrapper-1.8.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

pyavl_wrapper-1.8.1-cp310-cp310-macosx_12_0_arm64.whl (8.6 MB view details)

Uploaded CPython 3.10macOS 12.0+ ARM64

pyavl_wrapper-1.8.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.1 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

pyavl_wrapper-1.8.1-cp39-cp39-macosx_12_0_arm64.whl (8.6 MB view details)

Uploaded CPython 3.9macOS 12.0+ ARM64

File details

Details for the file pyavl_wrapper-1.8.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyavl_wrapper-1.8.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9fde579ae507612872967b7605e9ee1c54f6926ad314a7764c666c7e4cddbc49
MD5 ea6e4d5f183db3de2cf61849a659043f
BLAKE2b-256 78775ee748bddb204b8c737de97561603588a75f6efdbe6f0a63058fb66ae11d

See more details on using hashes here.

File details

Details for the file pyavl_wrapper-1.8.1-cp311-cp311-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for pyavl_wrapper-1.8.1-cp311-cp311-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 9e543e3b1da7b5bd7e751f7d8ac95dd887a1886dbec816409cbbb8639eef9971
MD5 96123d474744e49bc7b1fe14c65f4bcb
BLAKE2b-256 c4095b651e1ae07287d074abb443075bc8571e31b7569d7d9c04b6de8710a8fb

See more details on using hashes here.

File details

Details for the file pyavl_wrapper-1.8.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyavl_wrapper-1.8.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d1b41c87ebebb882ee9f051a22a26abba23300c5dcfad5e817bcf45f412def72
MD5 b5398204378397298e4c7377c05deeb3
BLAKE2b-256 783d6ce51d9d3466b2659407dc85d899f95eb0a482962118571a62eff8e4ce4c

See more details on using hashes here.

File details

Details for the file pyavl_wrapper-1.8.1-cp310-cp310-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for pyavl_wrapper-1.8.1-cp310-cp310-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 16c16a099fc75ff0d07b7c96285aa78ee428a3934fcc8c89371d9bc771fabf35
MD5 6eb5e32490e28748ea4caef3b0c4db4e
BLAKE2b-256 11a33f5cc800b4169b02518ab59ca7ec789b86a4b583318cecac7ea1c7912d4f

See more details on using hashes here.

File details

Details for the file pyavl_wrapper-1.8.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyavl_wrapper-1.8.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5f7db0142fdcc9cb00f6357f21c84947df8b6ab63d96b597b7bd2048106d6928
MD5 094225727724140b24becdceaa1dcc99
BLAKE2b-256 9b9ad1e6ac01f557c8adfb79b6a8b970561cc8498d89e579b49ce521a842800c

See more details on using hashes here.

File details

Details for the file pyavl_wrapper-1.8.1-cp39-cp39-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for pyavl_wrapper-1.8.1-cp39-cp39-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 946b8c24c2604005bdf6fe3035f9665e4e4b1f8fa593400802543f921a00eb62
MD5 06f6ed1819ba550cc4f4c0fe648203a2
BLAKE2b-256 5bc3377ac9d0d2e03cc20f763f3fbc3e36010bf2cb00219aac4edac6a33971d5

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