I'm working with an aircraft for which I have CL, CD data as a function of Angle of Attack and Mach Number. For this reason, I want to input my own aerodynamic data, rather than use SUAVE's calculations. I have managed to do this by using the SU2_Euler analysis method and inputting a training file with my data. I have played around with the code a lot, and I noticed that the default interpolation of the CL, CD values for different AoA/Mach Numbers uses ExpSineSquared with a Gaussian process (this is in the SU2_inviscid file). I've included the relevant code here:
gp_kernel_ES = ExpSineSquared(length_scale=1.0, periodicity=1.0, length_scale_bounds=(1e-5,1e5), periodicity_bounds=(1e-5,1e5))
regr_cl = gaussian_process.GaussianProcessRegressor(kernel=gp_kernel_ES)
regr_cd = gaussian_process.GaussianProcessRegressor(kernel=gp_kernel_ES)
cl_surrogate = regr_cl.fit(xy, CL_data)
cd_surrogate = regr_cd.fit(xy, CD_data)
I am not familiar with this method, but I have found that it does not work well for interpolating my data. The interpolation is inaccurate, and it is generating regions of negative drag between the points where I have input data. This results in the drag going negative and messing up the L/D below.
For this reason, I rewrote the code using RectBivariateSpline, and the interpolation works a lot better. The problem is that I cannot get the aerodynamic analysis to "interact" properly with this interpolation now, and my code is generating crazy angle of attack values when I try to use this new interpolation. This can be seen in the plot below, since the AoA ranges from -100 to 100 and the L/D fluctuates rapidly.
Is there any easier way to use custom aerodynamics? I wonder if there is a bug with the interpolation method that has been set up, or if I am missing something? Any help would be very much appreciated! I have been working on this for a while, but I can't figure it out.