From 1f807ba3eee0da59b347996213c2cd0ea2363939 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gregory=20Duth=C3=A9?= Date: Fri, 14 May 2021 12:27:11 +0200 Subject: [PATCH 1/3] Mach number fix Fixes mach number --- src/api.f90 | 1 + 1 file changed, 1 insertion(+) diff --git a/src/api.f90 b/src/api.f90 index a53f4fc..96caa29 100644 --- a/src/api.f90 +++ b/src/api.f90 @@ -203,6 +203,7 @@ subroutine set_mach(M) bind(c, name='set_mach') if (M /= MINf) then MINf = M + MINf1 = M call comset if (MINf>0.0 .and. show_output) write (*, 99003) CPStar, QSTar / QINf From 21952d5583b2f872f52b48d550c55e69265c2929 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gregory=20Duth=C3=A9?= Date: Fri, 14 May 2021 12:28:47 +0200 Subject: [PATCH 2/3] Y coordinate output Changes to allow for the get_cp subroutine to return y-coords --- src/api.f90 | 3 ++- xfoil/xfoil.py | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/api.f90 b/src/api.f90 index 96caa29..c79e85a 100644 --- a/src/api.f90 +++ b/src/api.f90 @@ -487,7 +487,7 @@ function get_n_cp() bind(c, name='get_n_cp') get_n_cp = N end function get_n_cp - subroutine get_cp(x_out, cp_out, n_points) bind(c, name='get_cp') + subroutine get_cp(x_out, y_out, cp_out, n_points) bind(c, name='get_cp') use s_xfoil, only: comset use m_xoper use i_xfoil @@ -508,6 +508,7 @@ subroutine get_cp(x_out, cp_out, n_points) bind(c, name='get_cp') den = beta + bfac * cpinc cp_out(i) = cpinc / den x_out(i) = X(i) + y_out(i) = Y(i) enddo end subroutine get_cp diff --git a/xfoil/xfoil.py b/xfoil/xfoil.py index 4334ef6..fb87837 100644 --- a/xfoil/xfoil.py +++ b/xfoil/xfoil.py @@ -321,12 +321,15 @@ def get_cp_distribution(self): ------- x : np.array X-coordinates + y : np.array + Y-coordinates cp : np.ndarray Pressure coefficients at the corresponding x-coordinates """ n = self._lib.get_n_cp() x = np.zeros(n, dtype=c_float) + y = np.zeros(n, dtype=c_float) cp = np.zeros(n, dtype=c_float) - self._lib.get_cp(x.ctypes.data_as(fptr), cp.ctypes.data_as(fptr), byref(c_int(n))) - return x.astype(float), cp.astype(float) + self._lib.get_cp(x.ctypes.data_as(fptr), y.ctypes.data_as(fptr), cp.ctypes.data_as(fptr), byref(c_int(n))) + return x.astype(float), y.astype(float), cp.astype(float) From ce182a05bb96104e2c60c7a412b61422d6d03b4b Mon Sep 17 00:00:00 2001 From: time-trader Date: Fri, 14 May 2021 20:25:26 +0200 Subject: [PATCH 3/3] y-out definition --- src/api.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api.f90 b/src/api.f90 index c79e85a..f6cc22e 100644 --- a/src/api.f90 +++ b/src/api.f90 @@ -494,7 +494,7 @@ subroutine get_cp(x_out, y_out, cp_out, n_points) bind(c, name='get_cp') implicit none integer(c_int), intent(in) :: n_points - real(c_float), dimension(n_points), intent(inout) :: x_out, cp_out + real(c_float), dimension(n_points), intent(inout) :: x_out, y_out, cp_out real :: beta, bfac, cpcom, cpinc, den integer :: i