Skip to content

Commit

Permalink
WEIS v1.4 (#322)
Browse files Browse the repository at this point in the history
* Viz tool integration (#301)

* utils update for viz tool

* hotfix for length error in viz utils

* slightly improved hotfix

* trim edge case

* working integration with weis

* add text field for reloading diff yaml file

* f-string typo fix to pass py3.11 unit test

* remove duplicated fields on raft opt

* elevate 'weis_viz' to a command within the conda env

* add optimization type

* reformating vizgen and adding 'weis_viz_input_gen' as a command

---------

Co-authored-by: Cory Frontin <[email protected]>
Co-authored-by: sryu <[email protected]>
Co-authored-by: Sora Ryu <[email protected]>
Co-authored-by: Sora Ryu <[email protected]>

* bug fix in vizFileGen and changes to handle Jul 2024 Kestrel updates (#306)

* bug fix in vizFileGen and fixes to handle Jul 2024 Kestrel updates

* change type settings and default channels

* match type with WEIS level

* minor update on type setting - dlc

---------

Co-authored-by: Sora Ryu <[email protected]>
Co-authored-by: Sora Ryu <[email protected]>

* no need to manipulate turbsim grid for olaf anymore (#313)

* Debug arg parsing error while launching the app & Contribute Initial Documentation (#307)

* fix bug of args parse while running app

* delete unnecessary prints

* change horizontal subplots to vertical ones

* initial documentation

* delete readme file

* minor changes on graph layout

* update on kestrel set up

* merge weis viz docs into existing weis docs

* delete initial weis viz documentation

* update on docs after changing opt type setting

* Revise documentation

---------

Co-authored-by: sryu <[email protected]>
Co-authored-by: dzalkind <[email protected]>

* Remove duplicate numpydoc

* Sync readthedocs yaml with WISDEM

* Add numpydoc to environment

* Set up readthedocs inputs: css, js, bibtex

* Remove old input docs

* Fix images for weis viz

* Add input schema docs following WISDEM

* Add input schema files

* Optimization cleanup to fix and conform to viz changes. (#305)

* added updated optimization documentation... in progress.

* fixed rendering of optimization rst file

* add partial table to docs optimization page

* update to optimization doc.

* analysis updates from kestrel

* added some analysis stuff

* update to optimization docs

* recent kestrel changes

* stuff for local work

* viz toolbox simplfied for inclusion in weis tools

* moved viz_toolbox out of examples and refactored

* corrected accidental git deletion

* updates for kestrel push

* added processor edit for DE/GA

* updates to the viz toolbox and analysis notebook

* actually update analysis notebook

* actually update analysis notebook with more updates

* updated example 17, refactored utilities to match Mayank's files/structure

* remove run script

* more progress toward PR

* add readme

* improvements to analysis and README scripts

* reorganize the output directories to have RAFT vs OF subdirs

* OF updates

* update analysis options to bring the cases together

* some more case unification

* updated the analysis script

* update raft analysis script

* of opt updates and refactoring

* upenfast updates

* removed the weis connections to member ids as om design variables

* update openfast analysis

* updated raft analysis notebook

* improvements to analysis script, some for viz tool update

* update to remove remove load_OMsql_temp

* rename new example file

* updates to get parallel evolutionary methods to work

* Remove platform_elem_memid discrete input

* Add index back in

* Set PropPot only if floating

* viz tools fixed, now using safe yaml loading for problem_vars

* update analysis scripts for OF cases.

* updated OF cases for full ride.

* adjusting ex17 controls study for uniformity

* update with kestrel changes

* fixed output script slight break

* Tidy imports

* bring in line with the incoming WISDEM changes

---------

Co-authored-by: dzalkind <[email protected]>

* Add note about mpi4py for windows users

* Fix connections to drivese_post

* Set run directories relative to input files

* Get member ids from modopts

* Tidy OC3 example

* Re-enable testing of OC3 spar

* Send aero-only hub loads to WISDEM

* Disable potential flow modeling for fixed substructures

* Disable second tower mode in OC3 example for now

* align with new orbit changes

* Upgrade mpi (#321)

* use openmdao mpi, import scripts that were pushed out of wisdem

* like in wisdem, import input yaml files only on rank=0 and then broadcast out

* yaml loading logic better integrated in wisdem

* remove outdated call to mpi4py

* Remove temporary simple_types

* Updates for Optimization study (#323)

* added updated optimization documentation... in progress.

* fixed rendering of optimization rst file

* add partial table to docs optimization page

* update to optimization doc.

* analysis updates from kestrel

* added some analysis stuff

* update to optimization docs

* recent kestrel changes

* stuff for local work

* viz toolbox simplfied for inclusion in weis tools

* moved viz_toolbox out of examples and refactored

* corrected accidental git deletion

* updates for kestrel push

* added processor edit for DE/GA

* updates to the viz toolbox and analysis notebook

* actually update analysis notebook

* actually update analysis notebook with more updates

* updated example 17, refactored utilities to match Mayank's files/structure

* remove run script

* more progress toward PR

* add readme

* improvements to analysis and README scripts

* reorganize the output directories to have RAFT vs OF subdirs

* OF updates

* update analysis options to bring the cases together

* some more case unification

* updated the analysis script

* update raft analysis script

* of opt updates and refactoring

* upenfast updates

* removed the weis connections to member ids as om design variables

* update openfast analysis

* updated raft analysis notebook

* improvements to analysis script, some for viz tool update

* update to remove remove load_OMsql_temp

* rename new example file

* updates to get parallel evolutionary methods to work

* Remove platform_elem_memid discrete input

* Add index back in

* Set PropPot only if floating

* viz tools fixed, now using safe yaml loading for problem_vars

* update analysis scripts for OF cases.

* updated OF cases for full ride.

* adjusting ex17 controls study for uniformity

* update with kestrel changes

* fixed output script slight break

* Tidy imports

* bring in line with the incoming WISDEM changes

* Add max_pitch_rate output to omdao_of

* updates from kestrel

* cory's changes from kestrel

* Write OpenFAST output to stdout as a modeling option

* Rename max_pitch_rate_sim

* Load rosco inputs earlier so we have sizes

* Get correct length from array control DVs

* docs for dan

* Fix length of _pc if not array

* Light revisions in optimization, detail platform design options

* Add optimization to index

* Draft some optimization results

* Add calculated channels

* Use calculated channels for pitch_rate, offset outputs

* Compute calculated channels when openfast library is used

* Use openmdao mpi

---------

Co-authored-by: Cory Frontin <[email protected]>

* prep for next release

---------

Co-authored-by: Mayank Chetan <[email protected]>
Co-authored-by: Cory Frontin <[email protected]>
Co-authored-by: sryu <[email protected]>
Co-authored-by: Sora Ryu <[email protected]>
Co-authored-by: Sora Ryu <[email protected]>
Co-authored-by: Sora Ryu <[email protected]>
Co-authored-by: Sora Ryu <[email protected]>
Co-authored-by: Pietro Bortolotti <[email protected]>
Co-authored-by: Sora Ryu <[email protected]>
Co-authored-by: Garrett Barter <[email protected]>
  • Loading branch information
11 people authored Nov 22, 2024
1 parent f24a213 commit 08517c7
Show file tree
Hide file tree
Showing 107 changed files with 22,879 additions and 13,950 deletions.
5 changes: 3 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "mambaforge-4.10"
python: "mambaforge-22.9"
jobs:
# Read the docs needs a couple packages not in the environment file
pre_install:
- conda install cmake compilers
- conda install -y cmake compilers sphinx sphinxcontrib-bibtex sphinx-jsonschema
- conda install sphinx_rtd_theme>=1.3


# Shouldn't need conda for building the docs, but it is an option
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ The installation instructions below use the environment name, "weis-env," but an

2. Add in final packages and install the software

conda install -y petsc4py mpi4py pyoptsparse # (Mac / Linux only)
conda install -y petsc4py mpi4py pyoptsparse # (Mac / Linux only, sometimes Windows users may need to install mpi4py)
pip install -e .

3. Instructions specific for DOE HPC system Eagle. Before executing the setup script, do:
Expand Down
65 changes: 65 additions & 0 deletions docs/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/* dl.class, dl.method, dl.attribute {
display: inline-block;
padding-top: 15px;
padding-bottom: 15px;
}
dl.class, dl.method, dl.attribute {
border-top: groove;
border-top-color: darkgrey;
} */

dl.class::before {
content: ' ';
width: auto;
display: block;
border-top: 4px solid black;
margin-top: 35px;
margin-left: -30px;
padding-bottom: 35px;
}

dl.method::before {
content: ' ';
width: auto;
display: block;
border-top: 1px solid black;
margin-top: 15px;
margin-left: -30px;
padding-bottom: 15px;
}

dl.function::before {
content: ' ';
width: auto;
display: block;
border-top: 1px solid black;
margin-top: 15px;
margin-left: -30px;
padding-bottom: 15px;
}

dl.attribute::before {
content: ' ';
width: auto;
display: block;
border-top: 1px solid black;
margin-top: 15px;
margin-left: -30px;
padding-bottom: 15px;
}


.wy-nav-content {
max-width: 1100px !important;
}

.wy-table-responsive td,
.wy-table-responsive th {
white-space: normal;
}

.wy-table-responsive table.word-wrap td,
.wy-table-responsive table.word-wrap th {
white-space: inherit;
}
3 changes: 3 additions & 0 deletions docs/_static/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
$(document).ready( function () {
$('table.datatable').DataTable();
} );
20 changes: 20 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
'sphinxcontrib.bibtex',
'sphinx.ext.intersphinx',
'sphinx_rtd_theme',
'sphinx-jsonschema',
# 'autoapi.extension',
# 'embed-n2',
]
Expand Down Expand Up @@ -106,3 +107,22 @@
'searchbox.html'
]
}

html_css_files = [
'https://cdn.datatables.net/1.10.23/css/jquery.dataTables.min.css',
"custom.css",
]

html_js_files = [
'https://cdn.datatables.net/1.10.23/js/jquery.dataTables.min.js',
'main.js',
]

# Bibtex configuration
bibtex_bibfiles = ["references.bib"]

jsonschema_options = {
'lift_title': True,
'lift_description': True,
'lift_definitions': True,
}
184 changes: 184 additions & 0 deletions docs/how_weis_viz_works.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
WEIS Visualization APP
=======================

Full-stack development for WEIS input/output visualization. This application provides a web-based graphical user interface to visualize input/output from WEIS. The app provides three types of output visualization - OpenFAST, Optimization with DLC Analysis, and WISDEM (blade, cost).

::

visualization
└──appServer
└──app/
├── assets/
├── mainApp.py
└── pages/
├── home.py
├── visualize_openfast.py
├── visualize_opt.py
├── visualize_wisdem_blade.py
└── visualize_wisdem_cost.py
└──share/
├── auto_launch_DashApp.sh
├── sbatch_DashApp.sh
└── vizFileGen.py
└──utils.py


Installation
------------

We offer two types of installation: (1) for users who wants to leverage HPC and (2) for users working on their local machines. The HPC set up is in steps 1--3. Users on local machines can skip to step 4. From our preliminary study, the app was able to successfully visualize the example optimization case which has around 430GB of information included.

Set up on HPC
~~~~~~~~~~~~~
1. Get an interactive node

.. code-block:: console
salloc --time=60:00 --account=weis --partition=debug
2. Go to preferred directory

.. code-block:: console
cd WEIS-Demo
3. Install WEIS and dependencies

We created a bash script which installs all of the related libraries with a single command. We recommend downloading that file first and then running the script.

.. code-block:: console
wget https://raw.githubusercontent.com/WISDEM/WEIS/main/share/kestrel_install.sh -O kestrel_install.sh
bash kestrel_install.sh -p [conda_env_path] -raft -wisdem
# For example: bash kestrel_install.sh -p env/weis-env -raft -wisdem
The whole installation process might take around 20 mins. Please check if the installation of weis, conda virtual environment, openfast, rosco, wisdem and raft are successful.

4. Generate visualization input yaml file

.. code-block:: console
module load conda
conda activate env/weis-env
(.weis-env) $ cd weis/weis/visualization/appServer/share/
(.weis-env) $ python vizFileGen.py --modeling_options [path_to_modeling_options] --analysis_options [path_to_analysis_options] --wt_input [path_to_final_wind_io] --output vizInput.yaml
Note that you can use the modeling and analysis options generated within the output folder of the WEIS run.

5. Run the server

.. code-block:: console
cd ../app
(.weis-env) $ python mainApp.py --input [path_to_viz_input] --host [host_number] --port [port_number]
Now, you are able to see the hosting url with defined port number where your app server is running.

6. Connect the app with local machine

After finishing the set up from the hpc, open a new terminal from your local machine and run:

.. code-block:: console
ssh -L [port_number]:[host_name from \#1]:[port_number] kl1.hpc.nrel.gov
# For example, if you have not assigned specific port number to app: ssh -L 8050:[host_name from \#1]:8050 kl1.hpc.nrel.gov
Open a web browser, preferably Safari or Chrome, and go to the hosting url that shows from step \#5.


Set up on Local Machine
~~~~~~~~~~~~~~~~~~~~~~~

1. Go to preferred directory

.. code-block:: console
cd WEIS-Demo
2. Install WEIS and dependencies

Please use the installation instructions here: https://github.com/WISDEM/WEIS

3. Generate visualization input yaml file

.. code-block:: console
module load conda
conda activate env/weis-env
(.weis-env) $ cd weis/weis/visualization/appServer/share/
(.weis-env) $ python vizFileGen.py --modeling_options [path_to_modeling_options] --analysis_options [path_to_analysis_options] --wt_input [path_to_final_wind_io] --output vizInput.yaml
Note that you can use the modeling and analysis options generated within the output folder of the WEIS run.

4. Run the server

.. code-block:: console
cd ../app
(.weis-env) $ python mainApp.py --input [path_to_viz_input] --host [host_number] --port [port_number]
Now, you are able to see the hosting url with defined port number where your app server is running. Open a web browser, preferably Safari or Chrome, and enter the hosting url to start.



Results
------------

All of the graphical objects has been generated via Plotly library, which it easy to interact, zoom, and download the plots. The selected channels should be saved between runs, which help users to resume their previous work. Channels from the OpenFAST page will be saved once save button has been clicked.

OpenFAST
~~~~~~~~
Read OpenFAST related variables from the input yaml file, including OpenFAST output file paths and graph x,y axis settings, and visualize the graphs based on them. Note that we allow maximum 5 files to visualize and please keep 5 rows. If you have only three files to visualize, keep file4 and file5 values as 'None' and don't delete them. We recommend the file paths to be absolute path.

.. image:: images/viz/openfast_yaml.png

.. image:: images/viz/OpenFAST.pdf


Optimization
~~~~~~~~~~~~


OpenFAST optimization
*********************

First, we need to check if the optimization type is correct. For OpenFAST Optimization, please check if status is true and type is 3 from the userOptions/optimization. Then, we read design constraints and variables from userPreferences/optimization.

.. image:: images/viz/of_opt_yaml.png

.. image:: images/viz/Optimize2_1.pdf

.. image:: images/viz/Optimize2_2.pdf

Optimization convergence trend data will be first shown on the left layout from the analyzed log_opt.sql file. Then, user can click on a specific iteration, and then the corresponding DLC visualization will be shown on the right. The specific OpenFAST time-series plots can be visualized as well via clicking specific data points.


RAFT optimization
*****************

First, we need to check if the optimization type is correct. For RAFT Optimization, please check if status is true and type is 1 from the userOptions/optimization. Then, we read platform design variables from userPreferences/optimization/convergence/channels.

.. image:: images/viz/raft_opt_yaml.png

.. image:: images/viz/Optimize1.pdf

Once clicking specific iteration, the corresponding 3D platform design plot appears from the right layout.



WISDEM - Blade
~~~~~~~~~~~~~~
Read blade related properties and WISDEM output file path from the input yaml file, and visualize the relevant information.

.. image:: images/viz/wisdem_yaml.png

.. image:: images/viz/WISDEM-Blade.pdf



WISDEM - Cost
~~~~~~~~~~~~~
Cost-related variables are an output of WISDEM and WEIS. The tool reads the WISDEM output file path from the input yaml file, and visualizes the cost-breakdown. Note that cost calculation is based on NREL CSM model (https://wisdem.readthedocs.io/en/master/wisdem/nrelcsm/theory.html#blades).

.. image:: images/viz/WISDEM-Cost.pdf
1 change: 1 addition & 0 deletions docs/how_weis_works.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ WEIS works best by running `examples <https://github.com/WISDEM/WEIS/tree/master
* `05_IEA-3.4-130-RWT <https://github.com/WISDEM/WEIS/tree/master/examples/05_IEA-3.4-130-RWT>`_ runs the design load cases (DLCs) for the fixed-bottom IEA-3.4 turbine
* `06_IEA-15-240-RWT <https://github.com/WISDEM/WEIS/tree/master/examples/06_IEA-15-240-RWT>`_ contains several examples for running the IEA-15MW with the VolturnUS platform, including tower and structural controller optimization routines
* `15_RAFT_Studies <https://github.com/WISDEM/WEIS/tree/master/examples/15_RAFT_Studies>`_ contains an example for optimizing a the IEA-15MW with the VolturnUS platform in RAFT

More documentation specific to these examples can be found there, with more to follow.

This documentation only covers a summary of WEIS's functionality. WEIS can be adapted to solve a wide variety of problems. If you have questions or would like to discuss WEIS's functionality further, please email dzalkind (at) nrel (dot) gov.
Expand Down
Binary file added docs/images/viz/OpenFAST.pdf
Binary file not shown.
Binary file added docs/images/viz/Optimize1.pdf
Binary file not shown.
Binary file added docs/images/viz/Optimize2_1.pdf
Binary file not shown.
Binary file added docs/images/viz/Optimize2_2.pdf
Binary file not shown.
Binary file added docs/images/viz/WISDEM-Blade.pdf
Binary file not shown.
Binary file added docs/images/viz/WISDEM-Cost.pdf
Binary file not shown.
Binary file added docs/images/viz/of_opt_yaml.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/viz/openfast_yaml.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/viz/raft_opt_yaml.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/viz/wisdem_yaml.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 20 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,27 @@ Using WEIS

installation
how_weis_works
inputs/yaml_inputs



WEIS Visualization APP
======================

.. toctree::
:maxdepth: 2

how_weis_viz_works


Optimization in WEIS
====================

.. toctree::
:maxdepth: 2

optimization


Other Useful Docs
=================

Expand Down
Loading

0 comments on commit 08517c7

Please sign in to comment.