Run XFoil from within Python and work with output results.
Project description
pyxfoil
Run XFoil from within Python and work with output results.
See example below:
# Import Dependencies
from pyxfoil import Xfoil, set_workdir#, set_xfoilexe
set_workdir('C:/Xfoil_WIP') # Sets the working directory for pyxfoil.
# set_xfoilexe('C:/Xfoil-6.99/xfoil.exe') # Sets the path of the xfoil executable.
# Creates Xfoil object from reading dat file.
xfoil = Xfoil('NACA 0012')
xfoil.points_from_dat('../files/NACA_0012_180.dat')
xfoil.set_ppar(180)
# Runs xfoil for the following parameters
al = [-2.0, 0.0, 4.0, 6.0]
mach = 0.1
Re = 100000.0
for ali in al:
rescase = xfoil.run_result(ali, mach=mach, Re=Re)
# Plots xfoil airfoil profile
ax1 = xfoil.plot_profile(ls='-')
# Shows plots for cases in xfoil cases
ax2 = None
for resname in xfoil.results:
ax2 = xfoil.results[resname].plot_result(yaxis='cp', ax=ax2, ls='-x')
_ = ax2.legend()
# Shows plots for cases in xfoil cases
ax3 = None
for resname in xfoil.results:
ax3 = xfoil.results[resname].plot_result(yaxis='ds', ax=ax3, ls='-o')
_ = ax3.legend()
# Run the xfoil in polar mode from alpha min to alpha max with interval
Re = 100000.0
almin = -10.0
almax = 10.0
alint = 0.5
polar1 = xfoil.run_polar(almin, almax, alint, mach=mach, Re=Re)
# Run the xfoil in polar mode from alpha min to alpha max with interval
Re = 200000.0
almin = -10.0
almax = 10.0
alint = 0.5
polar2 = xfoil.run_polar(almin, almax, alint, mach=mach, Re=Re)
# Plot two polars created above
axp1 = None
axp1 = polar1.plot_polar(ax=axp1)
axp1 = polar2.plot_polar(ax=axp1)
_ = axp1.legend()
# Plot two lift to drag ratios created above
axp2 = None
axp2 = polar1.plot_polar(ax=axp2, xaxis='alpha', yaxis='clocd', ls='-o')
axp2 = polar2.plot_polar(ax=axp2, xaxis='alpha', yaxis='clocd', ls='-x')
_ = axp2.legend()
# Plot two lift curves created above
axp3 = None
axp3 = polar1.plot_polar(ax=axp3, xaxis='alpha', yaxis='cl', ls='-o')
axp3 = polar2.plot_polar(ax=axp3, xaxis='alpha', yaxis='cl', ls='-x')
_ = axp3.legend()
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyxfoil-0.0.6.tar.gz.
File metadata
- Download URL: pyxfoil-0.0.6.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c72eed124b1c3322327d2fa6b5b7cd378fa198e0ba26a24eb06ecfbedf1b951b
|
|
| MD5 |
c38bb9ae04ca6d52dbf8ae807ebc46bc
|
|
| BLAKE2b-256 |
35e501f8fafa39d3facbfad28bf92a8df9ece64984bec48ae9844404b2163310
|
Provenance
The following attestation bundles were made for pyxfoil-0.0.6.tar.gz:
Publisher:
publish-to-pypi.yml on Xero64/pyxfoil
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyxfoil-0.0.6.tar.gz -
Subject digest:
c72eed124b1c3322327d2fa6b5b7cd378fa198e0ba26a24eb06ecfbedf1b951b - Sigstore transparency entry: 312815292
- Sigstore integration time:
-
Permalink:
Xero64/pyxfoil@9584e0649f5aa05665d3609b139317b3f5513209 -
Branch / Tag:
refs/tags/v0.0.6 - Owner: https://github.com/Xero64
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@9584e0649f5aa05665d3609b139317b3f5513209 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyxfoil-0.0.6-py3-none-any.whl.
File metadata
- Download URL: pyxfoil-0.0.6-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6445ba645b4fe372fa6bcc1d7d11fc2885724fc3b736387ed749e47351a7742d
|
|
| MD5 |
bc9974652644deac193346a5a4e87ce5
|
|
| BLAKE2b-256 |
0d7917b7f47a449847f670d4a40adfbf5540f31573037f2e9a3149b60ae4cfd3
|
Provenance
The following attestation bundles were made for pyxfoil-0.0.6-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on Xero64/pyxfoil
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyxfoil-0.0.6-py3-none-any.whl -
Subject digest:
6445ba645b4fe372fa6bcc1d7d11fc2885724fc3b736387ed749e47351a7742d - Sigstore transparency entry: 312815298
- Sigstore integration time:
-
Permalink:
Xero64/pyxfoil@9584e0649f5aa05665d3609b139317b3f5513209 -
Branch / Tag:
refs/tags/v0.0.6 - Owner: https://github.com/Xero64
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@9584e0649f5aa05665d3609b139317b3f5513209 -
Trigger Event:
push
-
Statement type: