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

ROSCO 2.7.0 #214

Closed
wants to merge 20 commits into from
Closed
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
33 changes: 18 additions & 15 deletions ROSCO/.github/workflows/CI_rosco-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: CI_rosco-compile
# We run CI on push commits on all branches
on: [push, pull_request]

# Specify FORTRAN compiler
# Specify FORTRAN compiler, used to be "gfortran-10"
env:
FORTRAN_COMPILER: gfortran-10
FORTRAN_COMPILER: gfortran

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand All @@ -16,19 +16,19 @@ jobs:
fail-fast: true
matrix:
os: ["ubuntu-latest", "macOS-latest", "windows-latest"]
python-version: ["3.8"]
python-version: ["3.9"]

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

- 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
python-version: 3.9
environment-file: environment.yml

# Install ROSCO toolbox
Expand All @@ -42,19 +42,25 @@ jobs:
shell: bash -l {0}
run: python ROSCO/rosco_registry/write_registry.py


- name: Add dependencies windows
if: true == contains( matrix.os, 'windows')
shell: bash -l {0}
run: |
conda install -y m2w64-toolchain

- name: Add dependencies windows
if: true == contains( matrix.os, 'mac')
shell: bash -l {0}
run: |
conda install -y gfortran

- name: Setup Workspace
run: cmake -E make_directory ${{runner.workspace}}/ROSCO/ROSCO/build
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
shell: bash -l {0}
working-directory: "${{runner.workspace}}/ROSCO/ROSCO/build"
run: |
cmake \
-DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/ROSCO/ROSCO/install \
Expand All @@ -64,11 +70,8 @@ jobs:

- name: Configure and Build - windows
if: true == contains( matrix.os, 'windows')
working-directory: ${{runner.workspace}}/ROSCO/ROSCO/build
shell: bash -l {0}
#shell: bash #-l {0}
working-directory: "${{runner.workspace}}/ROSCO/ROSCO/build"
run: |
cmake \
-DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/ROSCO/ROSCO/install \
-G "MinGW Makefiles" \
..
cmake -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX="${{runner.workspace}}/ROSCO/ROSCO/build" ..
cmake --build . --target install
36 changes: 18 additions & 18 deletions ROSCO/.github/workflows/CI_rosco-pytools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: CI_rosco-pytools
# We run CI on push commits on all branches
on: [push, pull_request]

# Specify FORTRAN compiler
# Specify FORTRAN compiler, used to be "gfortran-10"
env:
FC: gfortran-10
FC: gfortran

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand All @@ -16,14 +16,14 @@ jobs:
fail-fast: true
matrix:
os: ["ubuntu-latest", "macOS-latest", "windows-latest"]
python-version: ["3.8"]
python-version: ["3.9"]
defaults:
run:
shell: bash -l {0}

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

Expand All @@ -33,7 +33,7 @@ jobs:
miniconda-version: "latest"
channels: conda-forge, general
auto-update-conda: true
python-version: 3.8
python-version: 3.9
environment-file: environment.yml


Expand All @@ -46,10 +46,10 @@ jobs:
FC: gfortran


# - name: Add dependencies macOS specific
# if: true == contains( matrix.os, 'macOS')
# run: |
# conda install compilers
- name: Add dependencies macOS specific
if: true == contains( matrix.os, 'macOS')
run: |
conda install compilers

# Install ROSCO toolbox
- name: Install ROSCO toolbox on Windows
Expand All @@ -72,14 +72,14 @@ jobs:
fail-fast: true
matrix:
os: ["ubuntu-latest"] #, "macOS-latest"]
python-version: ["3.8"]
python-version: ["3.9"]
defaults:
run:
shell: bash -l {0}

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

Expand All @@ -89,7 +89,7 @@ jobs:
miniconda-version: "latest"
channels: conda-forge, general
auto-update-conda: true
python-version: 3.8
python-version: 3.9
environment-file: environment.yml

# setup cmake
Expand Down Expand Up @@ -129,13 +129,13 @@ jobs:
# Install OpenFAST
- name: Install OpenFAST
run: |
conda install openfast==3.2.0
conda install openfast==3.4

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

# Test walkthrough notebook
- name: Test walkthrough notebook
Expand All @@ -159,14 +159,14 @@ jobs:
fail-fast: true
matrix:
os: ["ubuntu-latest"] #, "macOS-latest"]
python-version: ["3.8"]
python-version: ["3.9"]
defaults:
run:
shell: bash -l {0}

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

Expand All @@ -176,7 +176,7 @@ jobs:
miniconda-version: "latest"
channels: conda-forge, general
auto-update-conda: true
python-version: 3.8
python-version: 3.9
environment-file: environment.yml


Expand All @@ -194,7 +194,7 @@ jobs:
# Install OpenFAST
- name: Install OpenFAST
run: |
conda install openfast==3.2.0
conda install openfast==3.4

# Run ROSCO Testing
- name: Run ROSCO testing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# ROSCO Modules
from ROSCO_toolbox import turbine as ROSCO_turbine
from ROSCO_toolbox.inputs.validation import load_rosco_yaml
import matplotlib.pyplot as plt


# Load yaml file
Expand All @@ -33,7 +34,6 @@
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['FAST_directory'],path_params['rotor_performance_filename'])
)

Expand All @@ -45,4 +45,18 @@
if not os.path.isdir(example_out_dir):
os.makedirs(example_out_dir)

turbine.save(os.path.join(example_out_dir,'01_NREL5MW_saved.p'))
turbine.save(os.path.join(example_out_dir,'01_NREL5MW_saved.p'))

# Now load the turbine and plot the Cp surface

# Load quick from python pickle
turbine = turbine.load(os.path.join(example_out_dir,'01_NREL5MW_saved.p'))

# plot rotor performance
print('Plotting Cp data')
turbine.Cp.plot_performance()

if False:
plt.show()
else:
plt.savefig(os.path.join(example_out_dir,'01_NREL5MW_Cp.png'))
5 changes: 2 additions & 3 deletions ROSCO/Examples/example_03.py → ROSCO/Examples/02_ccblade.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
- Write a text file with rotor performance properties
'''
# Python modules
import yaml, os
import os
# ROSCO toolbox modules
from ROSCO_toolbox import turbine as ROSCO_turbine
from ROSCO_toolbox.utilities import write_rotor_performance
Expand Down Expand Up @@ -38,10 +38,9 @@
turbine.load_from_fast(
path_params['FAST_InputFile'],
os.path.join(this_dir,path_params['FAST_directory']),
dev_branch=True,
rot_source='cc-blade',
txt_filename=None)

# Write rotor performance text file
txt_filename = os.path.join(example_out_dir,'03_Cp_Ct_Cq.Ex03.txt')
txt_filename = os.path.join(example_out_dir,'02_Cp_Ct_Cq.Ex03.txt')
write_rotor_performance(turbine,txt_filename=txt_filename)
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
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= cp_filename
)

Expand Down Expand Up @@ -78,4 +77,4 @@
if False:
plt.show()
else:
plt.savefig(os.path.join(example_out_dir,'04_GainSched.png'))
plt.savefig(os.path.join(example_out_dir,'03_GainSched.png'))
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
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=cp_filename
)

Expand Down Expand Up @@ -108,5 +107,5 @@
if False:
plt.show()
else:
plt.savefig(os.path.join(example_out_dir,'05_NREL5MW_SimpSim.png'))
plt.savefig(os.path.join(example_out_dir,'04_NREL5MW_SimpSim.png'))

Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@
controller = ROSCO_controller.Controller(controller_params)

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

# Tune controller
controller.tune_controller(turbine)
Expand Down Expand Up @@ -79,7 +81,7 @@
if False:
plt.show()
else:
plt.savefig(os.path.join(example_out_dir,'06_GainSched.png'))
plt.savefig(os.path.join(example_out_dir,'05_GainSched.png'))

# Run OpenFAST
# --- May need to change fastcall if you use a non-standard command to call openfast
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
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['FAST_directory'],path_params['rotor_performance_filename'])
)
# Tune controller
Expand All @@ -61,4 +60,4 @@
if False:
plt.show()
else:
plt.savefig(os.path.join(example_out_dir,'07_MinPitch.png'))
plt.savefig(os.path.join(example_out_dir,'06_MinPitch.png'))
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@
# fast_out.plot_fast_out()

# Load and plot
fastout = fast_out.load_fast_out(filenames, tmin=10)
fastout = fast_out.load_fast_out(filenames)
fast_out.plot_fast_out(cases=cases,showplot=False)

plt.savefig(os.path.join(example_out_dir,'08_IEA-15MW_Semi_Out.png'))
plt.savefig(os.path.join(example_out_dir,'07_IEA-15MW_Semi_Out.png'))


File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@

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

# Tune controller
controller = ROSCO_controller.Controller(controller_params)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
if not os.path.isdir(example_out_dir):
os.makedirs(example_out_dir)

linmod_filename = os.path.join(example_out_dir,'11_IEA15MW_LinMod.dat')
linmod_filename = os.path.join(example_out_dir,'10_IEA15MW_LinMod.dat')

# Instantiate turbine, controller, and file processing classes
turbine = ROSCO_turbine.Turbine(turbine_params)
Expand All @@ -44,7 +44,6 @@
turbine.load_from_fast(
path_params['FAST_InputFile'],
os.path.join(this_dir,path_params['FAST_directory']),
dev_branch=True,
rot_source='txt',
txt_filename=os.path.join(tune_dir,path_params['FAST_directory'],path_params['rotor_performance_filename'])
)
Expand Down
Loading