From 867c939ca999daa69b41dae131e39bcbc5eecb70 Mon Sep 17 00:00:00 2001 From: Thomas Lambert <t.lambert@uliege.be> Date: Wed, 7 Jun 2023 22:18:18 +0200 Subject: [PATCH] refact(polargen): tweak polar generator script --- src/airfoil_data/polargenerator.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/airfoil_data/polargenerator.py b/src/airfoil_data/polargenerator.py index cac3d57..5e83e57 100755 --- a/src/airfoil_data/polargenerator.py +++ b/src/airfoil_data/polargenerator.py @@ -1,3 +1,4 @@ +#!/usr/bin/python3 """Generate airfoil polars automatically using XFOIL Rotare requires the input of airfoil polars to interpolate properly the lift @@ -27,25 +28,30 @@ import os import numpy as np 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(): """Creates polar files for each reynolds""" 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 - for re in reynolds: - print("%d/%d - Calculating polar for Re=%ge6" % (i, len(reynolds), re / 1e6)) + for re in REYNOLDS: + print("%d/%d - Calculating polar for Re=%ge6" % (i, len(REYNOLDS), re / 1e6)) i = i + 1 if airfoil.startswith("naca"): xf.call( airfoil, - alfas=aoa, + alfas=AOA, output="Polar", Reynolds=re, + Mach=MACH, plots=False, NACA=True, iteration=500, @@ -54,9 +60,10 @@ def main(): if os.path.exists(airfoil) or os.path.exists(airfoil + ".dat"): xf.call( airfoil, - alfas=aoa, + alfas=AOA, output="Polar", Reynolds=re, + Mach=MACH, plots=False, NACA=False, iteration=500, -- GitLab