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

Expanded level 2 linearization capabilities #116

Merged
merged 198 commits into from
Jul 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
198 commits
Select commit Hold shift + click to select a range
d6d2781
Merge branch 'master' of https://github.com/WISDEM/WEIS
johnjasa Oct 27, 2020
6c5d35e
Removed files that now live in mfm_paper_studies
johnjasa Oct 27, 2020
4c31ba1
Added smaller overridden capability
johnjasa Oct 27, 2020
0d1f163
Added option to run weis and setup separately. some MFM changes
johnjasa Oct 27, 2020
92441d9
Removed timing statements
johnjasa Oct 28, 2020
e5cd83e
Updated github actions script
johnjasa Oct 29, 2020
80d6134
Updated multifidelity tests and added them to CI
johnjasa Oct 29, 2020
ed5e634
Fixed multifidelity issue with memory access
johnjasa Oct 30, 2020
19eb843
Began to implement basinhopping option
johnjasa Nov 5, 2020
41ba7de
Fixed tests
johnjasa Nov 6, 2020
51697e2
Blackened some multifidelity files
johnjasa Nov 7, 2020
a02dcd4
Added basinhopping and tests
johnjasa Nov 7, 2020
db8430c
Removed setup/run options from runWEIS
johnjasa Nov 12, 2020
00092da
Merge pull request #1 from WISDEM/f/BRFM
johnjasa Nov 13, 2020
53fcf66
Moved where root flapwise bending moment calculation is done
johnjasa Nov 13, 2020
95ce333
Updated trust region test
johnjasa Nov 14, 2020
b7e2fe2
Cleaning up surrogate models for trust region
johnjasa Nov 14, 2020
cc98eb8
Merge pull request #2 from WISDEM/f/BRFM
johnjasa Nov 16, 2020
8f9d1d3
Checkpointing test reformulations
johnjasa Nov 18, 2020
9e25445
Merge pull request #3 from WISDEM/f/BRFM
johnjasa Nov 19, 2020
6a7e922
Update PC sweep and linear model
dzalkind Nov 25, 2020
0fa0523
Merge pull request #4 from WISDEM/f/BRFM
johnjasa Nov 30, 2020
64942c5
Updating stall angle calcs for OF
johnjasa Dec 2, 2020
73e2f65
Fix multifidelity control example
dzalkind Dec 3, 2020
35c7d39
Exclude results/ and outputs/ from git
dzalkind Dec 3, 2020
bb2cf11
Revert "Exclude results/ and outputs/ from git"
dzalkind Dec 3, 2020
4a8a613
Exclude outputs from git
dzalkind Dec 3, 2020
abce97f
Merge remote-tracking branch 'upstream/develop' into lin_models
dzalkind Dec 4, 2020
85d728d
Minor remove
johnjasa Dec 8, 2020
9248407
Remove OpenFAST cmake stuff form git
dzalkind Dec 9, 2020
996b979
Make sure we're running linearization with same turbine
dzalkind Dec 9, 2020
0095ff5
Add tuning yaml for IEA-15MW to examples
dzalkind Dec 9, 2020
5a0e2b6
Remove wind files from git tracking
dzalkind Dec 9, 2020
cbbc41a
Add old multifidelity script for reference
dzalkind Dec 9, 2020
747e503
Add multifidelity compare notebook
dzalkind Dec 9, 2020
7615f44
Merging
johnjasa Dec 16, 2020
4a31f5f
Checkpointing
johnjasa Dec 16, 2020
927e96b
Merge branch 'testing' of https://github.com/WISDEM/WEIS into update_…
johnjasa Dec 16, 2020
1acbb30
Fixed multifidelity tests
johnjasa Dec 16, 2020
b48c44b
Fixed CI_weis
johnjasa Dec 16, 2020
575c342
Merging
johnjasa Dec 16, 2020
a337a21
Merge branch 'develop' of https://github.com/WISDEM/WEIS into update_…
johnjasa Dec 18, 2020
2b8ff8a
Merge branch 'develop' of https://github.com/WISDEM/WEIS into update_…
johnjasa Dec 18, 2020
b3ce3ca
Merge branch 'rt_refactor' into lin_models
dzalkind Dec 18, 2020
99af573
Merge branch 'develop' of https://github.com/WISDEM/WEIS into update_…
johnjasa Dec 22, 2020
7b8070a
Added aero power outputs
johnjasa Dec 23, 2020
f3799cb
Fixed sorting bug in pCrunch
johnjasa Dec 28, 2020
565bb40
Removed empty returns on non-root procs
johnjasa Dec 29, 2020
9a11b28
Fix exception in LinearModel
dzalkind Dec 29, 2020
c7be4ec
Merge remote-tracking branch 'upstream/develop' into lin_models
dzalkind Dec 29, 2020
5dbe8ab
Point to local openfast
dzalkind Dec 30, 2020
3e5f505
Hardcoding MPI false for multifidelity
johnjasa Dec 31, 2020
9dcb37f
Fixing folder creation in faux parallel
johnjasa Jan 4, 2021
fd09282
Hardcoded more MPI=False for now
johnjasa Jan 4, 2021
db0b00e
Remove run_control_opt.py example, code is in LinearFAST.py now
dzalkind Jan 4, 2021
b90631e
Removed hardcoded MPI bools
johnjasa Jan 5, 2021
85e5952
Rename multifidelity control script
dzalkind Jan 5, 2021
d92256b
Refactor LinearFAST for greater flexibility when generating lin models
dzalkind Jan 5, 2021
d29f265
Updates for multifidelity MPI
johnjasa Jan 5, 2021
8d94b9a
Updates to run multifidelity in parallel
johnjasa Jan 5, 2021
bd1a15f
Add working multifidelity example
dzalkind Jan 6, 2021
e4f7be0
Update linearization procedure
dzalkind Jan 6, 2021
9a418dc
Fix directory naming
dzalkind Jan 6, 2021
7c80e7e
Merge remote-tracking branch 'upstream/develop' into lin_models
dzalkind Jan 8, 2021
8ff9150
Update ROSCO_toolbox subtree, fix floating feedback
dzalkind Jan 8, 2021
a45a8ec
Squashed 'ROSCO_toolbox/' changes from cf5b43bc..096f1e9a
dzalkind Jan 8, 2021
b37fc27
Refactor to add level2 and level3 turbine classes
dzalkind Jan 8, 2021
2f48d8d
Squashed 'OpenFAST/' changes from d8127649d..59addb289
dzalkind Jan 8, 2021
9457bf3
Update to latest OpenFAST dev: linearization fix
dzalkind Jan 8, 2021
8032d7f
Update aeroelasticse for OpenFAST changes
dzalkind Jan 8, 2021
263ff97
Update openfast model to suppress MBC warnings
dzalkind Jan 8, 2021
b9e16a4
Fix wind speeds so linear system can be interpolated
dzalkind Jan 8, 2021
91f2db0
Added flexibility in overriding values size
johnjasa Jan 13, 2021
6d775a5
Fixed even number proc bug
johnjasa Jan 13, 2021
8b16121
Fix parallel bug
johnjasa Jan 13, 2021
92ef345
Changes for 1d plots for paper
johnjasa Jan 25, 2021
1884eca
Minor change for figure saving
johnjasa Jan 26, 2021
66eda1e
Merging
johnjasa Mar 1, 2021
52ad0e4
Minor changes for linearized version
johnjasa Mar 2, 2021
b0752f2
Added perturbed L2
johnjasa Mar 2, 2021
85e01e0
Add PtfmPitch_Std and tune controller
dzalkind Mar 2, 2021
443dc2f
Fixed tuning
johnjasa Mar 3, 2021
2c5e347
Use runFAST_pywrapper to check for files when overwrite = False
dzalkind Mar 4, 2021
e978a4c
Use rotor avg wind speed directly from turbsim input as level 2 disturb,
dzalkind Mar 4, 2021
172f064
Merge remote-tracking branch 'jj/update_multifidelity' into update_mu…
dzalkind Mar 4, 2021
829ee6e
Include platform, tower DOFs in compare example
dzalkind Mar 4, 2021
c7fd3ad
Adding files for linearization work
johnjasa Mar 11, 2021
35a31c3
Run fixed-bottom linearizations
dzalkind Mar 11, 2021
a9f844c
Move case generation into own method, remove steady processing
dzalkind Mar 11, 2021
771fcf4
Add initial linearization methods into WEIS, example 06 working
dzalkind Mar 11, 2021
5338d2e
Keep all inputs and outputs of linear model, except azimuth
dzalkind Mar 11, 2021
c79b1d9
Have DOE and linearization working; some hacks
johnjasa Mar 12, 2021
a96613d
Simplified linearization scripts
johnjasa Mar 12, 2021
4f4fd73
Better plot
johnjasa Mar 12, 2021
afbf629
Clean up directories, dof input
dzalkind Mar 16, 2021
056c2ee
Turn off overwriting
dzalkind Mar 16, 2021
aab2630
Remove glob, keep all linear outputs and inputs in linear model
dzalkind Mar 16, 2021
6dc66fe
Merge branch 'lin_wrt_DVs' of https://github.com/dzalkind/WEIS into l…
johnjasa Mar 18, 2021
bd45951
Save rotor speed and description of states w/o azimuth
dzalkind Mar 18, 2021
0ce79ff
Merge branch 'lin_wrt_DVs' of https://github.com/dzalkind/WEIS into l…
johnjasa Mar 18, 2021
b2f5103
Get Level2 options from modeling_options
dzalkind Mar 18, 2021
1628e9e
Merge branch 'lin_wrt_DVs' of https://github.com/dzalkind/WEIS into l…
johnjasa Mar 19, 2021
3ea7586
Added E and rho as design vars; updated script
johnjasa Mar 19, 2021
ed62c48
Keep 1st derivative of DOF_GeAz (generator speed) state
dzalkind Mar 19, 2021
d538aad
Output operating points from WEIS
dzalkind Apr 13, 2021
d555a7b
Set pitch_init to change for each linearization
dzalkind Apr 13, 2021
df8fcec
Add ROSCO control interface to LinearModel solve
dzalkind Apr 13, 2021
67a8a5b
Squashed 'ROSCO_toolbox/' changes from 096f1e9a..c93cb45f
dzalkind Apr 13, 2021
06cfbc1
Merge commit '67a8a5b38b902155bf80a752ceba6632156b701d' into lin_wrt_DVs
dzalkind Apr 13, 2021
3c913b6
Added semi
johnjasa Apr 13, 2021
18b171f
Added 15MW semi sub
johnjasa Apr 13, 2021
6c659e8
Allow linearizations without GenDOF
dzalkind Apr 13, 2021
e041b47
Increase output precision
dzalkind Apr 13, 2021
0689c1d
Remove nlin=12 hard code
dzalkind Apr 13, 2021
957b869
Fix linearization DOF schema: TwrSSDOF2
dzalkind Apr 13, 2021
3714448
Update mbc3 and getMats from pyFAST
dzalkind Apr 13, 2021
d63f592
Merge remote-tracking branch 'jj/lin_wrt_DVs' into lin_wrt_DVs
dzalkind Apr 13, 2021
8bc20a5
Merge remote-tracking branch 'upstream/develop' into u/lin_wrt_DVs
dzalkind Apr 14, 2021
0108901
Make simple linearization example
dzalkind Apr 14, 2021
06acbe2
Add pCrunch analysis from messed up merge
dzalkind Apr 14, 2021
9835fde
Update simple linearization example
dzalkind Apr 14, 2021
f75d313
Add back openfast call from exe - needs clean up
dzalkind Apr 14, 2021
0bc9445
Merge branch 'lin_wrt_DVs' of https://github.com/dzalkind/WEIS into l…
johnjasa Apr 14, 2021
3ca5a35
Merge branch 'u/lin_wrt_DVs' of https://github.com/dzalkind/WEIS into…
johnjasa Apr 14, 2021
26f8ae4
Simplify linear cases
dzalkind Apr 14, 2021
8164868
Update openfast_openmdao to run lins with exe
dzalkind Apr 14, 2021
a0632d1
Updates to doe driver
johnjasa Apr 14, 2021
8b63eff
Merge branch 'u/lin_wrt_DVs' of https://github.com/dzalkind/WEIS into…
johnjasa Apr 14, 2021
a68c385
Update/hack to run IEA-15 semi linearizations
dzalkind Apr 14, 2021
a0f4d24
merging
johnjasa Apr 15, 2021
7b5fd40
Fixes and hardcoded values for MAP
johnjasa Apr 16, 2021
ca6c21a
Fix below rated linearizations, k_opt and w_rated
dzalkind Apr 16, 2021
904fc5b
Run openfast library by default, make output_dict a dict of numpy arrays
dzalkind Apr 16, 2021
c4dcb39
Run linearizations with exe in openmdao
dzalkind Apr 16, 2021
9f2be00
Pull correct output data from fastBatch
dzalkind Apr 16, 2021
b43503e
Successfully controlling mooring properties for MAP
johnjasa Apr 17, 2021
e91f31e
Merge branch 'u/lin_wrt_DVs' of https://github.com/dzalkind/WEIS into…
johnjasa Apr 17, 2021
dc49274
Fix typo that has been bothering me
dzalkind Apr 28, 2021
6fbac2f
Updated nominal values
johnjasa Apr 28, 2021
f27ec1d
Make CpCtCq file have absolute path, helps in level 2
dzalkind Apr 28, 2021
3d2354c
Add level 2 simulation
dzalkind Apr 28, 2021
99055d8
Update to make E_user work for floating towers
johnjasa May 4, 2021
e0630cc
Fixed errant solver change
johnjasa May 4, 2021
0902172
Fix for E_user for floating+tower cases
johnjasa May 5, 2021
75f8c19
Added line_length DV to linearization DOE
johnjasa May 6, 2021
5b9b66e
Merge branch 'u/lin_wrt_DVs' of https://github.com/dzalkind/WEIS into…
johnjasa Jun 10, 2021
6087850
First stab at merging in develop
johnjasa Jun 10, 2021
ae0dadb
Merge remote-tracking branch 'upstream/develop' into lin_wrt_DVs
dzalkind Jun 16, 2021
e032dd9
Bring FAST_wrapper back
dzalkind Jun 16, 2021
f39c0e3
Get linearizations and linear sims running after merge: working
dzalkind Jun 16, 2021
b6c6389
Increase IEA-15 semi wisdem model to be close to openfast model
dzalkind Jun 16, 2021
6456067
Remove extreme table from loads analysis inputs
dzalkind Jun 16, 2021
a0065e3
Fix DOE test:
dzalkind Jun 22, 2021
623cb73
FixED John's typo :-)
dzalkind Jun 22, 2021
3569e66
Add ballast and bulkheads to main column: mass matches, inertia closer
dzalkind Jun 22, 2021
f6b9eeb
Loosen approx tol for test due to arch differences
johnjasa Jun 22, 2021
b5f19fc
Merge remote-tracking branch 'upstream/develop' into lin_wrt_DVs
dzalkind Jun 28, 2021
eed71b7
Merge remote-tracking branch 'jj/lin_wrt_DVs' into lin_wrt_DVs
dzalkind Jun 28, 2021
3e1697d
Skip monopile_loading if not running in Level3
dzalkind Jun 28, 2021
252957d
Generalized fix keyword
johnjasa Jun 28, 2021
4190ab3
Update IEA-15-floating yaml for both linearization cases
dzalkind Jun 28, 2021
78b6b32
Combine linearization example folders
dzalkind Jun 28, 2021
a4afc9c
Remove extra inputs
dzalkind Jun 28, 2021
d8b687f
Add linearization examples to testing
dzalkind Jun 28, 2021
d4ed2ca
Working through floating fixes
johnjasa Jun 28, 2021
2f445ac
Squashed 'WISDEM/' changes from 52306ecd..beabb074
johnjasa Jun 28, 2021
c5182af
Updating WISDEM
johnjasa Jun 28, 2021
3666e1b
Reworking mooring dicts
johnjasa Jun 28, 2021
78cd393
Fixed segfault for MAP case
johnjasa Jun 29, 2021
68e8361
Fixed 12 weis_driver example folders
johnjasa Jun 29, 2021
a925f90
Fixed OC3 example
johnjasa Jun 29, 2021
030e283
Revert "Fixed 12 weis_driver example folders"
dzalkind Jun 29, 2021
f91d7b7
Make output directory if it doesn't exist recursively
dzalkind Jun 29, 2021
5306b56
Use WEIS-based IEA-15MW semi
dzalkind Jun 29, 2021
0a98420
Changed to makedirs throughout WEIS
johnjasa Jun 30, 2021
98d2ddc
Run examples/06 in Level3 to cover monopile_loading
dzalkind Jun 30, 2021
18facc3
Merge remote-tracking branch 'jj/lin_wrt_DVs' into lin_wrt_DVs
dzalkind Jun 30, 2021
b3f25c2
Get monopile example working, semi linearization broken
dzalkind Jun 30, 2021
0c857f2
Use simplified member approach for UMaine semi model in linear mode
dzalkind Jun 30, 2021
27002fb
Add use_exe to explicitly use FAST_exe vs. _lib
dzalkind Jun 30, 2021
0a89ac8
Fix water depth
dzalkind Jun 30, 2021
262f913
Zero hydro coefficients if potential-only model used
dzalkind Jun 30, 2021
dad3825
Fix linearization DOE file output and modeling
dzalkind Jun 30, 2021
6ca5aad
Removed FAST_vars.py
johnjasa Jun 30, 2021
e98d82f
Added IEA15 test
johnjasa Jun 30, 2021
af518fc
Add LinearFAST test
dzalkind Jun 30, 2021
dfef572
Merge remote-tracking branch 'jj/lin_wrt_DVs' into lin_wrt_DVs
dzalkind Jun 30, 2021
eda7705
Merge remote-tracking branch 'ewq/f/update_tune_rosco' into lin_wrt_DVs
dzalkind Jul 7, 2021
fa129f0
Remove ROSCO_toolbox
dzalkind Jul 7, 2021
b75885c
Merge commit 'add6a73addbc5adc87d14b9ddebe554fd951f433' into lin_wrt_DVs
dzalkind Jul 7, 2021
add6a73
Squashed 'ROSCO/' changes from 7e100154..05e9eef3
dzalkind Jul 7, 2021
3788d4a
Update setup.py to reflect combined ROSCO subtree
dzalkind Jul 7, 2021
a0c69cf
WEIS updates for latest combined ROSCO subtree:
dzalkind Jul 7, 2021
ed4de53
Squashed 'ROSCO/' changes from 05e9eef3..81b34264
dzalkind Jul 7, 2021
3c6453e
Merge commit 'ed4de53760103dfce7a723ceca31fb469e0aaece' into lin_wrt_DVs
dzalkind Jul 7, 2021
bd42f29
Fix tests:
dzalkind Jul 7, 2021
b297616
Bring back PtfmVol0 scaling for example 03
dzalkind Jul 7, 2021
8a15fef
Merge remote-tracking branch 'upstream/develop' into lin_wrt_DVs
dzalkind Jul 7, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,15 @@ Thumbs.db
*.sum
*.ech
*.dbg
*/CMakeCache.txt
*.check_cache

# Temp
*Temp*
*temp*

outputs/
results/

# Turbsim
wind/
16 changes: 16 additions & 0 deletions OpenFAST/docs/source/user/api_change.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,22 @@ InflowWind 7 VFlowAng 0 VFlowAng - Upflow angle (degree
============== ==== ================== =============================================================================================================================================================================


OpenFAST v2.3.0 to OpenFAST v2.4.0
----------------------------------

============== ==== ================== =============================================================================================================================================================================
Added in OpenFAST v2.4.0
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Module Line Flag Name Example Value
============== ==== ================== =============================================================================================================================================================================
IfW driver 6 [separator line] ===================== File Conversion Options =================================
IfW driver 7 WrHAWC false WrHAWC - Convert all data to HAWC2 format? (flag)
IfW driver 8 WrBladed false WrBladed - Convert all data to Bladed format? (flag)
IfW driver 9 WrVTK false WrVTK - Convert all data to VTK format? (flag)
InflowWind 7 VFlowAng 0 VFlowAng - Upflow angle (degrees) (not used for native Bladed format WindType=7)
============== ==== ================== =============================================================================================================================================================================


OpenFAST v2.3.0 to OpenFAST v2.4.0
----------------------------------

Expand Down
1 change: 1 addition & 0 deletions OpenFAST/glue-codes/simulink/src/FAST_SFunc.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ static void mdlTerminate(SimStruct *S)
FAST_End(&iTurb, &tr);
n_t_global = -2;
}
FAST_DeallocateTurbines(&ErrStat, ErrMsg);

FAST_DeallocateTurbines(&ErrStat2, ErrMsg2);
if (ErrStat2 != ErrID_None){
Expand Down
1 change: 0 additions & 1 deletion ROSCO/.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


Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ jobs:
run: |
conda install -y compilers
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
Expand Down
4 changes: 3 additions & 1 deletion ROSCO/.github/workflows/CI_rosco.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI_rosco-toolbox
name: CI_rosco

# We run CI on push commits on all branches
on: [push, pull_request]
Expand Down Expand Up @@ -45,6 +45,7 @@ jobs:
if: false == contains( matrix.os, 'windows')
shell: pwsh
run: |
cd ROSCO
mkdir build
cd build
cmake ..
Expand All @@ -55,6 +56,7 @@ jobs:
if: true == contains( matrix.os, 'windows')
shell: pwsh
run: |
cd ROSCO
mkdir build
cd build
cmake .. -G "MinGW Makefiles"
Expand Down
111 changes: 84 additions & 27 deletions ROSCO/.gitignore
Original file line number Diff line number Diff line change
@@ -1,27 +1,84 @@
# Gitignore
~$README.docx
ControllerSchematic.pptx

# Compiled code, unnecessary for git
Source/Obj_win32
Source/Obj_lin64
*.mod
Source/x64/
Source/Release/
*build*
Makefile
*install*

# Archive
Scripts/CompileDISCONHereCopyRun\.cmd
\.vs/

# Temp Files
*~
.DS_Store
*.u2d
*.i90
*.swp

# vs code
.vscode
# Gitignore
~$README.docx
ControllerSchematic.pptx

# Compiled code, unnecessary for git
Source/Obj_win32
Source/Obj_lin64
*.mod
Source/x64/
Source/Release/
*build*
Makefile
*install*

# Archive
Scripts/CompileDISCONHereCopyRun\.cmd
\.vs/

# Temp Files
*~
.DS_Store
*.u2d
*.i90
*.swp


# python compiled files
__pycache__/
.cache
*.pyc
*.egg-info
dist
build
_build
*.ipynb_checkpoints*
*.html

# macOS files
.DS_Store

# MATLAB files
*.m~
*slprj*

# ide settings and files
.idea
.vscode

# OpenFAST generated files
*.sum
*.ech
*.dbg
*.out
*.outb
*.dbg
*.vtp

# ROSCO files
*.85
*.i90
*local*

# Binaries
*.dylib
*.so
*.dll
*.bts

# Other
.pytest_cache
examples/cp_ct_cq_lut.p

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

# Exclude testing results
ROSCO_testing/results/

# Simulink/Matlab temp files
*.slxc
*.autosave
*.mat

File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@
import yaml, os
# ROSCO Modules
from ROSCO_toolbox import turbine as ROSCO_turbine
from ROSCO_toolbox.inputs.validation import load_rosco_yaml


# Load yaml file
this_dir = os.path.dirname(os.path.abspath(__file__))
parameter_filename = os.path.join(this_dir,'NREL5MW_example.yaml')
inps = yaml.safe_load(open(parameter_filename))
tune_dir = os.path.join(this_dir,'../Tune_Cases')
parameter_filename = os.path.join(tune_dir,'NREL5MW.yaml')
inps = load_rosco_yaml(parameter_filename)
path_params = inps['path_params']
turbine_params = inps['turbine_params']

Expand All @@ -29,9 +32,9 @@

turbine.load_from_fast(
path_params['FAST_InputFile'],
os.path.join(this_dir,path_params['FAST_directory']),
os.path.join(tune_dir,path_params['FAST_directory']),
dev_branch=True,
rot_source='txt',txt_filename=os.path.join(this_dir,path_params['rotor_performance_filename'])
rot_source='txt',txt_filename=os.path.join(tune_dir,path_params['rotor_performance_filename'])
)

# Print some basic turbine info
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# ROSCO toolbox modules
from ROSCO_toolbox import turbine as ROSCO_turbine
from ROSCO_toolbox.utilities import write_rotor_performance
from ROSCO_toolbox.inputs.validation import load_rosco_yaml
# Initialize parameter dictionaries
turbine_params = {}
control_params = {}
Expand All @@ -24,8 +25,10 @@
os.makedirs(example_out_dir)

# Load yaml file
parameter_filename = os.path.join(this_dir,'NREL5MW_example.yaml')
inps = yaml.safe_load(open(parameter_filename))
this_dir = os.path.dirname(os.path.abspath(__file__))
tune_dir = os.path.join(this_dir,'../Tune_Cases')
parameter_filename = os.path.join(tune_dir,'NREL5MW.yaml')
inps = load_rosco_yaml(parameter_filename)
path_params = inps['path_params']
turbine_params = inps['turbine_params']
controller_params = inps['controller_params']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@
from ROSCO_toolbox import turbine as ROSCO_turbine
from ROSCO_toolbox import sim as ROSCO_sim
from ROSCO_toolbox.utilities import write_DISCON
from ROSCO_toolbox.inputs.validation import load_rosco_yaml


# Load yaml file
this_dir = os.path.dirname(os.path.abspath(__file__))
parameter_filename = os.path.join(this_dir,'NREL5MW_example.yaml')
inps = yaml.safe_load(open(parameter_filename))
tune_dir = os.path.join(this_dir,'../Tune_Cases')
parameter_filename = os.path.join(tune_dir,'NREL5MW.yaml')
inps = load_rosco_yaml(parameter_filename)
path_params = inps['path_params']
turbine_params = inps['turbine_params']
controller_params = inps['controller_params']
Expand All @@ -34,17 +37,17 @@
# 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']),
os.path.join(tune_dir,path_params['FAST_directory']),
dev_branch=True,
rot_source='txt',txt_filename=os.path.join(this_dir,path_params['rotor_performance_filename'])
rot_source='txt',txt_filename=os.path.join(tune_dir,path_params['rotor_performance_filename'])
)

# Tune controller
controller.tune_controller(turbine)

# Write parameter input file
param_file = 'DISCON.IN'
write_DISCON(turbine,controller,param_file=param_file, txt_filename=path_params['rotor_performance_filename'])
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']))

# Plot gain schedule
fig, ax = plt.subplots(1,2,constrained_layout=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
Notes - You will need to have a compiled controller in ROSCO, and
properly point to it in the `lib_name` variable.
- Using wind speed estimators in this simple simulation is
known to cause problems. We suggesting using WE_Mode = 0 in DISCON.IN.
known to cause problems. We suggesting using WE_Mode = 0 in DISCON.IN
or increasing sampling rate of simulation
'''
# Python modules
import matplotlib.pyplot as plt
Expand All @@ -22,6 +23,18 @@
from ROSCO_toolbox import turbine as ROSCO_turbine
from ROSCO_toolbox import sim as ROSCO_sim
from ROSCO_toolbox import control_interface as ROSCO_ci
from ROSCO_toolbox.utilities import write_DISCON
from ROSCO_toolbox.inputs.validation import load_rosco_yaml


# Load yaml file
this_dir = os.path.dirname(os.path.abspath(__file__))
tune_dir = os.path.join(this_dir,'../Tune_Cases')
parameter_filename = os.path.join(tune_dir,'NREL5MW.yaml')
inps = load_rosco_yaml(parameter_filename)
path_params = inps['path_params']
turbine_params = inps['turbine_params']
controller_params = inps['controller_params']

# Specify controller dynamic library path and name
this_dir = os.path.dirname(os.path.abspath(__file__))
Expand All @@ -36,20 +49,36 @@
else:
lib_name = os.path.join(this_dir, '../ROSCO/build/libdiscon.so')

# # Load turbine model from saved pickle
turbine = ROSCO_turbine.Turbine
turbine = turbine.load(os.path.join(example_out_dir,'01_NREL5MW_saved.p'))
# 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(tune_dir,path_params['FAST_directory']),
dev_branch=True,
rot_source='txt',txt_filename=os.path.join(tune_dir,path_params['rotor_performance_filename'])
)

# Tune controller
controller = ROSCO_controller.Controller(controller_params)
controller.tune_controller(turbine)

# 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']))

# Load turbine model from saved pickle
turbine = ROSCO_turbine.Turbine
turbine = turbine.load(os.path.join(example_out_dir,'01_NREL5MW_saved.p'))

# Load controller library
controller_int = ROSCO_ci.ControllerInterface(lib_name,param_filename=param_filename)
controller_int = ROSCO_ci.ControllerInterface(lib_name,param_filename=param_filename,sim_name='sim1')

# Load the simulator
sim = ROSCO_sim.Sim(turbine,controller_int)
sim_1 = ROSCO_sim.Sim(turbine,controller_int)

# Define a wind speed history
dt = 0.1
dt = 0.025
tlen = 1000 # length of time to simulate (s)
ws0 = 7 # initial wind speed (m/s)
t= np.arange(0,tlen,dt)
Expand All @@ -59,7 +88,17 @@
ws[i] = ws[i] + t[i]//100

# Run simulator and plot results
sim.sim_ws_series(t,ws,rotor_rpm_init=4)
sim_1.sim_ws_series(t,ws,rotor_rpm_init=4)

# Load controller library again to see if we deallocated properly
controller_int = ROSCO_ci.ControllerInterface(lib_name,param_filename=param_filename,sim_name='sim_2')

# Run simulator again and plot results
sim_2 = ROSCO_sim.Sim(turbine,controller_int)
sim_2.sim_ws_series(t,ws,rotor_rpm_init=4)

# Check if simulations are equal
np.testing.assert_almost_equal(sim_1.gen_speed,sim_2.gen_speed)

if False:
plt.show()
Expand Down
Loading