Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/CI_WEIS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,13 @@ jobs:
treon rev_Opt.ipynb
treon rev_WEIS_CSV.ipynb

- name: Test model creation notebooks and drivers
if: contains( matrix.os, 'ubuntu') && contains( github.event_name, 'pull_request')
run: |
cd examples/09_model_creation_process
treon 0_notebooks/chapter1.ipynb
treon iea22_ptfm_driver.ipynb

# Run parallel script calling OpenFAST
- name: Run parallel cases
if: contains( matrix.os, 'ubuntu') && contains( github.event_name, 'pull_request')
Expand Down
90 changes: 45 additions & 45 deletions examples/02_generate_openfast_model_for_dlcs/iea34_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,48 +16,48 @@
test_run=TEST_RUN
)


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()
if not TEST_RUN:
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()
Loading
Loading