Skip to content
Snippets Groups Projects
Commit ad2708b0 authored by many's avatar many
Browse files

fix naca airfoil creator finite_te and testmethod

parent a3cc7c5c
No related branches found
No related tags found
1 merge request!10Merge recent changes in master to we_ahrens
Pipeline #8337 passed
......@@ -275,7 +275,7 @@ def naca(number, n, finite_te=False, half_cosine_spacing=True):
pointa = np.array([X[0], Y[0], 0])
pointb = np.array([X[-1], Y[-1], 0])
center = (pointb - pointa) / 2 + pointa
arcres = int(n / 5)
arcres = int(n / 5)+1
arc = pv.CircularArc(pointa, pointb, center, resolution=arcres, negative=True)
arcpts = arc.points[1:-2]
points = np.vstack([points, arcpts[::-1]])
......
def test_naca(tmpdir):
def test_naca():
from ntrfc.turbo.airfoil_generators.naca_airfoil_creator import naca
import numpy as np
import pyvista as pv
res = 480
xs,ys = naca("6510",res,half_cosine_spacing=False,finite_te=False)
points = np.stack([xs,ys,np.zeros(len(xs))]).T
poly = pv.PolyData(points)
assert poly.number_of_points == res*2+1
xs,ys = naca("6510",res,half_cosine_spacing=True,finite_te=False)
points = np.stack([xs,ys,np.zeros(len(xs))]).T
poly = pv.PolyData(points)
assert poly.number_of_points == res*2+1
xs,ys = naca("6510",res,half_cosine_spacing=False,finite_te=True)
points = np.stack([xs,ys,np.zeros(len(xs))]).T
poly = pv.PolyData(points)
assert poly.number_of_points == res*2+1+97-2
xs,ys = naca("6510",res,half_cosine_spacing=True,finite_te=True)
points = np.stack([xs,ys,np.zeros(len(xs))]).T
poly = pv.PolyData(points)
assert poly.number_of_points == res*2+1+97-2
xs,ys = naca("23112",res,half_cosine_spacing=False,finite_te=False)
points = np.stack([xs,ys,np.zeros(len(xs))]).T
poly = pv.PolyData(points)
assert poly.number_of_points == res*2+1
xs,ys = naca("23112",res,half_cosine_spacing=True,finite_te=False)
points = np.stack([xs,ys,np.zeros(len(xs))]).T
poly = pv.PolyData(points)
assert poly.number_of_points == res*2+1
xs,ys = naca("23112",res,half_cosine_spacing=False,finite_te=True)
points = np.stack([xs,ys,np.zeros(len(xs))]).T
poly = pv.PolyData(points)
assert poly.number_of_points == res*2+1+97-2
xs,ys = naca("23112",res,half_cosine_spacing=True,finite_te=True)
points = np.stack([xs,ys,np.zeros(len(xs))]).T
poly = pv.PolyData(points)
assert poly.number_of_points == res*2+1+97-2
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