CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   SU2 (https://www.cfd-online.com/Forums/su2/)
-   -   A few SU2_EDU issues to be aware of (https://www.cfd-online.com/Forums/su2/166645-few-su2_edu-issues-aware.html)

anon_k February 14, 2016 03:23

A few SU2_EDU issues to be aware of
 
Hi,

I went to download SU2_EDU today, to install on a new computer. The parallel windows binary link is broken. Also, I noticed this awhile ago, but the python script you have to make the pressure plot is broke. I hacked a fix awhile back, but you may want to provide a functioning version in the download. The hack I did is as follows:

import os, time
import pandas as pd
from optparse import OptionParser
from numpy import *
from matplotlib import pyplot as plt
from matplotlib import mlab

filename = "surface_flow.csv"

# Load the csv file with the airfoil coordinate and pressure data (sorted)

data = pd.read_csv(filename)
data = data.sort('Global_Index')
data.to_csv(filename, index=False)
data = mlab.csv2rec(filename, comments='#', skiprows=0, checkrows=0)

# Plot the airfoil shape and pressure distribution

fig = plt.figure()
ax1 = fig.add_subplot(111)
ax1.plot(data.x_coord[:],data.pressure_coefficient[:],'-b',linewidth = 2.0)
ax1.set_ylim(ax1.get_ylim()[::-1])
ax1.set_xlabel(r'$x/c$', fontsize=20)
ax1.set_ylabel(r'$C_p$', fontsize=20)

ax2 = ax1.twinx()
ax2.plot(data.x_coord[:],data.y_coord[:],'-k',linewidth = 1.5)
ax2.axis('equal')
ax2.axis('off')
ax2.set_xlim([-0.02,1.02])
ax2.set_ylim([-0.1,0.7])
ax2.set_ylabel(r'$y / c$', fontsize=20)
plt.savefig('pressure_distribution.png',format='pn g')

fpalacios February 14, 2016 17:19

Hi,
Thanks for using SU2_EDU. This is an important piece of code for the SU2 community. But, unfortunately, it has not been well maintained since its last release. Could you be a little bit more explicit about the change that you introduced in the code. I have done a diff and this is the result

8c30,37
< filename = "surface_flow.csv"
---
> parser = OptionParser()
> parser.add_option("-f", "--file", dest="file",
> help="surface flow csv file", metavar="FILE")
> (options, args)=parser.parse_args()
>
> # Store the file name
>
> filename = options.file
33,34c62
< plt.savefig('pressure_distribution.png',format='pn g')
<
---
> plt.savefig('pressure_distribution.png',format='pn g')


Thanks,
Francisco Palacios

anon_k February 14, 2016 21:12

1 Attachment(s)
Quote:

Originally Posted by fpalacios (Post 585160)
Hi,
Thanks for using SU2_EDU. This is an important piece of code for the SU2 community. But, unfortunately, it has not been well maintained since its last release. Could you be a little bit more explicit about the change that you introduced in the code. I have done a diff and this is the result

8c30,37
< filename = "surface_flow.csv"
---
> parser = OptionParser()
> parser.add_option("-f", "--file", dest="file",
> help="surface flow csv file", metavar="FILE")
> (options, args)=parser.parse_args()
>
> # Store the file name
>
> filename = options.file
33,34c62
< plt.savefig('pressure_distribution.png',format='pn g')
<
---
> plt.savefig('pressure_distribution.png',format='pn g')


Thanks,
Francisco Palacios

Hi,

Unfortunately, I can't. I did that hack a long time back and don't remember what I did at this point. The edited file does work though. I can double click on it and a plot shows up. I attached a picture of the error I get when using the plot_pressure.py file provided in the SU2_EDU download. The hack I did was intended to fix that. I don't know Python at all. I only posted the code so that it might help someone figure out what is wrong with the file in the download.

anon_k February 14, 2016 21:29

1 Attachment(s)
I should mention I wasn't able to figure out how to differentiate the upper and lower surfaces of the airfoil. It would be nice to be able to know which pressure curve applies to which side of the airfoil. So perhaps have them color coded. The top surface of the airfoil blue and the pressure curve for the top surface blue. The bottom surface of the airfoil red and the pressure curve for the bottom surface red. I attached a picture I got from the script I edited. You can see it isn't too useful since you don't know which curve applies to which airfoil surface.


All times are GMT -4. The time now is 14:35.