Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • toolbox/WindEnergyToolbox
  • tlbl/WindEnergyToolbox
  • cpav/WindEnergyToolbox
  • frza/WindEnergyToolbox
  • borg/WindEnergyToolbox
  • mmpe/WindEnergyToolbox
  • ozgo/WindEnergyToolbox
  • dave/WindEnergyToolbox
  • mmir/WindEnergyToolbox
  • wluo/WindEnergyToolbox
  • welad/WindEnergyToolbox
  • chpav/WindEnergyToolbox
  • rink/WindEnergyToolbox
  • shfe/WindEnergyToolbox
  • shfe1/WindEnergyToolbox
  • acdi/WindEnergyToolbox
  • angl/WindEnergyToolbox
  • wliang/WindEnergyToolbox
  • mimc/WindEnergyToolbox
  • wtlib/WindEnergyToolbox
  • cmos/WindEnergyToolbox
  • fabpi/WindEnergyToolbox
22 results
Show changes
Commits on Source (772)
Showing with 439 additions and 851 deletions
*.bin filter=lfs diff=lfs merge=lfs -text
......@@ -18,5 +18,15 @@ wetb/hawc2/tests/test_files/htcfiles/tmp.htc
wetb/hawc2/ascii2bin/tests/test_files/Hawc2ascii_bin.sel
wetb/hawc2/ascii2bin/tests/test_files/Hawc2ascii_bin.dat
wetb/prepost/tests/data/demo_dlc/remote*
wetb/*/*/*.c
.cache/
tests/temp.htc
**/tmp/*
/wetb/fatigue_tools/rainflowcounting/compile.py
/docs/api
/htmlcov
/docs/build
/docs/source_old
.ipynb_checkpoints
/.pytest_cache/
before_script:
- apt-get update
image: dtuwindenergy/wetb
test-3.4:
image: mmpe/wetb
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
when: never
- when: always
test:
image: continuumio/anaconda3:latest
stage:
test
# except:
# - test_pypi
variables:
GIT_SUBMODULE_STRATEGY: recursive
before_script:
#- git submodule sync --recursive
#- git submodule update --init --recursive
- python -m pip install .[all]
script:
- python3 -m pytest --cov-report term-missing:skip-covered --cov-report xml:coverage.xml --cov=wetb
tags:
- docker, linux, shared
coverage: /(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml
# ===== build documentation =====
pages: # "pages" is a job specifically for GitLab pages [1]
stage: # build, test, deploy defined by default [2]
deploy
image: registry.windenergy.dtu.dk/hawc2/hawc2-binary/dockerimages/ubuntu_conda
script: # use sphinx to build docs, move to public page
- pip install --upgrade pip
- pip install sphinx --upgrade
- pip install sphinx sphinx_rtd_theme
- pip install nbsphinx==0.3.5
- pip install git+https://github.com/vidartf/nbsphinx-link.git
- pip install -e .
- cd docs; make html
- cd ../; mv docs/build/html public/
artifacts: # required for GitLab pages [1]
paths:
- public
only: # only run for these branches
- master
- /^test_doc.*/
tags: # only runners with this tag can do the job [3]
- python
allow_failure: true
# Deploy package to local repository
upload_package_local:
image: continuumio/anaconda3:latest
tags:
- docker, linux, shared
stage: deploy
needs:
- job: build_wheel
artifacts: true
- job: test
artifacts: false
script:
- pip install --upgrade twine packaging
- TWINE_PASSWORD=${CI_JOB_TOKEN} TWINE_USERNAME=gitlab-ci-token python -m twine upload --verbose --repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi dist/*
rules:
- if: $CI_COMMIT_TAG != null
when: always
- if: $CI_COMMIT_BRANCH == "master"
when: always
- if: $CI_COMMIT_BRANCH != "master"
when: manual
allow_failure: true
# ===== BUILD WHEELS AND UPLOAD TO PYPI =====
upload_package_pypi:
image: continuumio/anaconda3:latest
tags:
- docker, linux, shared
stage: deploy
needs:
- job: build_wheel
artifacts: true
- job: test
artifacts: false
script:
- pip install --upgrade twine packaging
- twine upload dist/* -u $TWINE_USERNAME -p $TWINE_PASSWORD
only:
- tags
- test_pypi
build_wheel:
stage: build
tags:
- linux, docker, shared
image: registry.windenergy.dtu.dk/hawc2/hawc2-binary/dockerimages/ubuntu_conda
before_script:
- git config --global --add safe.directory ${CI_PROJECT_DIR}
script:
#- python3 setup.py test
- python3 -m pytest --cov=wetb
- pip wheel . --wheel-dir=dist
artifacts:
paths:
- dist/wetb*.whl
expire_in: "1d"
[submodule "TestFiles"]
path = TestFiles
url = https://gitlab.windenergy.dtu.dk/toolbox/TestFiles.git
[distutils]
index-servers=
pypi
#testpypi # include this line for testing
[testpypi]
#repository: https://test.pypi.org/legacy/ # use this line when testing
repository: https://upload.pypi.org/legacy/
username: DTUWindEnergy
Contributions
-------------
If you make a change in the toolbox, that others can benefit from please make a merge request.
If you can, please submit a merge request with the fix or improvements including tests.
The workflow to make a merge request is as follows:
-Create a feature branch, branch away from master
-Write tests and code
-Push the commit(s) to your fork
-Submit a merge request (MR) to the master branch of
-Link any relevant issues in the merge request description and leave a comment on them with a link back to the MR
-Your tests should run as fast as possible, and if it uses test files, these files should be as small as possible.
-Please keep the change in a single MR as small as possible. Split the functionality if you can
\ No newline at end of file
|build status| |coverage report|
[![build status](https://gitlab.windenergy.dtu.dk/toolbox/WindEnergyToolbox/badges/master/build.svg)](https://gitlab.windenergy.dtu.dk/toolbox/WindEnergyToolbox/commits/master)
[![coverage report](https://gitlab.windenergy.dtu.dk/toolbox/WindEnergyToolbox/badges/master/coverage.svg)](https://gitlab.windenergy.dtu.dk/toolbox/WindEnergyToolbox/commits/master)
Introduction
============
# Introduction
The Wind Energy Toolbox (or ``wetb``, pronounce as wee-tee-bee) is a
collection of Python scripts that facilitate working with (potentially a
lot) of HAWC2, HAWCStab2, FAST or other text input based simulation
tools.
The Wind Energy Toolbox (or ```wetb```, pronounce as wee-tee-bee) is a collection
of Python scripts that facilitate working with (potentially a lot) of HAWC2,
HAWCStab2, FAST or other text input based simulation tools.
Note that this toolbox is very much a WIP (work in progress). For example,
some of the functions in the [prepost](#prepost) module have a similar functions
in [Hawc2io](wetb/hawc2/Hawc2io.py). These different implementations will be
merged in due time.
Note that this toolbox is very much a WIP (work in progress). For
example, some of the functions in the `prepost <#prepost>`__ module have
a similar functions in `Hawc2io <wetb/hawc2/Hawc2io.py>`__. These
different implementations will be merged in due time.
Both Python2 and Python3 are supported.
# Installation
For a more detailed overview, see: [docs/install](docs/install.md)
# Contents of WindEnergyToolbox, [wetb](wetb)
### Overview
- [hawc2](#hawc2)
- [gtsdf](#gtsdf)
- [fatigue_tools](#fatigue_tools)
- [wind](#wind)
- [dlc](#dlc)
- [prepost](#prepost)
- [fast](#fast)
- [utils](#utils)
### [hawc2](wetb/hawc2)
- [Hawc2io](wetb/hawc2/Hawc2io.py): Read binary, ascii and flex result files
- [sel_file](wetb/hawc2/sel_file.py): Read/write *.sel (sensor list) files
- [htc_file](wetb/hawc2/htc_file.py): Read/write/manipulate htc files
- [ae_file](wetb/hawc2/ae_file.py): Read AE (aerodynamic blade layout) files
- [pc_file](wetb/hawc2/pc_file.py): Read PC (profile coefficient) files
- [shear_file](wetb/hawc2/shear_file.py): Create user defined shear file
- [at_time_file](wetb/hawc2/at_time_file.py): Read at output_at_time files
- [log_file](wetb/hawc2/log_file.py): Read and interpret log files
- [ascii2bin](wetb/hawc2/ascii2bin): Compress HAWC2 ascii result files to binary
### [gtsdf](wetb/gtsdf)
General Time Series Data Format, a binary hdf5 data format for storing time series data.
- [gtsdf](wetb/gtsdf/gtsdf.py): read/write/append gtsdf files
- [unix_time](wetb/gtsdf/unix_time.py): convert between datetime and unix time (seconds since 1/1/1970)
### [fatigue_tools](wetb/fatigue_tools)
- [fatigue](wetb/fatigue_tools/fatigue.py): Rainflow counting, cycle matrix and equivalent loads
- [bearing_damage](wetb/fatigue_tools/bearing_damage.py): Calculate a comparable measure of bearing damage
### [wind](wetb/wind)
- [shear](wetb/wind/shear.py): Calculate and fit wind shear
### [dlc](wetb/dlc)
Module for working with "Design load cases" (Code independent)
- [high_level](wetb/dlc/high_level.py) Class for working with the highlevel dlc excell sheet
### [prepost](wetb/prepost)
Module for creating an arbitrary number of HAWC2 simulations, and optionally
corresponding execution scripts for a PBS Torque cluster (Linux), simple bash
(Linux), or Windows batch scripts. A post-processing module is also included
that calculates statistical parameters, performs rainflow counting for fatigue
load calculations, and create load envelopes.
Installation
============
- `Simple user <docs/install.md>`__
- `Developer/contributor <docs/developer-guide.md>`__
Contents of WindEnergyToolbox, `wetb <wetb>`__
==============================================
Overview
~~~~~~~~
- `hawc2 <#hawc2>`__
- `gtsdf <#gtsdf>`__
- `fatigue\_tools <#fatigue_tools>`__
- `wind <#wind>`__
- `dlc <#dlc>`__
- `prepost <#prepost>`__
- `fast <#fast>`__
- `utils <#utils>`__
`hawc2 <wetb/hawc2>`__
~~~~~~~~~~~~~~~~~~~~~~
- `Hawc2io <wetb/hawc2/Hawc2io.py>`__: Read binary, ascii and flex
result files
- `sel\_file <wetb/hawc2/sel_file.py>`__: Read/write \*.sel (sensor
list) files
- `htc\_file <wetb/hawc2/htc_file.py>`__: Read/write/manipulate htc
files
- `ae\_file <wetb/hawc2/ae_file.py>`__: Read AE (aerodynamic blade
layout) files
- `pc\_file <wetb/hawc2/pc_file.py>`__: Read PC (profile coefficient)
files
- `st\_file <wetb/hawc2/st_file.py>`__: Read ST (structural properties)
files
- `shear\_file <wetb/hawc2/shear_file.py>`__: Create user defined shear
file
- `at\_time\_file <wetb/hawc2/at_time_file.py>`__: Read at
output\_at\_time files
- `log\_file <wetb/hawc2/log_file.py>`__: Read and interpret log files
- `ascii2bin <wetb/hawc2/ascii2bin>`__: Compress HAWC2 ascii result
files to binary
`gtsdf <wetb/gtsdf>`__
~~~~~~~~~~~~~~~~~~~~~~
General Time Series Data Format, a binary hdf5 data format for storing
time series data. - `gtsdf <wetb/gtsdf/gtsdf.py>`__: read/write/append
gtsdf files - `unix\_time <wetb/gtsdf/unix_time.py>`__: convert between
datetime and unix time (seconds since 1/1/1970)
`fatigue\_tools <wetb/fatigue_tools>`__
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- `fatigue <wetb/fatigue_tools/fatigue.py>`__: Rainflow counting, cycle
matrix and equivalent loads
- `bearing\_damage <wetb/fatigue_tools/bearing_damage.py>`__: Calculate
a comparable measure of bearing damage
`wind <wetb/wind>`__
~~~~~~~~~~~~~~~~~~~~
- `shear <wetb/wind/shear.py>`__: Calculate and fit wind shear
`dlc <wetb/dlc>`__
~~~~~~~~~~~~~~~~~~
Module for working with "Design load cases" (Code independent) -
`high\_level <wetb/dlc/high_level.py>`__ Class for working with the
highlevel dlc excell sheet
`prepost <wetb/prepost>`__
~~~~~~~~~~~~~~~~~~~~~~~~~~
Module for creating an arbitrary number of HAWC2 simulations, and
optionally corresponding execution scripts for a PBS Torque cluster
(Linux), simple bash (Linux), or Windows batch scripts. A
post-processing module is also included that calculates statistical
parameters, performs rainflow counting for fatigue load calculations,
and create load envelopes.
Additional documentation can be found here:
- [Auto-generation of Design Load Cases](docs/howto-make-dlcs.md)
- [How to use the Statistics DataFrame](docs/using-statistics-df.md)
- [Generate DLB spreadsheets](docs/generate-spreadsheet.md)
### [fast](wetb/fast)
Tools for working with NREL's FAST code (An aeroelastic computer-aided engineering (CAE) tool for horizontal axis wind turbines)
- [fast_io](wetb/fast/fast_io.py): Read binary and ascii result files
### [utils](wetb/utils)
Other functions
- [geometry](wetb/utils/geometry.py): Different kind of geometry conversion functions
- [process_exec](wetb/utils/process_exec.py): Run system command in subprocess
- [timing](wetb/utils/timing.py): Decorators for evaluating execution time of functions
- [caching](wetb/utils/caching.py): Decorators to create cached (calculate once) functions and properties
- `Getting started with DLBs <docs/getting-started-with-dlbs.md>`__
- `Generate DLB spreadsheets <docs/generate-spreadsheet.md>`__
- `Auto-generation of Design Load Cases <docs/howto-make-dlcs.md>`__
- `House rules for storing results on
``mimer/hawc2sim`` <docs/houserules-mimerhawc2sim.md>`__
- `How to use the Statistics
DataFrame <docs/using-statistics-df.md>`__
`fast <wetb/fast>`__
~~~~~~~~~~~~~~~~~~~~
Tools for working with NREL's FAST code (An aeroelastic computer-aided
engineering (CAE) tool for horizontal axis wind turbines) -
`fast\_io <wetb/fast/fast_io.py>`__: Read binary and ascii result files
`utils <wetb/utils>`__
~~~~~~~~~~~~~~~~~~~~~~
Other functions - `geometry <wetb/utils/geometry.py>`__: Different kind
of geometry conversion functions -
`process\_exec <wetb/utils/process_exec.py>`__: Run system command in
subprocess - `timing <wetb/utils/timing.py>`__: Decorators for
evaluating execution time of functions -
`caching <wetb/utils/caching.py>`__: Decorators to create cached
(calculate once) functions and properties
.. |build status| image:: https://gitlab.windenergy.dtu.dk/toolbox/WindEnergyToolbox/badges/master/build.svg
:target: https://gitlab.windenergy.dtu.dk/toolbox/WindEnergyToolbox/commits/master
.. |coverage report| image:: https://gitlab.windenergy.dtu.dk/toolbox/WindEnergyToolbox/badges/master/coverage.svg
:target: https://gitlab.windenergy.dtu.dk/toolbox/WindEnergyToolbox/commits/master
[![build status](https://gitlab.windenergy.dtu.dk/toolbox/WindEnergyToolbox/badges/master/build.svg)](https://gitlab.windenergy.dtu.dk/toolbox/WindEnergyToolbox/commits/master)
[![coverage report](https://gitlab.windenergy.dtu.dk/toolbox/WindEnergyToolbox/badges/master/coverage.svg)](https://gitlab.windenergy.dtu.dk/toolbox/WindEnergyToolbox/commits/master)
[![pypi status](https://img.shields.io/pypi/v/wetb.png)](https://pypi.python.org/pypi/wetb)
# Introduction
......@@ -17,7 +18,11 @@ Both Python2 and Python3 are supported.
# Installation
For a more detailed overview, see: [docs/install](docs/install.md)
See documentation.
# Documentation
[https://toolbox.pages.windenergy.dtu.dk/WindEnergyToolbox/](https://toolbox.pages.windenergy.dtu.dk/WindEnergyToolbox/)
# Contents of WindEnergyToolbox, [wetb](wetb)
......@@ -37,8 +42,9 @@ For a more detailed overview, see: [docs/install](docs/install.md)
- [Hawc2io](wetb/hawc2/Hawc2io.py): Read binary, ascii and flex result files
- [sel_file](wetb/hawc2/sel_file.py): Read/write *.sel (sensor list) files
- [htc_file](wetb/hawc2/htc_file.py): Read/write/manipulate htc files
- [ae_file](wetb/hawc2/ae_file.py): Read AE (aerodynamic blade layout) files
- [pc_file](wetb/hawc2/pc_file.py): Read PC (profile coefficient) files
- [ae_file](wetb/hawc2/ae_file.py): Read/write/manipulate AE (aerodynamic blade layout) files
- [pc_file](wetb/hawc2/pc_file.py): Read/write/manipulate PC (profile coefficient) files
- [st_file](wetb/hawc2/st_file.py): Read/write/manipulate ST (structural properties) files
- [shear_file](wetb/hawc2/shear_file.py): Create user defined shear file
- [at_time_file](wetb/hawc2/at_time_file.py): Read at output_at_time files
- [log_file](wetb/hawc2/log_file.py): Read and interpret log files
......@@ -69,10 +75,11 @@ load calculations, and create load envelopes.
Additional documentation can be found here:
- [Auto-generation of Design Load Cases](docs/howto-make-dlcs.md)
- [How to use the Statistics DataFrame](docs/using-statistics-df.md)
- [Generate DLB spreadsheets](docs/generate-spreadsheet.md)
- [Getting started with DLBs](docs/getting-started-with-dlbs.md)
- [Generate DLB spreadsheets](docs/generate-spreadsheet.md)
- [Auto-generation of Design Load Cases](docs/howto-make-dlcs.md)
- [House rules for storing results on ```mimer/hawc2sim```](docs/houserules-mimerhawc2sim.md)
- [How to use the Statistics DataFrame](docs/using-statistics-df.md)
### [fast](wetb/fast)
Tools for working with NREL's FAST code (An aeroelastic computer-aided engineering (CAE) tool for horizontal axis wind turbines)
......
Subproject commit 167b16d8f1a26161ebc5a258c62389777d133489
FROM continuumio/anaconda3:latest
MAINTAINER Mikkel Friis-Møller <mikf@dtu.dk>
RUN apt-get update && \
apt-get install make && \
apt-get install libgl1-mesa-glx -y && \
apt-get install gcc gfortran -y
RUN conda update -y conda && \
conda install -y sphinx_rtd_theme && \
conda install setuptools_scm mock h5py pytables pytest pytest-cov nose sphinx blosc pbr paramiko && \
conda install scipy pandas matplotlib cython xlrd coverage xlwt openpyxl psutil pandoc twine pypandoc && \
conda install -c conda-forge pyscaffold sshtunnel --no-deps && \
conda clean -y --all
RUN pip install --upgrade pip && \
pip install --no-cache-dir git+https://gitlab.windenergy.dtu.dk/toolbox/WindEnergyToolbox.git
# build image
docker build -t dtuwindenergy/wetb ./
# or pull from docker hub
# create container
docker create -it --name wetb dtuwindenergy/wetb
# start container
docker start wetb
# enter container with bash prompt
docker exec -it wetb bash
# push
docker push dtuwindenergy/wetb
#checkout single branch for testing:
git clone --single-branch --branch test_pypi https://gitlab.windenergy.dtu.dk/toolbox/WindEnergyToolbox.git
#Copy local folder into docker container:
docker cp "C:\Sandbox\Git\WindEnergyToolbox\." wetb:/WETB/
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>C:\mmpe\programming\python\WindEnergyToolbox\docs\.developer-guide.md.html</title>
<style type="text/css">
body {
color: #333;
font: 13px/1.4 "Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif;
padding: 0;
margin: 0;
}
a {
background: transparent;
color: #4183c4;
text-decoration: none;
}
a:active,
a:hover {
outline: 0 none;
text-decoration: underline;
}
abbr[title] {
border-bottom: 1px dotted;
}
b,
strong {
font-weight: bold;
}
dfn {
font-style: italic;
}
h1 {
font-size: 2em;
margin: 0.67em 0;
}
mark {
background: #ff0;
color: #000;
}
small {
font-size: 80%;
}
sub, sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
img {
border: 0 none;
}
svg:not(:root) {
overflow: hidden;
}
figure {
margin: 1em 40px;
}
hr {
box-sizing: content-box;
height: 0;
}
code,
kbd,
pre,
samp {
font-family: monospace,monospace;
font-size: 1em;
}
pre {
overflow: auto;
font: 12px Consolas,"Liberation Mono",Menlo,Courier,monospace;
margin-bottom: 0;
margin-top: 0;
}
.markdown-body {
padding: 30px;
font-size: 16px;
line-height: 1.6;
word-wrap: break-word;
}
.markdown-body>*:first-child {
margin-top: 0 !important;
}
.markdown-body>*:last-child {
margin-bottom: 0 !important;
}
.markdown-body .absent {
color: #c00;
}
.markdown-body .anchor {
position: absolute;
top: 0;
bottom: 0;
left: 0;
display: block;
padding-right: 6px;
padding-left: 30px;
margin-left: -30px;
}
.markdown-body .anchor:focus {
outline: none;
}
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
position: relative;
margin-top: 1em;
margin-bottom: 16px;
font-weight: bold;
line-height: 1.4;
}
.markdown-body h1 .octicon-link,
.markdown-body h2 .octicon-link,
.markdown-body h3 .octicon-link,
.markdown-body h4 .octicon-link,
.markdown-body h5 .octicon-link,
.markdown-body h6 .octicon-link {
display: none;
color: #000;
vertical-align: middle;
}
.markdown-body h1:hover .anchor,
.markdown-body h2:hover .anchor,
.markdown-body h3:hover .anchor,
.markdown-body h4:hover .anchor,
.markdown-body h5:hover .anchor,
.markdown-body h6:hover .anchor {
padding-left: 8px;
margin-left: -30px;
line-height: 1;
text-decoration: none;
}
.markdown-body h1:hover .anchor .octicon-link,
.markdown-body h2:hover .anchor .octicon-link,
.markdown-body h3:hover .anchor .octicon-link,
.markdown-body h4:hover .anchor .octicon-link,
.markdown-body h5:hover .anchor .octicon-link,
.markdown-body h6:hover .anchor .octicon-link {
display: inline-block;
}
.markdown-body h1 tt,
.markdown-body h1 code,
.markdown-body h2 tt,
.markdown-body h2 code,
.markdown-body h3 tt,
.markdown-body h3 code,
.markdown-body h4 tt,
.markdown-body h4 code,
.markdown-body h5 tt,
.markdown-body h5 code,
.markdown-body h6 tt,
.markdown-body h6 code {
font-size: inherit;
}
.markdown-body h1 {
padding-bottom: 0.3em;
font-size: 2.25em;
line-height: 1.2;
border-bottom: 1px solid #eee;
}
.markdown-body h2 {
padding-bottom: 0.3em;
font-size: 1.75em;
line-height: 1.225;
border-bottom: 1px solid #eee;
}
.markdown-body h3 {
font-size: 1.5em;
line-height: 1.43;
}
.markdown-body h4 {
font-size: 1.25em;
}
.markdown-body h5 {
font-size: 1em;
}
.markdown-body h6 {
font-size: 1em;
color: #777;
}
.markdown-body p,.markdown-body blockquote,
.markdown-body ul,.markdown-body ol,
.markdown-body dl,.markdown-body table,
.markdown-body pre {
margin-top: 0;
margin-bottom: 16px;
}
.markdown-body hr {
height: 4px;
padding: 0;
margin: 16px 0;
background-color: #e7e7e7;
border: 0 none;
}
.markdown-body ul,
.markdown-body ol {
padding-left: 2em;
}
.markdown-body ul.no-list,
.markdown-body ol.no-list {
padding: 0;
list-style-type: none;
}
.markdown-body ul ul,
.markdown-body ul ol,
.markdown-body ol ol,
.markdown-body ol ul {
margin-top: 0;
margin-bottom: 0;
}
.markdown-body li>p {
margin-top: 16px;
}
.markdown-body dl {
padding: 0;
}
.markdown-body dl dt {
padding: 0;
margin-top: 16px;
font-size: 1em;
font-style: italic;
font-weight: bold;
}
.markdown-body dl dd {
padding: 0 16px;
margin-bottom: 16px;
}
.markdown-body blockquote {
padding: 0 15px;
color: #777;
border-left: 4px solid #ddd;
}
.markdown-body blockquote>:first-child {
margin-top: 0;
}
.markdown-body blockquote>:last-child {
margin-bottom: 0;
}
.markdown-body table {
display: block;
width: 100%;
overflow: auto;
word-break: normal;
word-break: keep-all;
}
.markdown-body table th {
font-weight: bold;
}
.markdown-body table th,
.markdown-body table td {
padding: 6px 13px;
border: 1px solid #ddd;
}
.markdown-body table tr {
background-color: #fff;
border-top: 1px solid #ccc;
}
.markdown-body table tr:nth-child(2n) {
background-color: #f8f8f8;
}
.markdown-body img {
max-width: 100%;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.markdown-body span.frame {
display: block;
overflow: hidden;
}
.markdown-body span.frame>span {
display: block;
float: left;
width: auto;
padding: 7px;
margin: 13px 0 0;
overflow: hidden;
border: 1px solid #ddd;
}
.markdown-body span.frame span img {
display: block;
float: left;
}
.markdown-body span.frame span span {
display: block;
padding: 5px 0 0;
clear: both;
color: #333;
}
.markdown-body span.align-center {
display: block;
overflow: hidden;
clear: both;
}
.markdown-body span.align-center>span {
display: block;
margin: 13px auto 0;
overflow: hidden;
text-align: center;
}
.markdown-body span.align-center span img {
margin: 0 auto;
text-align: center;
}
.markdown-body span.align-right {
display: block;
overflow: hidden;
clear: both;
}
.markdown-body span.align-right>span {
display: block;
margin: 13px 0 0;
overflow: hidden;
text-align: right;
}
.markdown-body span.align-right span img {
margin: 0;
text-align: right;
}
.markdown-body span.float-left {
display: block;
float: left;
margin-right: 13px;
overflow: hidden;
}
.markdown-body span.float-left span {
margin: 13px 0 0;
}
.markdown-body span.float-right {
display: block;
float: right;
margin-left: 13px;
overflow: hidden;
}
.markdown-body span.float-right>span {
display: block;
margin: 13px auto 0;
overflow: hidden;
text-align: right;
}
.markdown-body code,.markdown-body tt {
padding: 0;
padding-top: 0.2em;
padding-bottom: 0.2em;
margin: 0;
font-size: 85%;
background-color: rgba(0,0,0,0.04);
border-radius: 3px;
}
.markdown-body code:before,
.markdown-body code:after,
.markdown-body tt:before,
.markdown-body tt:after {
letter-spacing: -0.2em;
content: "\00a0";
}
.markdown-body code br,
.markdown-body tt br {
display: none;
}
.markdown-body del code {
text-decoration: inherit;
}
.markdown-body pre>code {
padding: 0;
margin: 0;
font-size: 100%;
word-break: normal;
white-space: pre;
background: transparent;
border: 0;
}
.markdown-body .highlight {
margin-bottom: 16px;
}
.markdown-body .highlight pre,
.markdown-body pre {
padding: 16px;
overflow: auto;
font-size: 85%;
line-height: 1.45;
background-color: #f7f7f7;
border-radius: 3px;
}
.markdown-body .highlight pre {
margin-bottom: 0;
word-break: normal;
}
.markdown-body pre {
word-wrap: normal;
}
.markdown-body pre code,
.markdown-body pre tt {
display: inline;
max-width: initial;
padding: 0;
margin: 0;
overflow: initial;
line-height: inherit;
word-wrap: normal;
background-color: transparent;
border: 0;
}
.markdown-body pre code:before,
.markdown-body pre code:after,
.markdown-body pre tt:before,
.markdown-body pre tt:after {
content: normal;
}
.highlight .pl-coc,
.highlight .pl-entl,
.highlight .pl-entm,
.highlight .pl-eoa,
.highlight .pl-mai .pl-sf,
.highlight .pl-mm,
.highlight .pl-pdv,
.highlight .pl-sc,
.highlight .pl-som,
.highlight .pl-sr,
.highlight .pl-v,
.highlight .pl-vpf {
color: #0086b3;
}
.highlight .pl-eoac,
.highlight .pl-mdht,
.highlight .pl-mi1,
.highlight .pl-mri,
.highlight .pl-va,
.highlight .pl-vpu {
color: #008080;
}
.highlight .pl-c,
.highlight .pl-pdc {
color: #b4b7b4;
font-style: italic;
}
.highlight .pl-k,
.highlight .pl-ko,
.highlight .pl-kolp,
.highlight .pl-mc,
.highlight .pl-mr,
.highlight .pl-ms,
.highlight .pl-s,
.highlight .pl-sok,
.highlight .pl-st {
color: #6e5494;
}
.highlight .pl-ef,
.highlight .pl-enf,
.highlight .pl-enm,
.highlight .pl-entc,
.highlight .pl-eoi,
.highlight .pl-sf,
.highlight .pl-smc {
color: #d12089;
}
.highlight .pl-ens,
.highlight .pl-eoai,
.highlight .pl-kos,
.highlight .pl-mh .pl-pdh,
.highlight .pl-mp,
.highlight .pl-pde,
.highlight .pl-stp {
color: #458;
}
.highlight .pl-enti {
color: #d12089;
font-weight: bold;
}
.highlight .pl-cce,
.highlight .pl-enc,
.highlight .pl-kou,
.highlight .pl-mq {
color: #f93;
}
.highlight .pl-mp1 .pl-sf {
color: #458;
font-weight: bold;
}
.highlight .pl-cos,
.highlight .pl-ent,
.highlight .pl-md,
.highlight .pl-mdhf,
.highlight .pl-ml,
.highlight .pl-pdc1,
.highlight .pl-pds,
.highlight .pl-s1,
.highlight .pl-scp,
.highlight .pl-sol {
color: #df5000;
}
.highlight .pl-c1,
.highlight .pl-cn,
.highlight .pl-pse,
.highlight .pl-pse .pl-s2,
.highlight .pl-vi {
color: #a31515;
}
.highlight .pl-mb,
.highlight .pl-pdb {
color: #df5000;
font-weight: bold;
}
.highlight .pl-mi,
.highlight .pl-pdi {
color: #6e5494;
font-style: italic;
}
.highlight .pl-ms1 {
background-color: #f5f5f5;
}
.highlight .pl-mdh,
.highlight .pl-mdi {
font-weight: bold;
}
.highlight .pl-mdr {
color: #0086b3;
font-weight: bold;
}
.highlight .pl-s2 {
color: #333;
}
.highlight .pl-ii {
background-color: #df5000;
color: #fff;
}
.highlight .pl-ib {
background-color: #f93;
}
.highlight .pl-id {
background-color: #a31515;
color: #fff;
}
.highlight .pl-iu {
background-color: #b4b7b4;
}
.highlight .pl-mo {
color: #969896;
}
</style>
<script type="text/javascript">
function getDocumentScrollTop()
{
var res = document.body.scrollTop || document.documentElement.scrollTop || window.pageYOffset || 0;
// alert(res);
return res;
}
function setDocumentScrollTop(ypos)
{
window.scrollTo(0, ypos);
}
</script>
</head>
<body class="markdown-body">
<h1> <a id="developer-guide" class="anchor" href="#developer-guide" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Developer guide</h1>
<p>Thank you for your interest in developing wetb. This guide details how to contribute to wetb in a way that is efficient for everyone.</p>
<h2> <a id="contents" class="anchor" href="#contents" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Contents</h2>
<ul>
<li><a href="#Fork-project">Fork</a></li>
<li><a href="#Requirements">Requirements</a></li>
<li><a href="#Install-Python">Install Python</a></li>
<li><a href="#Install-dependencies">Install dependencies</a></li>
<li><a href="#Get-wetb">Get wetb</a></li>
<li> <a href="#Install-wetb">Install wetb</a> </li>
<li><a href="#Contributions">Contributions</a></li>
<li><a href="#Upload-contributions">Upload contributions</a></li>
<li><a href="#Make-and-upload-wheels">Make and upload wheels</a></li>
</ul>
<h2> <a id="fork-project" class="anchor" href="#fork-project" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Fork project</h2>
<p>We prefer that you make your contributions in your own fork of the project, <a href="#Contributions">make your changes</a> and <a href="#Upload%20contributions">make a merge request</a>.</p>
<p>The project can be forked to your own user account via the &lt;Fork&gt; button on the <a href="https://gitlab.windenergy.dtu.dk/toolbox/WindEnergyToolbox">frontpage</a></p>
<h2> <a id="requirements" class="anchor" href="#requirements" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Requirements</h2>
<h3> <a id="command-line" class="anchor" href="#command-line" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Command line</h3>
<p>This guide will use the command line (aka command prompt) frequently. You can launch a Windows terminal as follows: press Start&gt; and type &quot;cmd&quot; + &lt;Enter&gt;. A link to the command prompt should be visible now.</p>
<p>In case you want an alternative, more capable windows terminal, you could consider using <a href="https://conemu.github.io/">ConEmu</a> (this is optional).</p>
<blockquote>
<p>ConEmu-Maximus5 is a Windows console emulator with tabs, which presents multiple consoles and simple GUI applications as one customizable GUI window with various features.</p>
</blockquote>
<h3> <a id="git" class="anchor" href="#git" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Git</h3>
<ul>
<li><p>Download and install Git version control system for Windows 64-bit <a href="https://git-scm.com/download/win">here</a>. Only select the Windows Portable option if you know what you are doing or if you do not have administrative rights on your computer.</p></li>
<li><p>Git comes with a simple GUI, but there are more and different options available if you are not happy with it, see <a href="https://git-scm.com/downloads/guis">here</a>.</p></li>
<li><p>On windows we highly recommend <a href="https://tortoisegit.org/">tortoisegit</a>. It is a gui integrated into the windows explorer. </p></li>
</ul>
<h2> <a id="install-python" class="anchor" href="#install-python" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Install Python</h2>
<p>For all platforms we recommend that you download and install the Anaconda - a professional grade, full blown scientific Python distribution. </p>
<h3> <a id="installing-anaconda-activate-root-environment" class="anchor" href="#installing-anaconda-activate-root-environment" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Installing Anaconda, activate root environment</h3>
<ul>
<li>Download and install Anaconda (Python 3.5 version, 64 bit installer is recommended) from <a href="https://www.continuum.io/downloads">https://www.continuum.io/downloads</a> </li>
</ul>
<blockquote>
<p>Note: The Python 2.7 or Python 3.5 choice of Anaconda only affects the root environment. You can always create additional environments using other Python versions, see below.</p>
</blockquote>
<ul>
<li>Update the root Anaconda environment (type in a terminal):</li>
</ul>
<pre><code>&gt;&gt; conda update --all
</code></pre>
<ul>
<li>Activate the Anaconda root environment in a terminal as follows:</li>
</ul>
<pre><code>&gt;&gt; activate
</code></pre>
<p>and your terminal will do something like:</p>
<pre><code>C:\Users\&gt; activate
[Anaconda3] C:\Users\&gt;
</code></pre>
<p>note that the name of the environment is now a prefix before the current path.</p>
<p>use <code>deactivate</code> to deactivate the environment.</p>
<h3> <a id="optionally-create-other-independent-anaconda-environments" class="anchor" href="#optionally-create-other-independent-anaconda-environments" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Optionally, create other independent Anaconda environments</h3>
<ul>
<li>By using environments you can manage different Python installations with different versions on your system. Creating environments is as easy as:</li>
</ul>
<pre><code>&gt;&gt; conda create -n py27 python=2.7
&gt;&gt; conda create -n py34 python=3.4
&gt;&gt; conda create -n py35 python=3.5
</code></pre>
<ul>
<li>These environments can be activated as follows:</li>
</ul>
<pre><code>&gt;&gt; activate py27
&gt;&gt; activate py34
&gt;&gt; activate py35
</code></pre>
<p>The Python distribution in use will now be located in e.g. &lt;path_to_anaconda&gt;/env/py35/</p>
<p>use <code>deactivate</code> to deactivate the environment.</p>
<h2> <a id="install-dependencies" class="anchor" href="#install-dependencies" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Install dependencies</h2>
<p>Install the necessary Python dependencies using the conda package manager:</p>
<pre><code>&gt;&gt; conda install setuptools_scm future h5py pytables pytest nose sphinx
&gt;&gt; conda install scipy pandas matplotlib cython xlrd coverage xlwt openpyxl psutil
&gt;&gt; conda install -c https://conda.anaconda.org/conda-forge pyscaffold pytest-cov
</code></pre>
<h2> <a id="get-wetb" class="anchor" href="#get-wetb" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Get wetb</h2>
<p>Copy the https - link on the front page of your fork of wetb</p>
<pre><code>&gt;&gt; git clone &lt;https-link&gt;
</code></pre>
<p>or via tortoise-git:</p>
<ul>
<li>Right-click in your working folder</li>
<li>&quot;Git Clone...&quot;</li>
<li>&lt;Ok&gt;</li>
</ul>
<h2> <a id="install-wetb" class="anchor" href="#install-wetb" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Install wetb</h2>
<pre><code>&gt;&gt; cd WindEnergyToolbox
&gt;&gt; pip install -e . --no-deps
</code></pre>
<h2> <a id="contributions" class="anchor" href="#contributions" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Contributions</h2>
<p>If you make a change in the toolbox, that others can benefit from please make a merge request.</p>
<p>If you can, please submit a merge request with the fix or improvements including tests. </p>
<p>The workflow to make a merge request is as follows:</p>
<ul>
<li>Create a feature branch, branch away from master</li>
<li>Write tests and code</li>
<li>Push the commit(s) to your fork</li>
<li>Submit a merge request (MR) to the master branch of </li>
<li>Link any relevant issues in the merge request description and leave a comment on them with a link back to the MR</li>
<li>Your tests should run as fast as possible, and if it uses test files, these files should be as small as possible.</li>
<li>Please keep the change in a single MR as small as possible. Split the functionality if you can</li>
</ul>
<h2> <a id="upload-contributions" class="anchor" href="#upload-contributions" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Upload contributions</h2>
<p>To be written</p>
<h2> <a id="make-and-upload-wheels" class="anchor" href="#make-and-upload-wheels" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Make and upload wheels</h2>
<pre><code>&gt;&gt; conda install --channel https://conda.anaconda.org/pbrod twine
</code></pre>
<ul>
<li>Make tag</li>
<li>pip install -e . --upgrade</li>
<li>python setup.py bdist_wheel -d dist</li>
<li>twine upload dist*</li>
</ul>
</body>
</html>
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = python -msphinx
SPHINXPROJ = TOPFARM
SOURCEDIR = .
BUILDDIR = build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
\ No newline at end of file
docs/bladed/Bladed_airfoil.png

46.8 KiB

docs/bladed/Bladed_st_centers.png

43.6 KiB

docs/bladed/Bladed_turbine_coord.png

123 KiB

docs/bladed/HAWC2_c2_def_ccord.png

38.3 KiB

docs/bladed/HAWC2_st_centers.png

15.1 KiB

docs/bladed/HAWC2_turbine_coord.png

121 KiB

%% Cell type:markdown id: tags:
# Bladed to HAWC2 model conversion formulation
%% Cell type:markdown id: tags:
# Coordinate transformation: <br>
The parameters belonging to HAWC2 are showed by $*^H$ and the parameters belonging to Bladed are showed by $*^B$.
$ ----------------------------------$<br>
The blade root coordinate systems of the codes can be transfromed as:
\begin{equation}
\begin{bmatrix} x^H \\ y^H \\ z^H \end{bmatrix} = \begin{bmatrix} 0 & -1 & 0 \\ 1 & 0 & 0 \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} x^B \\ y^B \\ z^B \end{bmatrix}
\end{equation}
The transformation matrix is called $R^{H2B}$.
$ ----------------------------------$<br>
The total rotation angle is expressed by $\theta_{CS}^{B}$ which is comupted as:<br>
$\theta_{CS}^{B}$ = -$\theta_p^B$ - $\beta_{\alpha}^B$ <br>
**BE CAREFUL !!!** -> Bladed positive pitch/twist definition are in negative z direction. <br>
Transformation matrix $R^{B2CS}$ from Bladed local cross-section coordinates to the rotor coordinate system. <br>
\begin{equation}
\begin{bmatrix} x^B \\ y^B \\ z^B \end{bmatrix} = \begin{bmatrix} cos(\theta_{CS}^{B}) & sin(\theta_{CS}^{B}) & 0 \\ -sin(\theta_{CS}^{B}) & cos(\theta_{CS}^{B}) & 0 \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} x^B_{CS} \\ y^B_{CS} \\ z^B_{CS} \end{bmatrix}
\end{equation}
$ ----------------------------------$<br>
Total transformation from Bladed local coordinates to HAWC2 can be written as: <br>
\begin{equation}
\begin{bmatrix} x^H \\ y^H \\ z^H \end{bmatrix} = R^{H2B} R^{B2CS} \begin{bmatrix} x^B_{CS} \\ y^B_{CS} \\ z^B_{CS} \end{bmatrix}
\end{equation}
$ ----------------------------------$
%% Cell type:markdown id: tags:
## Center positions <br>
HAWC2 defines elastic, shear and mass center according to the half chord (*c2_def*) location in its st files
whereas Bladed measures center positions from leading edge position. The center positions ($x_{LE}^B$ and $y_{LE}^B$) can be defined with respect to the half chord ($x_{c2}^B$ and $y_{c2}^B$) in Bladed coordinate system as: <br>
$x_{c2}^B$ = $x_{LE}^B$ <br>
$y_{c2}^B$ = $y_{LE}^B$ - c/2 <br>
where *c* is the chord length. <br>
These coordinates can be transformed to HAWC2 coordinate system by multiplying them with $R^{H2B}$.
%% Cell type:markdown id: tags:
## Inertia conversion <br>
Bladed has total inertia value *Ip* and radius of gyration ratio *RGRATIO* in its input file. <br>
\begin{equation}
RGRATIO = \dfrac{RG_y}{RG_x}
\end{equation}
\begin{equation}
RG_x^2 = \dfrac{I_x}{m} \; , \; RG_y^2 = \dfrac{I_y}{m}
\end{equation}
where m is mass and $I_x$ is the mass moment of inertia with respect to x axis.
\begin{equation}
Ip = I_x + RGRATIO^2 \times I_x
\end{equation}
The *Ip* is defined with respec to mass center in Bladed whereas it is defined at elastic center in HAWC2. <br>
\begin{equation}
Ip^{ea} = Ip^{cg} + m \times (xyz^{cg} - xyz^{ea})^2
\end{equation}
**BE CAREFUL !!!** -> do not forget to transform inertia results from Bladed coordinate system to HAWC2 coordinate system.