Skip to main content

Aerodynamic Panel Method in Python

Project description

pyapm

An Aerodynamic Panel Method implemented in Python for use from Python scripts. Examples in the "./scripts" folder.

JSON Definition File:

{
    "name": "Prandtl-D2",
    "mach": 0.0,
    "sref": 0.94064328,
    "cref": 0.2686,
    "bref": 3.749,
    "xref": 0.3270,
    "yref": 0.0,
    "zref": 0.0,
    "surfaces": [
        {
            "name": "Wing",
            "twist": 0.0,
            "mirror": true,
            "cnum": 16,
            "sections": [
                {
                    "xpos": 0.0,
                    "ypos": 0.0,
                    "zpos": 0.0,
                    "chord": 0.40005,
                    "bnum": 50,
                    "bspc": "full-cosine",
                    "airfoil": "prandtl_root.dat",
                    "xoc": 0.0,
                    "zoc": 0.0
                },
                {
                    "xpos": 0.83459,
                    "ypos": 1.87452,
                    "zpos": 0.08177,
                    "chord": 0.10008,
                    "airfoil": "prandtl_tip.dat",
                    "xoc": 0.0,
                    "zoc": 0.0
                }
            ],
            "functions": [
                {
                    "variable": "twist",
                    "spacing": "equal",
                    "interp": "cubic",
                    "values": [
                        8.3274,
                        8.5524,
                        8.7259,
                        8.8441,
                        8.9030,
                        8.8984,
                        8.8257,
                        8.6801,
                        8.4565,
                        8.1492,
                        7.7522,
                        7.2592,
                        6.6634,
                        5.9579,
                        5.1362,
                        4.1927,
                        3.1253,
                        1.9394,
                        0.6589,
                        -0.6417,
                        -1.6726
                    ]
                }
            ]
        }
    ],
    "cases": [
        {
            "name": "Design Point",
            "alpha": 0.0,
            "speed": 13.0,
            "density": 1.145
        }
    ]
}

Typical Python Script File "test_prandtl-d2.py":

#%% Import Dependencies
from IPython.display import display_markdown
from pyapm.classes import PanelResult, panelsystem_from_json
from pyapm.output.msh import panelresult_to_msh

#%% Create Panel Mesh
jsonfilepath = r'../files/Prandtl-D2.json'
psys = panelsystem_from_json(jsonfilepath)
psys.assemble_panels()
psys.assemble_horseshoes()
psys.solve_system()

#%% Solve Panel Result
alpha = 0.0
speed = 13.0
rho = 1.145

pres = PanelResult('Design Point', psys)
pres.set_density(rho=rho)
pres.set_state(alpha=alpha, speed=speed)

display_markdown(pres)
display_markdown(pres.surface_loads)

mshfilepath = '../results/' + psys.name + '.msh'
panelresult_to_msh(pres, mshfilepath)

Mesh File Output:

You can generate a Gmsh mesh file (*.msh) directly from a Python script using the following code snippet.

mshfilepath = '../results/' + psys.name + '.msh'
panelresult_to_msh(pres, mshfilepath)

This will output a mesh file to the specified location, which can then be viewed in Gmsh. The latest version of Gmsh can be downloaded at:

http://gmsh.info/

Use File > Open in Gmsh to open the mesh file with the pressure results.

A sample of the aircraft shown in Gmsh is captured below. Consult Gmsh help to operate Gmsh.

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

pyapm-0.0.2.tar.gz (37.6 kB view details)

Uploaded Source

Built Distribution

pyapm-0.0.2-py3-none-any.whl (47.1 kB view details)

Uploaded Python 3

File details

Details for the file pyapm-0.0.2.tar.gz.

File metadata

  • Download URL: pyapm-0.0.2.tar.gz
  • Upload date:
  • Size: 37.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

File hashes

Hashes for pyapm-0.0.2.tar.gz
Algorithm Hash digest
SHA256 adf8f8f59b37821e3aa5d31737fe2b2f986e4eafe963eddf83bef1d1e60611f8
MD5 6ee0e7f97429d6c01b486d35791403fc
BLAKE2b-256 c0119acf55c706a8536fa89f4ddd5d08ece04e98c4828ae481c937da3f1c57a6

See more details on using hashes here.

File details

Details for the file pyapm-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: pyapm-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 47.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

File hashes

Hashes for pyapm-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 affbdf55fa8ab0665aa4b4e9ad2452392f429179eef5281cf53b0b11d2cb5f31
MD5 e6e46da1ac41c91dd0283637ce9c10cc
BLAKE2b-256 75588b84e6fb615202d6d3a5385da71418f307c3ae688c0ffeea269189c3da29

See more details on using hashes here.

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