Skip to content
Snippets Groups Projects
Verified Commit 867c939c authored by Thomas Lambert's avatar Thomas Lambert :helicopter:
Browse files

refact(polargen): tweak polar generator script

parent 73690b78
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/python3
"""Generate airfoil polars automatically using XFOIL """Generate airfoil polars automatically using XFOIL
Rotare requires the input of airfoil polars to interpolate properly the lift Rotare requires the input of airfoil polars to interpolate properly the lift
...@@ -27,25 +28,30 @@ import os ...@@ -27,25 +28,30 @@ import os
import numpy as np import numpy as np
import aeropy.xfoil_module as xf import aeropy.xfoil_module as xf
# Defaults for polar generation
# AOA
REYNOLDS = [re * 1000000 for re in [0.02, 0.1, 0.2, 0.5, 1, 2, 5, 10]]
AOA = list(np.arange(-16, 22, 0.5))
MACH = 0.1
def main(): def main():
"""Creates polar files for each reynolds""" """Creates polar files for each reynolds"""
airfoil = parse_inputs() airfoil = parse_inputs()
reynolds = [re * 1000000 for re in [0.2, 0.5, 1, 1.5, 2, 5, 10]]
aoa = list(np.arange(-18, 25, 0.5))
i = 1 i = 1
for re in reynolds: for re in REYNOLDS:
print("%d/%d - Calculating polar for Re=%ge6" % (i, len(reynolds), re / 1e6)) print("%d/%d - Calculating polar for Re=%ge6" % (i, len(REYNOLDS), re / 1e6))
i = i + 1 i = i + 1
if airfoil.startswith("naca"): if airfoil.startswith("naca"):
xf.call( xf.call(
airfoil, airfoil,
alfas=aoa, alfas=AOA,
output="Polar", output="Polar",
Reynolds=re, Reynolds=re,
Mach=MACH,
plots=False, plots=False,
NACA=True, NACA=True,
iteration=500, iteration=500,
...@@ -54,9 +60,10 @@ def main(): ...@@ -54,9 +60,10 @@ def main():
if os.path.exists(airfoil) or os.path.exists(airfoil + ".dat"): if os.path.exists(airfoil) or os.path.exists(airfoil + ".dat"):
xf.call( xf.call(
airfoil, airfoil,
alfas=aoa, alfas=AOA,
output="Polar", output="Polar",
Reynolds=re, Reynolds=re,
Mach=MACH,
plots=False, plots=False,
NACA=False, NACA=False,
iteration=500, iteration=500,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment