Skip to content

Commit

Permalink
Merge pull request #127 from WISDEM/plt_surf
Browse files Browse the repository at this point in the history
Add plots of cp ct cq and regulation trajectory
  • Loading branch information
ptrbortolotti authored Jul 9, 2021
2 parents 3e24fe0 + dc71bef commit f50b168
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions examples/05_IEA-3.4-130-RWT/weis_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,49 @@
if rank == 0:
print('Run time: %f'%(time.time()-tt))
sys.stdout.flush()

import matplotlib.pyplot as plt
import numpy as np
from matplotlib import cm

X = wt_opt['sse_tune.aeroperf_tables.pitch_vector']
Y = wt_opt['sse_tune.aeroperf_tables.tsr_vector']
X, Y = np.meshgrid(X, Y)
pitch_schedule = wt_opt['rotorse.rp.powercurve.pitch']
tsr_schedule = wt_opt['rotorse.rp.powercurve.Omega'] / 30. * np.pi * wt_opt['rotorse.Rtip'] / wt_opt['rotorse.rp.powercurve.V']

# Plot the Cp surface
fig, ax = plt.subplots()
Z = wt_opt['sse_tune.aeroperf_tables.Cp']
cs = ax.contourf(X, Y, Z[:,:,0], cmap=cm.inferno, levels = [0, 0.1, 0.2, 0.3, 0.4, 0.44, 0.47, 0.50, 0.53, 0.56])
ax.plot(pitch_schedule, tsr_schedule, 'w--', label = 'Regulation trajectory')
ax.set_xlabel('Pitch angle (deg)', fontweight = 'bold')
ax.set_ylabel('Tip speed ratio (-)', fontweight = 'bold')
cbar = fig.colorbar(cs)
cbar.ax.set_ylabel('Aerodynamic power coefficient (-)', fontweight = 'bold')
plt.legend()

# Plot the Ct surface
fig, ax = plt.subplots()
Z = wt_opt['sse_tune.aeroperf_tables.Ct']
cs = ax.contourf(X, Y, Z[:,:,0], cmap=cm.inferno)
ax.plot(pitch_schedule, tsr_schedule, 'w--', label = 'Regulation trajectory')
ax.set_xlabel('Pitch angle (deg)', fontweight = 'bold')
ax.set_ylabel('Tip speed ratio (-)', fontweight = 'bold')
cbar = fig.colorbar(cs)
cbar.ax.set_ylabel('Aerodynamic thrust coefficient (-)', fontweight = 'bold')
plt.legend()

# Plot the Cq surface
fig, ax = plt.subplots()
Z = wt_opt['sse_tune.aeroperf_tables.Cq']
cs = ax.contourf(X, Y, Z[:,:,0], cmap=cm.inferno)
ax.plot(pitch_schedule, tsr_schedule, 'w--', label = 'Regulation trajectory')
ax.set_xlabel('Pitch angle (deg)', fontweight = 'bold')
ax.set_ylabel('Tip speed ratio (-)', fontweight = 'bold')
cbar = fig.colorbar(cs)
cbar.ax.set_ylabel('Aerodynamic torque coefficient (-)', fontweight = 'bold')
plt.legend()

plt.show()

0 comments on commit f50b168

Please sign in to comment.