README.md 6.43 KB
Newer Older
David Verelst's avatar
David Verelst committed
1
2
3
4
5
6
7
8
9
10
11
12
13

# 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.

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.


David Verelst's avatar
David Verelst committed
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# How to create HAWC2 DLB's and run them on a cluster

The process of how to generated, run and post-process a design load basis (DLB)
of HAWC2 simulations on a DTU Wind Energy cluster is outlined in more detail
in the documentation:

* [Auto-generation of Design Load Cases](docs/howto-make-dlcs.md)
* [House rules mimer/hawc2sim and HAWC2 folder structure](docs/houserules-mimerhawc2sim.md)
* [Generate DLB spreadsheets](docs/generate-spreadsheet.md)
* [How to use the Statistics DataFrame](docs/using-statistics-df.md)

You can also use the Pdap for post-processing, which includes a MS Word report
generator based on a full DLB, a GUI for easy plotting of HAWC2 result files,
and a Python scripting interface:

* [Pdap](http://www.hawc2.dk/Download/Post-processing-tools/Pdap)
* [Pdap report/docs](http://orbit.dtu.dk/en/publications/post-processing-of-design-load-cases-using-pdap%28827c432b-cf7d-44eb-899b-93e9c0648ca5%29.html)


33
# Works with Python 2 and Python 3
David Verelst's avatar
David Verelst committed
34

35
36
37
38
This module is tested for Python 2 and 3 compatibility, and works on both
Windows and Linux. Testing for Mac is on the way, but in theory it should work.
Python 2 and 3 compatibility is achieved with a single code base with the help
of the Python module [future](http://python-future.org/index.html).
David Verelst's avatar
David Verelst committed
39
40
41
42

Switching to Python 3 is in general a very good idea especially since Python 3.5
was released. Some even dare to say it
[is like eating your vegetables](http://nothingbutsnark.svbtle.com/porting-to-python-3-is-like-eating-your-vegetables).
43
So if you are still on Python 2, we would recommend you to give Python 3 a try!
David Verelst's avatar
David Verelst committed
44

45
You can automatically convert your code from Python 2 to 3 using the
David Verelst's avatar
David Verelst committed
46
47
48
49
50
51
[2to3](https://docs.python.org/2/library/2to3.html) utility which is included
in Python 2.7 by default. You can also write code that is compatible with both
2 and 3 at the same time (you can find additional resources in
[issue 1](https://gitlab.windenergy.dtu.dk/toolbox/WindEnergyToolbox/issues/1)).


52
53
# Dependencies

54
55
* [numpy](http://www.numpy.org/)

56
57
* [cython](http://cython.org/)

58
59
60
61
* [scipy](http://scipy.org/scipylib/)

* [pandas](http://pandas.pydata.org/)

62
* xlrd and xlwt from [python-excel](http://www.python-excel.org/)
63

David Verelst's avatar
David Verelst committed
64
65
* [openpyxl](http://openpyxl.readthedocs.org/en/default/)

66
67
68
69
70
71
72
73
* h5py

* [matplotlib](http://matplotlib.org/)

* [pytables](http://www.pytables.org/)

* [pyscaffold](http://pyscaffold.readthedocs.org/en/)

74
* pytest, pytest-cov
75

76
* six, [future](http://python-future.org/index.html)
77
78


David Verelst's avatar
David Verelst committed
79
80
# Installation

81
82
83
84
Detailed installation instructions, including how to install Python from scratch,
are described in the [detailed installation manual](docs/install-manual-detailed.md).


85
If you know what you are doing, you can install as a package as follows:
86

David Verelst's avatar
David Verelst committed
87
```
88
python setup.py install
David Verelst's avatar
David Verelst committed
89
90
```

91
92
93
94
95
96
97
Or in development mode, install from your working directory

```
pip install -e ./
```


98
99
100
101
102
103
104
Or create a binary wheel distribution package with:

```
python setup.py bdist_wheel -d dist
```


David Verelst's avatar
David Verelst committed
105
106
107
108
109
110
# Tests

Only a small part of the code is covered by unittests currently. More tests are
forthcoming.


Mads M. Pedersen's avatar
updated    
Mads M. Pedersen committed
111
112
# Contents of WindEnergyToolbox, [wetb](wetb)

113
114
### Overview

mads's avatar
t    
mads committed
115
116
117
118
- [hawc2](#hawc2)
- [gtsdf](#gtsdf)
- [fatigue_tools](#fatigue_tools)
- [wind](#wind)
mads's avatar
mads committed
119
- [dlc](#dlc)
120
- [prepost](#prepost)
mads's avatar
t    
mads committed
121
- [fast](#fast)
mads's avatar
mads committed
122
- [utils](#utils)
Mads M. Pedersen's avatar
Mads M. Pedersen committed
123

124
### [hawc2](wetb/hawc2)
Mads M. Pedersen's avatar
updated    
Mads M. Pedersen committed
125
126
- [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
mads's avatar
mads committed
127
- [htc_file](wetb/hawc2/htc_file.py): Read/write/manipulate htc files
mads's avatar
mads committed
128
129
- [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
mads's avatar
mads committed
130
- [shear_file](wetb/hawc2/shear_file.py): Create user defined shear file
mads's avatar
mads committed
131
132
- [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
mads's avatar
mads committed
133
- [ascii2bin](wetb/hawc2/ascii2bin): Compress HAWC2 ascii result files to binary
Mads M. Pedersen's avatar
updated    
Mads M. Pedersen committed
134
135
136
137
138
139

### [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)

mads's avatar
mads committed
140
### [fatigue_tools](wetb/fatigue_tools)
141
- [fatigue](wetb/fatigue_tools/fatigue.py): Rainflow counting, cycle matrix and equivalent loads
mads's avatar
mads committed
142
- [bearing_damage](wetb/fatigue_tools/bearing_damage.py): Calculate a comparable measure of bearing damage
mads's avatar
mads committed
143

mads's avatar
mads committed
144
### [wind](wetb/wind)
145
- [shear](wetb/wind/shear.py): Calculate and fit wind shear
mads's avatar
mads committed
146

mads's avatar
mads committed
147
148
149
150
### [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

151
152
153
154
155
156
### [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.
mads's avatar
mads committed
157

158
159
160
161
162
163
164
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)


mads's avatar
mads committed
165
### [fast](wetb/fast)
mads's avatar
mads committed
166
167
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
mads's avatar
mads committed
168

mads's avatar
mads committed
169
### [utils](wetb/utils)
mads's avatar
mads committed
170
Other functions
mads's avatar
mads committed
171
172
173
- [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
174
175
- [caching](wetb/utils/caching.py): Decorators to create cached (calculate once) functions and properties

176
177
178
179
180
181

# Note

This project has been set up using PyScaffold 2.5. For details and usage
information on PyScaffold see http://pyscaffold.readthedocs.org/.