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

IPC and TE Flap optimization #181

Merged
merged 67 commits into from
Aug 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
accb2d5
Pull ROSCO f/ipc branch for NJA
nikhar-abbas Jan 12, 2022
120a8c4
Squashed 'ROSCO/' changes from aad73965..86f3a9c4
nikhar-abbas Jan 12, 2022
52639c3
Pull ROSCO f/ipc branch for NJA
nikhar-abbas Jan 12, 2022
6c78390
Squashed 'ROSCO/' changes from 86f3a9c4..02e08f7d
nikhar-abbas Jan 12, 2022
9d10bd0
Pull ROSCO f/ipc branch for NJA
nikhar-abbas Jan 12, 2022
54ab8ce
Squashed 'ROSCO/' changes from 02e08f7d..9bc06254
nikhar-abbas Jan 12, 2022
99fde11
Pull ROSCO f/ipc branch for NJA
nikhar-abbas Jan 12, 2022
8ccfcdb
Squashed 'ROSCO/' changes from 9bc06254..9986ecb3
nikhar-abbas Jan 12, 2022
9d23207
Pull ROSCO f/ipc branch for NJA
nikhar-abbas Jan 12, 2022
5878c06
Squashed 'ROSCO/' changes from 9986ecb3..03f2b761
nikhar-abbas Jan 12, 2022
ed7d852
Add IPC 1P optimization capabilites
nikhar-abbas Jan 14, 2022
b31346b
WISDEM:TEMP - add step_calc to opt options
nikhar-abbas Jan 14, 2022
d596ab1
fix error message
nikhar-abbas Jan 19, 2022
5c62307
specify float flap tuning inputs
nikhar-abbas Jan 19, 2022
e2a83c8
fix DAC example for BAR_USC w/ flaps
nikhar-abbas Jan 19, 2022
9247fe2
fix error message
nikhar-abbas Jan 19, 2022
9b59529
specify float flap tuning inputs
nikhar-abbas Jan 19, 2022
5278878
fix DAC example for BAR_USC w/ flaps
nikhar-abbas Jan 19, 2022
5c79acf
Squashed 'WISDEM/' changes from 77e6ce29..fd169fbb
nikhar-abbas Feb 12, 2022
991c25e
Update to wisdem with twr modeshapes fix
nikhar-abbas Feb 12, 2022
ef146cf
Merge branch 'f/ipc_opt' of https://github.com/nikhar-abbas/WEIS into…
nikhar-abbas Feb 12, 2022
a699300
improved error handling gand updates from f/tmds
nikhar-abbas Feb 21, 2022
c022e5c
bug fixes for posing flaps problem
nikhar-abbas Feb 21, 2022
2e5ce9b
add ld_mma to fd_methods
nikhar-abbas Feb 21, 2022
59cb9ad
don't allow negative ipc
nikhar-abbas Feb 21, 2022
326378b
improved error handling
nikhar-abbas Feb 21, 2022
9ed8101
update flap related inputs
nikhar-abbas Feb 21, 2022
b997533
BREAKS OF: reduced tolerance for mode shape coefficients
nikhar-abbas Feb 21, 2022
150c7d4
Update ROSCO for new flap tuning
nikhar-abbas Feb 21, 2022
8adae00
Squashed 'ROSCO/' changes from 03f2b761..e7e10e66
nikhar-abbas Feb 21, 2022
7873e08
update for refactored flap tuning methods
nikhar-abbas Feb 21, 2022
396d510
update defaults and ranges for flp tuning
nikhar-abbas Feb 21, 2022
ad65c9e
new flap control parameters, comment out old constraints
nikhar-abbas Feb 21, 2022
2815f28
remove print statements
nikhar-abbas Feb 21, 2022
a7402ed
Minor tuning fixes
nikhar-abbas Feb 22, 2022
d3ac52c
Squashed 'ROSCO/' changes from e7e10e66..e86b860d
nikhar-abbas Feb 22, 2022
f9c1c24
improve xfoil error handling
nikhar-abbas Feb 25, 2022
4f991a5
remove flapwise freq scaling
nikhar-abbas Feb 25, 2022
089ecc1
Add max twr DEL as constraint
nikhar-abbas Mar 9, 2022
0ba3468
new blade load parsing methods
nikhar-abbas Mar 9, 2022
ae126c9
add del_twrbsmyt_ratio output
nikhar-abbas Mar 10, 2022
6d61114
typo
nikhar-abbas Mar 10, 2022
570a853
output correct forces/moments, not just My moments
nikhar-abbas Mar 10, 2022
3b8a5af
Squashed 'ROSCO/' changes from e86b860d..40a4edc9
nikhar-abbas Jun 28, 2022
932d666
Updating to latest ROSCO/devevelop
nikhar-abbas Jun 28, 2022
6b72c94
Merge remote-tracking branch 'upstream/develop' into f/ipc_opt
nikhar-abbas Jun 28, 2022
a16d45e
Revert "BREAKS OF: reduced tolerance for mode shape coefficients"
nikhar-abbas Jun 28, 2022
0591d33
delete accidental extra sigma function
nikhar-abbas Jun 28, 2022
9b80680
typo fix
nikhar-abbas Jun 30, 2022
11eadb4
if _not_ doe and MPI
nikhar-abbas Jun 30, 2022
2bae0be
add pyzmq to dependencies
nikhar-abbas Jun 30, 2022
b046e2b
Squashed 'ROSCO/' changes from 40a4edc9f..dd3594d8c
dzalkind Jul 1, 2022
3aa9ca5
Pull ROSCO with update_discons
dzalkind Jul 1, 2022
ba5f45c
Add update_weis_discons, test_OFutils passing locally
dzalkind Jul 1, 2022
83790b0
Squashed 'ROSCO/' changes from bd0562cd4..51629665d
dzalkind Aug 10, 2022
e698446
Pull ROSCO 2.6.0
dzalkind Aug 10, 2022
7b74688
Add update_weis_discons, test_OFutils passing locally
dzalkind Jul 1, 2022
963221d
Update IEA-15 DISCONs
dzalkind Aug 10, 2022
746ebf3
Merge remote-tracking branch 'upstream/update_OF' into rosco_260
dzalkind Aug 10, 2022
d90cf12
Update version table
dzalkind Aug 10, 2022
1232b4d
Add pyzmq to environment
dzalkind Aug 10, 2022
6eaa114
Merge remote-tracking branch 'origin/rosco_260' into rosco_260
dzalkind Aug 10, 2022
25cbf47
Reshape inputs/outputs to call_controller in LinearModel
dzalkind Aug 11, 2022
e617cfe
Merge remote-tracking branch 'upstream/develop' into rosco_260
dzalkind Aug 11, 2022
f925f3b
Merge branch 'rosco_260' into f/ipc_opt
dzalkind Aug 12, 2022
4108d56
Add TMD analysis_schema back in
dzalkind Aug 12, 2022
b6488c8
Merge remote-tracking branch 'upstream/develop' into f/ipc_opt
dzalkind Aug 17, 2022
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Software Model Versions:
Software | Version
--- | ---
OpenFAST | 3.2.0
ROSCO | 2.6.0

The core WEIS modules are:
* _aeroelasticse_ is a wrapper to call [OpenFAST](https://github.com/OpenFAST/openfast)
Expand Down
10 changes: 10 additions & 0 deletions ROSCO/.github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ _Select the appropriate type(s) that describe this PR_
- [ ] Maintenance update
- [ ] Other (please describe)

TODO Items General:
- [ ] Add example/test for new feature
- [ ] Update registry
- [ ] Run testing

TODO Items API Change:
- [ ] Update docs with API change
- [ ] Run update_rosco_discons.py in Test_Cases/
- [ ] Update DISCON schema

## Github issues addressed, if one exists

## Examples/Testing, if applicable
Expand Down
52 changes: 38 additions & 14 deletions ROSCO/.github/workflows/CI_rosco-pytools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,41 +92,66 @@ jobs:
python-version: 3.8
environment-file: environment.yml

# setup cmake
- name: Setup Workspace
run: cmake -E make_directory ${{runner.workspace}}/ROSCO/ROSCO/build

# Install dependencies of ROSCO toolbox
- name: Add dependencies ubuntu specific
if: false == contains( matrix.os, 'windows')
run: |
conda install -y wisdem
- name: Add dependencies windows specific
if: true == contains( matrix.os, 'windows')
run: |
conda install -y m2w64-toolchain libpython
conda install -y wisdem

- name: Add pyFAST dependency
if: false == contains( matrix.os, 'windows')
run: |
git clone http://github.com/OpenFAST/python-toolbox
cd python-toolbox
python -m pip install -e .

# Install ZeroMQ
- name: Install ZeroMQ
run: sudo apt-get install libzmq3-dev

# Install ROSCO toolbox
- name: Install ROSCO toolbox
run: |
python setup.py install --compile-rosco
python setup.py develop

- name: Configure and Build ROSCO - unix
working-directory: ${{runner.workspace}}/ROSCO/ROSCO/build
run: |
cmake \
-DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/ROSCO/ROSCO/install \
-DZMQ_CLIENT=ON \
-DCMAKE_Fortran_COMPILER:STRING=${{env.FORTRAN_COMPILER}} \
..
cmake --build . --target install

# Install OpenFAST
- name: Install OpenFAST
run: |
conda install openfast==3.1.0
conda install openfast==3.2.0

# Run examples
- name: Run examples
run: |
cd Examples
python run_examples.py

# Test walkthrough notebook
- name: Test walkthrough notebook
run: |
cd Examples
treon ROSCO_walkthrough.ipynb

# Archive artifacts
- name: Archive production artifacts
if: success() || failure()
uses: actions/upload-artifact@v3
with:
name: ROSCO-artifacts
path: |
${{runner.workspace}}

run_testing:
name: Run Testing
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -156,21 +181,20 @@ jobs:


# Install dependencies of ROSCO toolbox
- name: Add dependencies ubuntu specific
if: false == contains( matrix.os, 'windows')
- name: Add dependencies
run: |
conda install -y wisdem


# Install ROSCO toolbox
- name: Install ROSCO toolbox
run: |
python setup.py develop --compile-rosco
python setup.py install --compile-rosco

# Install OpenFAST
- name: Install OpenFAST
run: |
conda install openfast==3.1.0
conda install openfast==3.2.0

# Run ROSCO Testing
- name: Run ROSCO testing
Expand All @@ -182,4 +206,4 @@ jobs:
- name: Run regression testing
run: |
cd ROSCO_testing
python regtest.py
python test_checkpoint.py
4 changes: 4 additions & 0 deletions ROSCO/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ examples/cp_ct_cq_lut.p

# Files Generated in Examples
Examples/DISCON.IN
Examples/DISCON_zmq.IN
Examples/*.p

# Exclude testing results
Expand All @@ -86,3 +87,6 @@ ROSCO_testing/results/
*.autosave
*.mat

# OpenFAST outputs
outputs/

310 changes: 227 additions & 83 deletions ROSCO/Examples/ROSCO_walkthrough.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ROSCO/Examples/example_01.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
path_params['FAST_InputFile'],
os.path.join(tune_dir,path_params['FAST_directory']),
dev_branch=True,
rot_source='txt',txt_filename=os.path.join(tune_dir,path_params['rotor_performance_filename'])
rot_source='txt',txt_filename=os.path.join(tune_dir,path_params['FAST_directory'],path_params['rotor_performance_filename'])
)

# Print some basic turbine info
Expand Down
8 changes: 6 additions & 2 deletions ROSCO/Examples/example_04.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,23 @@
controller = ROSCO_controller.Controller(controller_params)

# Load turbine data from OpenFAST and rotor performance text file
cp_filename = os.path.join(tune_dir,path_params['FAST_directory'],path_params['rotor_performance_filename'])
turbine.load_from_fast(
path_params['FAST_InputFile'],
os.path.join(tune_dir,path_params['FAST_directory']),
dev_branch=True,
rot_source='txt',txt_filename=os.path.join(tune_dir,path_params['rotor_performance_filename'])
rot_source='txt',txt_filename= cp_filename
)

# Tune controller
controller.tune_controller(turbine)

# Write parameter input file
param_file = os.path.join(this_dir,'DISCON.IN')
write_DISCON(turbine,controller,param_file=param_file, txt_filename=os.path.join(tune_dir,path_params['rotor_performance_filename']))
write_DISCON(turbine,controller,
param_file=param_file,
txt_filename=cp_filename
)

# Plot gain schedule
fig, ax = plt.subplots(2,2,constrained_layout=True,sharex=True)
Expand Down
9 changes: 7 additions & 2 deletions ROSCO/Examples/example_05.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,12 @@
# controller = ROSCO_controller.Controller(controller_params)

# Load turbine data from OpenFAST and rotor performance text file
cp_filename = os.path.join(tune_dir,path_params['FAST_directory'],path_params['rotor_performance_filename'])
turbine.load_from_fast(
path_params['FAST_InputFile'],
os.path.join(tune_dir,path_params['FAST_directory']),
dev_branch=True,
rot_source='txt',txt_filename=os.path.join(tune_dir,path_params['rotor_performance_filename'])
rot_source='txt',txt_filename=cp_filename
)

# Tune controller
Expand All @@ -68,7 +69,11 @@

# Write parameter input file
param_filename = os.path.join(this_dir,'DISCON.IN')
write_DISCON(turbine,controller,param_file=param_filename, txt_filename=os.path.join(tune_dir,path_params['rotor_performance_filename']))
write_DISCON(
turbine,controller,
param_file=param_filename,
txt_filename=cp_filename
)


# Load controller library
Expand Down
2 changes: 1 addition & 1 deletion ROSCO/Examples/example_07.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
path_params['FAST_InputFile'],
os.path.join(tune_dir,path_params['FAST_directory']),
dev_branch=True,
rot_source='txt',txt_filename=os.path.join(tune_dir,path_params['rotor_performance_filename'])
rot_source='txt',txt_filename=os.path.join(tune_dir,path_params['FAST_directory'],path_params['rotor_performance_filename'])
)
# Tune controller
controller.tune_controller(turbine)
Expand Down
1 change: 0 additions & 1 deletion ROSCO/Examples/example_10.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@

# Load turbine data from openfast model
turbine = ROSCO_turbine.Turbine(turbine_params)
# turbine.load_from_fast(path_params['FAST_InputFile'],path_params['FAST_directory'],dev_branch=True,rot_source='txt',txt_filename=path_params['rotor_performance_filename'])
turbine.load_from_fast(path_params['FAST_InputFile'], \
os.path.join(this_dir,path_params['FAST_directory']),dev_branch=True)

Expand Down
2 changes: 1 addition & 1 deletion ROSCO/Examples/example_11.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
os.path.join(this_dir,path_params['FAST_directory']),
dev_branch=True,
rot_source='txt',
txt_filename=os.path.join(tune_dir,path_params['rotor_performance_filename'])
txt_filename=os.path.join(tune_dir,path_params['FAST_directory'],path_params['rotor_performance_filename'])
)

# Tune controller
Expand Down
27 changes: 25 additions & 2 deletions ROSCO/Examples/example_12.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
import numpy as np
import matplotlib.pyplot as plt
from ROSCO_toolbox.inputs.validation import load_rosco_yaml
from ROSCO_toolbox.linear.robust_scheduling import rsched_driver
from ROSCO_toolbox.linear.robust_scheduling import rsched_driver, load_linturb
from ROSCO_toolbox.linear.lin_vis import lin_plotting
from ROSCO_toolbox import turbine as ROSCO_turbine
from ROSCO_toolbox import controller as ROSCO_controller

Expand Down Expand Up @@ -123,6 +124,28 @@ def run_example():
if False:
plt.show()
else:
plt.savefig(os.path.join(example_out_dir, '12_RobustSched.png'))
fig.savefig(os.path.join(example_out_dir, '12_RobustSched.png'))

# ---- Plot nyquist ----
# Re-load and trimlinturb for plotting
linturb = load_linturb(options['linturb_options']['linfile_path'], load_parallel=True) #
linturb.trim_system(desInputs=['collective'], desOutputs=['RtSpeed'])

# Plotting parameters
u = 12
omega = 0.1
k_float = 0.0
controller.zeta_pc = controller.zeta_pc[0]

# plot
lv = lin_plotting(controller, turbine, linturb)
xlim=ylim=[-2,2]
lv.plot_nyquist(u, omega, k_float=k_float, xlim=xlim, ylim=ylim)

if False:
plt.show()
else:
plt.savefig(os.path.join(example_out_dir, '12_Nyquist.png'))

if __name__ == '__main__':
run_example()
5 changes: 2 additions & 3 deletions ROSCO/Examples/example_13.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@

'''
# Python Modules
import yaml, os, platform
import numpy as np
import os, platform
import matplotlib.pyplot as plt

# ROSCO toolbox modules
Expand Down Expand Up @@ -85,7 +84,7 @@
channels['BldPitch3'] = True

# Run FAST cases
fastBatch = runFAST_pywrapper_batch(FAST_ver='OpenFAST',dev_branch = True)
fastBatch = runFAST_pywrapper_batch()

fastBatch.FAST_directory = os.path.realpath(os.path.join(rosco_dir,'Tune_Cases',path_params['FAST_directory']))
fastBatch.FAST_InputFile = path_params['FAST_InputFile']
Expand Down
2 changes: 1 addition & 1 deletion ROSCO/Examples/example_14.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
channels = set_channels()

# Run FAST cases
fastBatch = runFAST_pywrapper_batch(FAST_ver='OpenFAST',dev_branch = True)
fastBatch = runFAST_pywrapper_batch()

fastBatch.FAST_directory = os.path.realpath(os.path.join(rosco_dir,'Tune_Cases',path_params['FAST_directory']))
fastBatch.FAST_InputFile = path_params['FAST_InputFile']
Expand Down
45 changes: 45 additions & 0 deletions ROSCO/Examples/example_15.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
'''
----------- Example_15 --------------
Use the runFAST scripts to set up an example, use pass through in yaml
-------------------------------------

In this example:
- use run_FAST_ROSCO class to set up a test case

'''

import os
from ROSCO_toolbox.ofTools.case_gen.run_FAST import run_FAST_ROSCO
from ROSCO_toolbox.ofTools.case_gen import CaseLibrary as cl


#directories
this_dir = os.path.dirname(os.path.abspath(__file__))
rosco_dir = os.path.dirname(this_dir)
example_out_dir = os.path.join(this_dir,'examples_out')
os.makedirs(example_out_dir,exist_ok=True)


def main():
# Simulation config
r = run_FAST_ROSCO()

parameter_filename = os.path.join(rosco_dir,'Tune_Cases/NREL5MW_PassThrough.yaml')
run_dir = os.path.join(example_out_dir,'15_PassThrough')
os.makedirs(run_dir,exist_ok=True)

# Step wind simulation
r.tuning_yaml = parameter_filename
r.wind_case_fcn = cl.simp_step
r.wind_case_opts = {
'U_start': [10],
'U_end': [15],
'wind_dir': run_dir
}
r.save_dir = run_dir

r.run_FAST()


if __name__=="__main__":
main()
Loading