Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DFSM #293

Open
wants to merge 15 commits into
base: ct-opt
Choose a base branch
from
Open

DFSM #293

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
1 change: 1 addition & 0 deletions examples/06_IEA-15-240-RWT/IEA-15-240-RWT_VolturnUS-S.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ assembly:
rotor_diameter: 241.94
rated_power: 15.e+6
lifetime: 25.0
marine_hydro: False
components:
blade:
outer_shape_bem:
Expand Down
12 changes: 11 additions & 1 deletion examples/13_DTQP/gen_oloc.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
from pCrunch import LoadsAnalysis, PowerProduction, FatigueParams
import pandas as pd

import matplotlib.pyplot as plt


import numpy as np

Expand All @@ -24,7 +26,7 @@
fname_modeling_options = mydir + os.sep + "modeling_options.yaml"
modeling_options = sch.load_modeling_yaml(fname_modeling_options)

fname_wt_input = mydir + os.sep + "IEA-15-floating.yaml"
fname_wt_input = os.path.join(this_dir,"..","06_IEA-15-240-RWT", "IEA-15-240-RWT_VolturnUS-S.yaml")
wt_init = sch.load_geometry_yaml(fname_wt_input)

fname_analysis_options = mydir + os.sep + "analysis_options.yaml"
Expand Down Expand Up @@ -73,6 +75,7 @@
WindFile_name = [''] * dlc_generator.n_cases

level2_disturbance = []
fig,ax = plt.subplots(1)

for i_case in range(dlc_generator.n_cases):
dlc_generator.cases[i_case].AnalysisTime = dlc_generator.cases[i_case].analysis_time + dlc_generator.cases[i_case].transient_time
Expand All @@ -95,6 +98,13 @@
tt = ts_file['t']
level2_disturbance.append({'Time':tt, 'Wind': u_h})

ax.plot(tt,u_h)
ax.set_xlim([tt[0],tt[-1]])
ax.set_xlabel('Time [s]')
ax.set_ylabel('Wind Speed [m/s]')

plt.show()


# Linear Model

Expand Down
36 changes: 36 additions & 0 deletions examples/19_DFSM/IEA_15_MW/IEA_w_TMD_Cp_Ct_Cq.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# ----- Rotor performance tables for the WEIS Turbine wind turbine -----
# ------------ Written on May-15-24 using the ROSCO toolbox ------------

# Pitch angle vector, 5 entries - x axis (matrix columns) (deg)
-5.0 3.75 12.5 21.25 30.0
# TSR vector, 5 entries - y axis (matrix rows) (-)
2.0 4.5 7.0 9.5 12.0
# Wind speed vector - z axis (m/s)
10.66

# Power coefficient

0.007424 0.027901 0.048885 0.060368 0.044839
0.154181 0.243819 0.160565 0.021548 -0.147753
0.446518 0.370316 0.119840 -0.274910 -0.582696
0.383138 0.419921 -0.034150 -0.838584 -1.334299
0.204352 0.423209 -0.313032 -1.696288 -2.553034


# Thrust coefficient

0.068605 0.069383 0.074022 0.074255 0.052424
0.270813 0.300864 0.185946 0.032251 -0.123781
0.727893 0.484291 0.148635 -0.224945 -0.416426
1.050977 0.605789 0.007677 -0.624404 -0.785844
1.364539 0.695969 -0.217703 -1.124732 -1.261919


# Torque coefficient

0.003730 0.014017 0.024559 0.030328 0.022526
0.034426 0.054440 0.035851 0.004811 -0.032990
0.064092 0.053154 0.017201 -0.039460 -0.083639
0.040522 0.044413 -0.003612 -0.088692 -0.141121
0.017110 0.035435 -0.026210 -0.142031 -0.213766

198 changes: 198 additions & 0 deletions examples/19_DFSM/IEA_15_MW/IEA_w_TMD_DISCON.IN

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions examples/19_DFSM/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## Overview
This example introduces the basic workings of the derivative function surrogate modeling (DFSM) approach, and demonstrates a usecase for closed-loop simulations.

Checkout `run_simulation.py` on how to use the DFSM with ROSCO for closed-loop simulation.

The DFSM is available in the `dfsm_1p6.pkl` file. This model has been specifically built for simulating load cases from DLC 1.6.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we generate this pickle file? What's in the pickle file? Can it be expressed in a readable way?


## Model Description
The DFSM approximates the system response as a linear parameter varying (LPV) state-space model with the following structure:

dx/dt = A(w)x + B(w)u

y = C(w)x + D(w)u

The states (x) considered in the model are platform pitch (PtfmPitch), tower top displacement (fore-aft) (TTDspFA), generator speed (GenSpeed), and their first-time derivatives.

The controls/inputs (u) are rotor average wind speed (w) (RtVAvgxh), generator torque (GenTq), blade pitch (BldPitch1), and wave elevation (Wave1Elev).

The outputs (y) are tower-base fore-aft shear force (TwrBsFxt), side-to-side moment (TwrBsMyt), tower top translational and rotational accelerations (YawBrTAxp, NcIMURAys), and the generator power (GenPwr).

## Model Development



987 changes: 987 additions & 0 deletions examples/19_DFSM/RM1.yaml

Large diffs are not rendered by default.

86 changes: 86 additions & 0 deletions examples/19_DFSM/analysis_options_dfsm_fowt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
general:
folder_output: outputs/FOWT_DFSM_test2
fname_output: refturb_output


design_variables:
control:
servo:
pitch_control:
omega:
flag: False
min: 0.1
max: 0.4
zeta:
flag: False
min: 0.1
max: 3.0
Kp_float:
flag: False
min: -40
max: 0
ptfm_freq:
flag: False
max: 0.4

# floating:
# joints:
# flag: True
# # z_coordinate:
# # - names: [main_keel, col1_keel, col2_keel, col3_keel]
# # lower_bound: -40.0
# # upper_bound: -15.0
# r_coordinate:
# - names: [col1_keel, col1_freeboard, col2_keel, col2_freeboard, col3_keel, col3_freeboard]
# lower_bound: 38.8125
# upper_bound: 64.6875
# members:
# flag: True
# groups:
# - names: [column1,column2,column3]
# diameter:
# lower_bound: 9.375
# upper_bound: 15.625
# groups:
# - names: [main_column]
# diameter:
# lower_bound: 7.5
# upper_bound: 12.5



constraints:
control:
rotor_overspeed:
flag: False
min: 0.0
max: 0.25
Max_PtfmPitch:
flag: False
max: 5.5
Std_PtfmPitch:
flag: False
max: 2.
Max_Offset:
flag: False
max: 30.

merit_figure: DEL_TwrBsMyt # Merit figure of the optimization problem. The options are 'AEP' - 'LCOE' - 'Cp' - 'blade_mass' - 'blade_tip_deflection'


driver:
optimization:
flag: False # Flag to enable optimization
solver: LN_COBYLA # Optimization solver. Other options are 'SLSQP' - 'CONMIN'
tol: 1.e-2 # Optimality tolerance
max_iter: 100 # Maximum number of iterations (SLSQP)
design_of_experiments:
flag: False # Flag to enable design of experiments
run_parallel: False # Flag to run using parallel processing
generator: FullFact # Type of input generator. (Uniform)
num_samples: 6 # number of samples for (Uniform only)

recorder:
flag: True # Flag to activate OpenMDAO recorder
file_name: log_opt.sql # Name of OpenMDAO recorder
includes: ['*raft*','*floating*','*platform*']
46 changes: 46 additions & 0 deletions examples/19_DFSM/analysis_options_dfsm_mhk.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
general:
folder_output: outputs/test_constant
fname_output: iea15mw

# design_variables:
# control:
# servo:
# pitch_control:
# omega:
# flag: True
# min: 0.1
# max: 1.1
# zeta:
# flag: True
# min: 0.1
# max: 3.0

merit_figure: DEL_TwrBsMyt # Merit figure of the optimization problem. The options are 'AEP' - 'LCOE' - 'Cp' - 'blade_mass' - 'blade_tip_deflection'

constraints:
control:
rotor_overspeed:
flag: True
min: 0.0
max: 0.2

driver:
optimization:
flag: False
tol: 1.e-2 # Optimality tolerance
max_major_iter: 2 # Maximum number of major design iterations (SNOPT)
max_minor_iter: 100 # Maximum number of minor design iterations (SNOPT)
max_iter: 2 # Maximum number of iterations (SLSQP)
solver: LN_COBYLA # Optimization solver. Other options are 'SLSQP' - 'CONMIN'
step_size: 1.e-3 # Step size for finite differencing
form: forward # Finite differencing mode, either forward or central
design_of_experiments:
flag: False # Flag to enable design of experiments
run_parallel: False # Flag to run using parallel processing
generator: FullFact # Type of input generator. (Uniform)
num_samples: 5 # number of samples for (Uniform only)
criterion: center

recorder:
flag: True # Flag to activate OpenMDAO recorder
file_name: log_opt.sql # Name of OpenMDAO recorder
Binary file added examples/19_DFSM/dfsm_1p6.pkl
Binary file not shown.
Loading
Loading