Skip to content

Commit

Permalink
Debug arg parsing error while launching the app & Contribute Initial …
Browse files Browse the repository at this point in the history
…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 <Sora.Ryu@nrel.gov>
Co-authored-by: dzalkind <dzalkind@nrel.gov>
  • Loading branch information
3 people authored Sep 4, 2024
1 parent f45aede commit b651a8c
Show file tree
Hide file tree
Showing 30 changed files with 237 additions and 174 deletions.
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
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.
11 changes: 10 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,16 @@ Using WEIS
installation
how_weis_works



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

.. toctree::
:maxdepth: 2

how_weis_viz_works


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

Expand Down
128 changes: 0 additions & 128 deletions weis/visualization/appServer/README.md

This file was deleted.

Loading

0 comments on commit b651a8c

Please sign in to comment.