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 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.3.tar.gz (69.3 kB view details)

Uploaded Source

Built Distribution

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

pyapm-0.0.3-py3-none-any.whl (81.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyapm-0.0.3.tar.gz
  • Upload date:
  • Size: 69.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pyapm-0.0.3.tar.gz
Algorithm Hash digest
SHA256 f349d045ccd53f9f17974b34375ad211423bd6de1789d30b4131f961feb81ae7
MD5 b0399869b420d6be84e838d012c08811
BLAKE2b-256 0a7b3c4c3d1526c333d1db54cbbf9f23d608c88c1ef3cab9a50c9ef7ae24676f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyapm-0.0.3.tar.gz:

Publisher: publish-to-pypi.yml on Xero64/pyapm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: pyapm-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 81.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pyapm-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1dddfc465e32c11501ec3355f9266b586627a7c8a62ba3749da02688658dd8c6
MD5 df8d648b391e85d93c5626db9eeb8795
BLAKE2b-256 5790e26febf2504f0a8381357af76eff9044b6cda05bac1c9f3c5937a3d50aae

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyapm-0.0.3-py3-none-any.whl:

Publisher: publish-to-pypi.yml on Xero64/pyapm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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