Skip to content

Commit

Permalink
Combine ROSCO and the ROSCO_toolbox (#54) (#78)
Browse files Browse the repository at this point in the history
* Add peak shaving back to UMaine Semi example

* create lin_util

* move helper functions to lin _util

* Revert controller to develop: TSR_at_minspeed

* add survey

* add survey

* typo fix

* Update headers

* fix bullets

* make uppercase

* Update turbine.py (#56)

* Update turbine.py

This add several lines for fixing the problem of repeated maximum values in the performance tables. This will cause the error (' the length of x and y is different.') of 'interpolate.interp1d.'

* Add comments and catch when there are multiple optimal pitch angles

Co-authored-by: dzalkind <dzalkind@nrel.gov>

* increment version

* Update for OpenFAST v3.0.0

* Update for OpenFAST v3.0.0

* Install OF3.0.0 for tests

* update for OF v3.0.0

* add publish to pypi on release

* Update to ROSCO v2.3.0

* Update Testing (#58)

* Update scripts to run on eagle

* Update IEA-15MW semi example: use peak shaving w/ ps_percen=0.8

* Add comparison plots to testing scripts

* Update submit script for testing

* Update for latest eagle runs

* Add future to install dependencies

* add TMax to self, define tmin in print_results

* run tests in CI

* generic ROSCO path

* default to overwrite

* fix path

* import platform

* separate run_testing

* cleanup, specify lite test

* don't run testing in after examples, oops.

Co-authored-by: nikhar-abbas <40865984+nikhar-abbas@users.noreply.github.com>
Co-authored-by: Nikhar Abbas <nikhar.abbas@colorado.edu>

* increment version

* Update for OpenFAST v3.0.0

* Install OF3.0.0 for tests

* update for OF v3.0.0

* add publish to pypi on release

* Update to ROSCO v2.3.0

* Increment Version, OF3.0 (#57)

* increment version

* Update for OpenFAST v3.0.0

* Install OF3.0.0 for tests

* update for OF v3.0.0

* add publish to pypi on release

* Update to ROSCO v2.3.0

* increment version

* Update for OpenFAST v3.0.0

* Install OF3.0.0 for tests

* update for OF v3.0.0

* add publish to pypi on release

* Update to ROSCO v2.3.0

* add ROSCO without submodule

* move ROSCO source to ROSCO folder

* Move cmake-related files to ROSCO

* Add back pesky ErrVar

* Remove parameters_files

* Merge ROSCO and _toolbox gitignore

* Fix .gitignore

* Remove Examples/DISCON.IN from git

* Fix and point example_01 to Tune_Cases/

* Update verbiage around using ofTools vs. weis

* Fix and point example_04 to Tune_Cases/

* Clean up example_06

* Clean up example_07

* Only check FlpCornerFreq if using Flp control, fixes example 05

* Make example_04 consistent with others

* Let example_05 run independently from 04

* Clean up example_05, wind files

* Add schema and update empty tuning yaml inputs, not connected yet

* Integrate schema into turbine, controller, and examples

* Only check Fl filter parameters if Fl_Mode > 0, fix example_05

* bump version to 2.3

* Compile ROSCO from ROSCO dir

* Rename to CI_rosco

* Add omega vs. windspeed functionality

* Fix tests: 5MW U_pc and 06 example dir

* Make _Toolbox vs_minspeed in rotor frame to match ROSCO

* Revert ServoDyn change

* change rotor speed constraint to be epsilon

* rename for clarity

* docs major refresh

* fix FA_AccF units in debug file

* docs that build locally

* Deallocate arrays in ROSCO, check in example_05

* Clean up comments

* remove gitmodules

* furo theme

* furo in requirements

* move readthedocs config file, remove furo import in conf.py

* add docs requirements file

* typo

* move index out of source folder

* trying to get furo to work

* import date

* fix versions and titles, cleanup readthedocs requirements

* typo fix, remove extras

* more cleanup

* bump version

* no furo extension, "hack" to load RT version

* proper toctree paths

* specify method

* add mock modules

* fix typos

* update python install requirements

* running locally

* move index to main docs dir again

* update to build locally

* error during warnings

* automated version

* cleanup

* remove old docs

* re-add docs

* simplify

* fix figure path

* try alabaster

* remove archived docs

* Add omega vs. windspeed functionality

* Fix tests: 5MW U_pc and 06 example dir

* more detailed sp.optimize settings

* run MBC3 in parallel

* restructure driver, run initialization doe for tuning

* Try new dlclose function

* Update example_05 to run simple simulation twice and check result

* Revert deallocation stuff

* Close discon library after every sim run

* Test examples on macOS and windows

* Run examples instead of testing on other platforms

* Skip examples in windows for now

* update paths and yaml load funciton

* Skip mac testing of examples

* provide default U_pc for single omega/zeta case

* allow for float or list-like pc tuning inputs

* Change name in setup.py

* WE_Vw unit fix

* cleeanup for improved stability

* check for doe_logs as string in load_DOE

* major restructure for rsched_driver class

* cleanup verbosity

* run serial by default

* load_parallel as linturb_option

* specific IEA15MW yaml for multi omega

* remove unused module imports

* fix error message types

* lin_file as input

* add comments on inputs to LinearTurbineModel init method

* remove relative file paths

* provide OpenFAST linearizations for IEA15MW UMaineSemi

* put plotting in specific function

* fix WE_lambda units

* add self in on a few necessary variables

* creaete example 12 for robust scheduling

* try a few mbc3 locations for import

* allow list-like or numpy arrays for omega_pc and zeta_pc schedules

* create and use recorder setup function

* Pass Through Kp_float (#57)

* Pass through kp_float, if desired

* Minor fixes: schema error and InputReader defaults

* fix setup_recorder to work for optimization driver too

* cleanup om problems, update om0 calc

* doe levels as input

* negative k_float to account for OF conventions

* cleanup print statements

* variable name cleanup, use calculated k_float

* Add defaults to omega_,zeta_ pc and vs, allow to be numbers

* use standard tuning k_float as IC

* formatting update

* update problem setup methods

* cleanup add_dv, enable adding design variables after problem is setup

* change optimization step size

* more setup restructure

* update verbosity

* use sphinx-rtd-theme

* master doc and sphinx rtd theme

* index back to root folder

* only ignore install folders

* remove hidden toctree

* furo theme

* update paths

* convert rt version to string

* update sphinx settings

* move conf

* furo theme

* Mostly a docs update (#61)

* rename for clarity

* docs major refresh

* fix FA_AccF units in debug file

* docs that build locally

* remove gitmodules

* furo theme

* furo in requirements

* move readthedocs config file, remove furo import in conf.py

* add docs requirements file

* typo

* move index out of source folder

* trying to get furo to work

* import date

* fix versions and titles, cleanup readthedocs requirements

* typo fix, remove extras

* more cleanup

* bump version

* no furo extension, "hack" to load RT version

* proper toctree paths

* specify method

* add mock modules

* fix typos

* update python install requirements

* running locally

* move index to main docs dir again

* update to build locally

* error during warnings

* automated version

* cleanup

* remove old docs

* re-add docs

* simplify

* fix figure path

* try alabaster

* remove archived docs

* use sphinx-rtd-theme

* master doc and sphinx rtd theme

* index back to root folder

* only ignore install folders

* remove hidden toctree

* furo theme

* update paths

* convert rt version to string

* update sphinx settings

* move conf

* furo theme

* Pass through Kp_float = 0 (#59)

* Pass through kp_float, if desired

* Minor fixes: schema error and InputReader defaults

* Allow pass through of Kp_float = 0

* Add flp parameters to schema

* Change Fl_Mode default to 0

* Add defaults to omega_,zeta_ pc and vs, allow to be numbers

* Allow single pitch tuning values in code, default U_pc to 0

* use nac acceleration for floating feedback

* Fix TSR saturation for region 2.5operation

* Modify system for constant power operation

* Only modify pole for constant power above-rated

* Remove GenEff from K calc

* Update tuning, use constant power

* use load_rosco_yaml

* constant power

* Fix broken tests

* Include Fl_Mode=2 for nacelle pitching feedback

* Versioning (#65)

* use sphinx-rtd-theme

* master doc and sphinx rtd theme

* index back to root folder

* only ignore install folders

* remove hidden toctree

* furo theme

* update paths

* convert rt version to string

* update sphinx settings

* move conf

* furo theme

* remove git versioning from cmake

* use hard coded rosco_version

* update intro write method

* set nowrap for intel compilers

* update install instructions

* Catch nans in ROSCO at end of WSE

* fix conda install typo

* cleanup docs

* Rename DEBUG2.dbg to RootName.dbg2

* Fix Fl_Mode == 2

* Fix Fl_Mode == 2 again

* Allow Fl_Mode = 2 in ROSCO

* Set notch and check frequencies when Fl_Mode = 1 (fixes bug)

* Update robust scheduling methods

* Fail fast when not using custom build_extension

* Add a Windows install step with FC var set

* Force using MinGW for Windows build

* Use FC environment variable for all systems

* Portable option for setting the CMake generator

* Remove unused input to setup function

* Fix notch types allowed

* Add VS_ControlMode of 3 to DISCON comment

* Allow PS_Mode of 2 and 3 to work in ROSCO as if PS_Mode = 1

* Format and clean up ROSCO

* cleanup checks for lengths of pitch controller tuning inputs

* restructure for WEIS, cleanup nearest nyquist calculation methods

* update example for restructure

* specify VS_ControlMode=3 option

* Update links, add issues and discussions, cleanup

* Fix plotting typo

* Update and cleanup docs for recent changes

* bump version numbers to 2.4.0

* updates for more consistent convergence to minimum nyquist

* list_check tuning inputs

* change initial condition to om0=0.1

* delete unuses modules

* list_check controller params without return_bool

* More oneROSCO2 updates, primarily housekeeping (#76)

* cleanup checks for lengths of pitch controller tuning inputs

* restructure for WEIS, cleanup nearest nyquist calculation methods

* update example for restructure

* specify VS_ControlMode=3 option

* Update links, add issues and discussions, cleanup

* Fix plotting typo

* Update and cleanup docs for recent changes

* bump version numbers to 2.4.0

* updates for more consistent convergence to minimum nyquist

* list_check tuning inputs

* change initial condition to om0=0.1

* delete unuses modules

* list_check controller params without return_bool

* Align y labels

* indentation fixes

* minor restructure

* change to code-block commands

* add spaces

* remove space

* more spacing fixes

* use code-block command throughout

* add cmake to requirements

* make figure svg instead of png

* Update and cleanup, especially install instructions

* Update titles

* delete old instructions

* change header type

* minor hyperlink update

* include build directories in gitignore

Co-authored-by: Nikhar Abbas <nikhar.abbas@colorado.edu>
Co-authored-by: Xianping Du <38188001+Seager1989@users.noreply.github.com>
Co-authored-by: nikhar-abbas <40865984+nikhar-abbas@users.noreply.github.com>
Co-authored-by: Rafael M Mudafort <rafmudaf@gmail.com>

Co-authored-by: Nikhar Abbas <nikhar.abbas@colorado.edu>
Co-authored-by: Xianping Du <38188001+Seager1989@users.noreply.github.com>
Co-authored-by: nikhar-abbas <40865984+nikhar-abbas@users.noreply.github.com>
Co-authored-by: Rafael M Mudafort <rafmudaf@gmail.com>
  • Loading branch information
5 people authored Oct 15, 2021
1 parent 7e10015 commit ecef7ae
Show file tree
Hide file tree
Showing 603 changed files with 318,008 additions and 868 deletions.
1 change: 0 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@ _Select the appropriate type(s) that describe this PR_

## Examples/Testing, if applicable


73 changes: 73 additions & 0 deletions .github/workflows/CI_rosco-compile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: CI_rosco-compile

# We run CI on push commits on all branches
on: [push, pull_request]

# Specify FORTRAN compiler
env:
FORTRAN_COMPILER: gfortran-10

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
name: Build (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: ["ubuntu-latest", "macOS-latest", "windows-latest"]
python-version: ["3.8"]

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup environment
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
channels: conda-forge, general
auto-update-conda: true


- name: Add dependencies windows
if: true == contains( matrix.os, 'windows')
shell: bash -l {0}
run: |
conda install -y m2w64-toolchain
- name: Setup Workspace
run: cmake -E make_directory ${{runner.workspace}}/ROSCO/ROSCO/build

- name: Configure and Build - unix
if: false == contains( matrix.os, 'windows')
working-directory: ${{runner.workspace}}/ROSCO/ROSCO/build
run: |
cmake \
-DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/ROSCO/ROSCO/install \
-DCMAKE_Fortran_COMPILER:STRING=${{env.FORTRAN_COMPILER}} \
..
cmake --build . --target install
- name: Configure and Build - windows
if: true == contains( matrix.os, 'windows')
working-directory: ${{runner.workspace}}/ROSCO/ROSCO/build
shell: bash -l {0}
run: |
cmake \
-DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/ROSCO/ROSCO/install \
-G "MinGW Makefiles" \
..
cmake --build . --target install
# # Install ROSCO linux
# - name: Compile ROSCO linux
# if: false == contains( matrix.os, 'windows')
# working-directory: ${{runner.workspace}}/ROSCO/ROSCO/build

# # Install ROSCO windows
# - name: Compile ROSCO windows
# if: true == contains( matrix.os, 'windows')
# working-directory: ${{runner.workspace}}/ROSCO/ROSCO/build
# run: cmake --build . --target install -G "MinGW Makefiles"

163 changes: 163 additions & 0 deletions .github/workflows/CI_rosco-pytools.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
name: CI_rosco-pytools

# We run CI on push commits on all branches
on: [push, pull_request]

# Specify FORTRAN compiler
env:
FC: gfortran

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
name: Build (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: ["ubuntu-latest", "macOS-latest", "windows-latest"]
python-version: ["3.8"]
defaults:
run:
shell: bash -l {0}

steps:
- name: Checkout repository and submodules
uses: actions/checkout@v2
with:
submodules: recursive

- name: Setup environment
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
channels: conda-forge, general
auto-update-conda: true
python-version: 3.8
environment-file: environment.yml


# Install dependencies of ROSCO toolbox
- name: Add dependencies windows specific
if: true == contains( matrix.os, 'windows')
run: |
conda install -y m2w64-toolchain libpython
- name: Add dependencies macOS specific
if: true == contains( matrix.os, 'macOS')
run: |
conda install compilers
# Install ROSCO toolbox
- name: Install ROSCO toolbox
run: |
python setup.py develop --compile-rosco
run_examples:
name: Run Examples
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: ["ubuntu-latest"] #, "macOS-latest"]
python-version: ["3.8"]
defaults:
run:
shell: bash -l {0}

steps:
- name: Checkout repository and submodules
uses: actions/checkout@v2
with:
submodules: recursive

- name: Setup environment
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
channels: conda-forge, general
auto-update-conda: true
python-version: 3.8
environment-file: environment.yml


# 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
# Install ROSCO toolbox
- name: Install ROSCO toolbox
run: |
python setup.py develop --compile-rosco
# Install OpenFAST
- name: Install OpenFAST
run: |
conda install openfast==3.0.0
# Run examples
- name: Run examples
run: |
cd Examples
python run_examples.py
run_testing:
name: Run Testing
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: ["ubuntu-latest"] #, "macOS-latest"]
python-version: ["3.8"]
defaults:
run:
shell: bash -l {0}

steps:
- name: Checkout repository and submodules
uses: actions/checkout@v2
with:
submodules: recursive

- name: Setup environment
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
channels: conda-forge, general
auto-update-conda: true
python-version: 3.8
environment-file: environment.yml


# Install dependencies of ROSCO toolbox
- name: Add dependencies ubuntu specific
if: false == contains( matrix.os, 'windows')
run: |
conda install -y wisdem
# Install ROSCO toolbox
- name: Install ROSCO toolbox
run: |
python setup.py develop --compile-rosco
# Install OpenFAST
- name: Install OpenFAST
run: |
conda install openfast==3.0.0
# Run Testing
- name: Run testing
run: |
cd ROSCO_testing
python ROSCO_testing.py
62 changes: 0 additions & 62 deletions .github/workflows/CI_rosco.yml

This file was deleted.

27 changes: 27 additions & 0 deletions .github/workflows/publish_to_pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Upload to PyPi

on:
release:
types: [released]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
if: startsWith(github.ref, 'refs/tags')
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
Loading

0 comments on commit ecef7ae

Please sign in to comment.