Skip to content
This repository was archived by the owner on May 4, 2023. It is now read-only.

Commit 0c3fd0c

Browse files
author
Esterly
committed
Merge remote-tracking branch 'origin/refactor'
2 parents ca298c5 + b548e8e commit 0c3fd0c

13 files changed

+143
-109
lines changed

doc/contact.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Contact
22
=======
3-
For help using the `WDRT`, please use the GitHub Issue Tracker forum: https://github.com/WEC-Sim/WDRT/issues. By posting your questions and comments here, you can receive feedback/solutions from the `WDRT` development team as well as the general user community.
3+
For help using the `WDRT`, please use the GitHub Issue Tracker forum: https://github.com/WEC-Sim/WDRT/issues.
4+
By posting your questions and comments here, you can receive feedback/solutions from the `WDRT` development team as well as the general user community.
45

56
.. image:: _static/IssueTracker.png
67
:align: center

doc/examples.rst

Lines changed: 23 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Short-term extreme response analysis
2828
------------------------------------
2929
A short term extreme distribution is the answer to “If a device is in sea-state X for Y amount of time, what will be the largest Z observed?", where X is the environmental condition, Y the short-term period, and Z the response parameter of interest (e.g. the mooring load, bending moment).
3030
The short-term extreme response module provides five different methods for obtaining this distribution based on observations of the quantity of interest "Z" at the desired sea-state "X".
31-
These methods are described in detail in :ref:`Michelen and Coe 2015 <pubs>`
31+
These methods are described in detail in :ref:`Michelen and Coe 2015 <pubs>`.
3232

3333
In this example the Weibull tail-fit method is used.
3434
The proccess of obtaiing the sort-term extreme distribution using the Weibull tail-fit method is as follows:
@@ -42,7 +42,7 @@ The proccess of obtaiing the sort-term extreme distribution using the Weibull ta
4242
4343
F^{\prime}(x_i) = \frac{i}{N+1}
4444
45-
where :math:`x_i` is the :math:`i^{\textrm{th}}`-ordered peak
45+
where :math:`x_i` is the :math:`i^{\textrm{th}}`-ordered peak.
4646

4747
3. Fit Weibull distributions to seven subsets of the points (:math:`x_i`, :math:`F^{\prime}(x_i)`) corresponding to :math:`F^{\prime}(x_i) > \left(0.95, 0.90, 0.85, 0.80, 0.75, 0.70, 0.65 \right)`.
4848

@@ -130,7 +130,9 @@ For this example, we will simply load data that was previously produced with a s
130130

131131
3. Short term extreme statistics
132132
''''''''''''''''''''''''''''''''
133-
The extreme response for each sea state can be defined as a percentile, :math:`\alpha`, in the extreme response distributions. The percentile chosen here should ideally be based on some experience with similar systems. Typical values for :math:`\alpha` used for marine structures range from 75 to 99\%. This approach has less variability than simply picking the maximum QOI observed in each sea state.
133+
The extreme response for each sea state can be defined as a percentile, :math:`\alpha`, in the extreme response distributions.
134+
The percentile chosen here should ideally be based on some experience with similar systems.
135+
Typical values for :math:`\alpha` used for marine structures range from 75 to 99\%. This approach has less variability than simply picking the maximum QOI observed in each sea state.
134136

135137
.. literalinclude:: ../examples/example_contourApproach.py
136138
:language: python
@@ -139,7 +141,9 @@ The extreme response for each sea state can be defined as a percentile, :math:`\
139141

140142
5. Determine design load condition(s)
141143
'''''''''''''''''''''''''''''''''''''
142-
For the quantity of interest (QOI), find the sea state that represents the design load condition; this will be the design load condition (DLC) for that (QOI). The DLC is defined as the scenario that gives the largest response. To define the DLC by statistically-supported process, it is best to use a short-term extreme response analysis process to examine the QOI in each of the considered sea states.
144+
For the quantity of interest (QOI), find the sea state that represents the design load condition; this will be the design load condition (DLC) for that (QOI).
145+
The DLC is defined as the scenario that gives the largest response.
146+
To define the DLC by statistically-supported process, it is best to use a short-term extreme response analysis process to examine the QOI in each of the considered sea states.
143147

144148
.. literalinclude:: ../examples/example_contourApproach.py
145149
:language: python
@@ -252,43 +256,11 @@ The required inputs to the module are:
252256

253257
3. And, :math:`N`, the number of cycles expected in the WEC’s design life, which is up to the user to ascertain given a specified design life and environmental characterization.
254258

255-
This example is shown below and can found in ``$WDRT_SOURCE/examples/example_fatigue.py``::
256-
257-
# This example loads pre-calculated PTO force histories for a reduced size joint
258-
# probability distribution. Then uses the WDRT fatigue function to calculate
259-
# equivalent fatigue loads for a 1 hour timeframe and a 1 year timeframe.
260-
261-
import numpy as np
262-
import WDRT.fatigue as fatigue
263-
264-
# Reduced size joint probability distribution
265-
Te = [[6.0,10.0,14.0],[6.0,10.0,14.0],[6.0,10.0,14.0]] # Wave energy periods
266-
Hs = [[1.25,1.25,1.25],[2.75,2.75,2.75],[4.25,4.25,4.25]] # Significant wave heights
267-
P = np.multiply([[23.45,24.78,1.64],[9.18,28.21,4.11],[0.05,5.00,2.34]],0.01) # Probability
268-
269-
N1h = 0
270-
N1y = 0
271-
[h,t] = np.shape(P)
272-
for i in range(h):
273-
for j in range(t):
274-
N1h = N1h+1*60*60*P[i][j]/(Te[i][j]*.82476) # Average N in 1 hour (Tavg = 0.82476*Te)
275-
N1y = N1y+1*365*24*60*60*P[i][j]/(Te[i][j]*.82476) # Average N in 1 year
276-
277-
m = float(6) # Assume an S-N curve slope of 6 (representative of cast iron)
278-
Feq_1h = np.zeros((h,t))
279-
Feq_1y = 0
280-
for i in range(h):
281-
for j in range(t):
282-
# Read pre-calculated PTO force histories for each sea state
283-
Fpto = np.loadtxt('examples\data\FptoH'+str(int(Hs[i][j]))+'T'+str(int(Te[i][j]))+'.txt')
284-
Feq_1h[i][j] = fatigue.EqLoad(Fpto, N1h, m) # Equivalent fatigue load for a 1 hour timeframe
285-
Feq_1y = Feq_1y+(Feq_1h[i][j]**m)*N1h*P[i][j]
286-
Feq_1y = (Feq_1y/N1y)**(1/m) # Equivalent fatigue load for a 1 year timeframe
287-
288-
print('1 hour equivalent fatigue loads:')
289-
print(Feq_1h)
290-
print('1 year equivalent fatigue load:')
291-
print(Feq_1y)
259+
This example is shown below and can found in ``$WDRT_SOURCE/examples/example_fatigue.py``.
260+
261+
.. literalinclude:: ../examples/example_fatigue.py
262+
:language: python
263+
:linenos:
292264

293265
In this example, 1 hour PTO force histories (for the `RM3 WEC <http://wec-sim.github.io/WEC-Sim/tutorials.html#two-body-point-absorber-rm3>`_) have been numerically obtained (using `WEC-Sim <http://wec-sim.github.io/WEC-Sim/index.html>`_) for each sea state in the hypothetical joint probability distribution shown below.
294266
The average number of cycles expected in 1 hour, :math:`N_{\textrm{1-hr}}`, and 1 year, :math:`N_{\textrm{1-yr}}`, timeframes are estimated from the joint probability distribution.
@@ -300,22 +272,27 @@ And finally, the annual damage equivalent load is calculated by reapplying the P
300272
:align: center
301273
:width: 400pt
302274

303-
304-
305275
Most-likely extreme response (MLER)
306276
-----------------------------------
307277

308-
The extreme load is often a matter of chance created by the instantaneous position of the device and a series of random waves. The occurrence of an extreme load should be studied as a stochastic event because of the nature of the irregular sea states. The MLER toolbox were developed to generate a focused wave profile that gives the largest response with the consideration of wave statistics based on spectral analysis and the response amplitude operators (RAOs) of the device.
278+
The extreme load is often a matter of chance created by the instantaneous position of the device and a series of random waves.
279+
The occurrence of an extreme load should be studied as a stochastic event because of the nature of the irregular sea states.
280+
The MLER toolbox were developed to generate a focused wave profile that gives the largest response with the consideration of wave statistics based on spectral analysis and the response amplitude operators (RAOs) of the device.
309281

310282
An example can be found in ``$WDRT_SOURCE/WDRT/MLER_toolbox/example/testrun.py``.
311283

312284
.. literalinclude:: ../WDRT/MLER_toolbox/example/testrun.py
313285
:language: python
314286
:linenos:
315287

316-
In this example, the MLER method was applied to model a floating ellipsoid (Quon et al. OMAE 2016). The waves were generated from the extreme wave statistics data and the linear RAOs were obtained from a simple radiation-and-diffraction-method-based numerical model known as the `Wave Energy Converter Simulator, or WEC- Sim <https://wec-sim.github.io/WEC-Sim/>`_.
288+
In this example, the MLER method was applied to model a floating ellipsoid (Quon et al. OMAE 2016).
289+
The waves were generated from the extreme wave statistics data and the linear RAOs were obtained from a simple radiation-and-diffraction-method-based numerical model known as the `Wave Energy Converter Simulator, or WEC- Sim <https://wec-sim.github.io/WEC-Sim/>`_.
317290

318-
The figure below explains how the MLER waves were generated and used. For this particular example, the target sea state has a significant wave height of 9 m and energy period of 15.1 sec and was represented using Brettschneider spectrum. A specific wave profile is required for different responses of interest (e.g., motion, mooring load, shear stress and bending moment). For example, the MLER wave profile targeting maximum pitch motion is different from the profile for heave, as seen below in the "heave conditioned" and "pitch conditioned" curves. This is expected because the maximum heave and pitch are most likely to occur at different times.
291+
The figure below explains how the MLER waves were generated and used.
292+
For this particular example, the target sea state has a significant wave height of 9 m and energy period of 15.1 sec and was represented using Brettschneider spectrum.
293+
A specific wave profile is required for different responses of interest (e.g., motion, mooring load, shear stress and bending moment).
294+
For example, the MLER wave profile targeting maximum pitch motion is different from the profile for heave, as seen below in the "heave conditioned" and "pitch conditioned" curves.
295+
This is expected because the maximum heave and pitch are most likely to occur at different times.
319296

320297
.. figure:: _static/MLER.png
321298
:align: center

doc/index.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,13 @@ Contributors
2222
* Ryan Coe, Sandia National Laboratories
2323
* Carlos Michelen, Sandia National Laboratories
2424
* Aubrey Eckert-Gallup, Sandia National Laboratories
25+
* Nevin Martin, Sandia National Laboratories
26+
* Tyler Esterly, Sandia National Laboratories
2527
* Jennifer van Rij, National Renewable Energy Laboratory
2628
* Yi-Hsiang Yu, National Renewable Energy Laboratory
2729
* Eliot Quon, National Renewable Energy Laboratory
30+
* Lance Manuel, University of Texas at Austin
31+
* Phong Nguyen, University of Texas at Austin
2832

2933
Contents
3034
========

doc/installation.rst

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
Installation
2-
==========================
2+
============
33

44
Downloading `WDRT`
5-
------------------------
6-
`WDRT` is distributed through the `WDRT GitHub repository <https://github.com/WEC-Sim/WDRT/>`_. The toolbox can either be downloaded via ``git`` or simply by visiting the the `WDRT GitHub repository <https://github.com/WEC-Sim/WDRT/>`_ and downloading it directly.
5+
------------------
6+
`WDRT` is distributed through the `WDRT GitHub repository <https://github.com/WEC-Sim/WDRT/>`_.
7+
The toolbox can either be downloaded via ``git`` or simply by visiting the the `WDRT GitHub repository <https://github.com/WEC-Sim/WDRT/>`_ and downloading it directly.
78

89
.. note::
910

@@ -38,6 +39,12 @@ The following installation procedure allows for easier updating of the code with
3839

3940
**Step 2:** Add the ``$WDRT_SOURCE`` directory to your `PYTHONPATH <https://docs.python.org/2/using/cmdline.html#environment-variables>`_ environment variable (`Windows <https://docs.python.org/2/using/windows.html#excursus-setting-environment-variables>`_, `Mac OSX <https://docs.python.org/2/using/mac.html?highlight=pythonpath#configuration>`_, `Linux <https://wiki.archlinux.org/index.php/Environment_variables>`_).
4041

41-
**Step 3:** Verify the installation's functionality::
42+
**Step 3:** Verify the installation's functionality by running the examples located in``$WDRT_SOURCE/examples``
4243

43-
python verifyInstall.py
44+
.. code-block:: none
45+
46+
cd examples
47+
python example_envSamplying.py
48+
python example_contourApproach.py
49+
python example_shortTermExtreme.py
50+
python example_fatigue.py

doc/modules.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Toolbox Modules
22
===============
3-
The following sections contain the documentation for `WDRT`. Note that this documentation is also contained in the python source code. As such, documentation for any `WDRT` function or classs can also be accessed in iPython via by calling
3+
The following sections contain the documentation for `WDRT`.
4+
Note that this documentation is also contained in the python source code.
5+
As such, documentation for any `WDRT` function or classs can also be accessed in iPython via by calling
46

57
>>> help(<wdrt class or module>)
68

doc/publications.rst

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ If you desire to cite `WDRT` in a publication, please use
88

99
R.G. Coe, C. Michelen, A. Eckert-Gallup, Y. Yu and J. van Rij, “WDRT: A toolbox for design-response analysis of wave energy converters,” Proceedings of the 4th Marine Energy Technology Symposium (METS), Washington, DC, 2016.
1010

11-
BibTex key::
11+
BibTex key
12+
13+
.. code-block:: none
1214
1315
@InProceedings{,
1416
author = {Ryan G. Coe and Carlos Michelen and Aubrey C. Eckert-Gallup and Yi-Hsiang Yu and Jennifer van Rij},
@@ -23,18 +25,22 @@ BibTex key::
2325
Related publications
2426
--------------------
2527

26-
[1] R.G. Coe, C. Michelen, A. Eckert-Gallup, Y. Yu and J. van Rij, WDRT: A toolbox for design-response analysis of wave energy converters, Proceedings of the 4th Marine Energy Technology Symposium (METS), Washington, DC, 2016.
28+
-- A. Eckert-Gallup, and N. Martin, `Kernel density estimation (KDE) with adaptive bandwidth selection for environmental contours of extreme sea states <http://ieeexplore.ieee.org/abstract/document/7761150/>`_, in: OCEANS 2016 MTS/IEEE Monterey. IEEE, 2016.
29+
30+
-- L. Manuel, J. Canning, R. G. Coe, C. Michelen, On the short-term uncertainty in performance of a point absorber wave energy converter, in: Proceedings of the 4th Marine Energy Technology Symposium (METS), Washington, DC, 2016.
31+
32+
-- R. G. Coe, C. Michelen, A. Eckert-Gallup, Y. Yu and J. van Rij, `WDRT: A toolbox for design-response analysis of wave energy converters <https://www.researchgate.net/publication/308794966_WDRT_A_Toolbox_for_design-response_analysis_of_wave_energy_converters>`_, in: Proceedings of the 4th Marine Energy Technology Symposium (METS), Washington, DC, 2016.
2733

28-
[2] E. Quon, A. Platt, Y.-H. Yu, M. Lawson, Application of the Most Likely Extreme Response Method for Wave Energy Converters, in: Proceedings of the 35th International Conference on Ocean, Offshore and Arctic Engineering, ASME, Busan, South Korea, 2016.
34+
-- E. Quon, A. Platt, Y.-H. Yu, M. Lawson, `Application of the Most Likely Extreme Response Method for Wave Energy Converters <http://www.nrel.gov/docs/fy16osti/65926.pdf>`_, in: Proceedings of the 35th International Conference on Ocean, Offshore and Arctic Engineering, ASME, Busan, South Korea, 2016.
2935

30-
[3] A. C. Eckert-Gallup, C. J. Sallaberry, A. R. Dallman, V. S. Neary, `Application of principal component analysis (PCA) and improved joint probability distributions to the inverse first-order reliability method (I-FORM) for predicting extreme sea states <http://www.sciencedirect.com/science/article/pii/S0029801815006721>`_, Ocean Engineering 112 (2016) 307 – 319. doi:http://dx.doi.org/10.1016/j.oceaneng.2015.12.018.
36+
-- A. C. Eckert-Gallup, C. J. Sallaberry, A. R. Dallman, V. S. Neary, `Application of principal component analysis (PCA) and improved joint probability distributions to the inverse first-order reliability method (I-FORM) for predicting extreme sea states <http://www.sciencedirect.com/science/article/pii/S0029801815006721>`_, Ocean Engineering 112 (2016) 307 – 319. doi:http://dx.doi.org/10.1016/j.oceaneng.2015.12.018.
3137

32-
[4] C. Michelen, R. Coe, `Comparison of methods for estimating short-term extreme response of wave energy converters <http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=7401878&tag=1>`_, in: OCEANS 2015 - MTS/IEEE Washington, IEEE, Washington, D.C., 2015.
38+
-- C. Michelen, R. Coe, `Comparison of methods for estimating short-term extreme response of wave energy converters <http://ieeexplore.ieee.org/document/7401878/>`_, in: OCEANS 2015 - MTS/IEEE Washington, IEEE, Washington, D.C., 2015.
3339

34-
[5] Y.-H. Yu, J. Van Rij, R. G. Coe, M. Lawson, `Development and application of a methodology for predicting wave energy converters design load <http://proceedings.asmedigitalcollection.asme.org/proceeding.aspx?articleID=2465994>`_, in: Proceedings of the 34th International Conference on Ocean, Offshore and Arctic Engineering, ASME, St. Johns, Canada, 2015.
40+
-- Y.-H. Yu, J. Van Rij, R. G. Coe, M. Lawson, `Development and application of a methodology for predicting wave energy converters design load <http://proceedings.asmedigitalcollection.asme.org/proceeding.aspx?articleID=2465994>`_, in: Proceedings of the 34th International Conference on Ocean, Offshore and Arctic Engineering, ASME, St. Johns, Canada, 2015.
3541

36-
[6] A. C. Eckert-Gallup, C. J. Sallaberry, A. R. Dallman, V. S. Neary, `Modified inverse first order reliability method (I-FORM) for predicting extreme sea states <https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0CCMQFjAAahUKEwiShYidmcLIAhVIlIgKHe6tAsw&url=http%3A%2F%2Fprod.sandia.gov%2Ftechlib%2Faccess-control.cgi%2F2014%2F1417550.pdf&usg=AFQjCNGaXmRbm0SvIS3zrIxd0z14q3BVYg&sig2=cLHjej-znRIW3fIIGlh5_Q>`_, Tech. Rep. SAND2014-17550, Sandia National Laboratories, Albuquerque, NM (United States) 2014.
42+
-- A. C. Eckert-Gallup, C. J. Sallaberry, A. R. Dallman, V. S. Neary, `Modified inverse first order reliability method (I-FORM) for predicting extreme sea states <https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0CCMQFjAAahUKEwiShYidmcLIAhVIlIgKHe6tAsw&url=http%3A%2F%2Fprod.sandia.gov%2Ftechlib%2Faccess-control.cgi%2F2014%2F1417550.pdf&usg=AFQjCNGaXmRbm0SvIS3zrIxd0z14q3BVYg&sig2=cLHjej-znRIW3fIIGlh5_Q>`_, Tech. Rep. SAND2014-17550, Sandia National Laboratories, Albuquerque, NM (United States) 2014.
3743

38-
[7] R. Coe, V. Neary, M. Lawson, Y.-H. Yu, J. Weber, `Extreme conditions modeling workshop report <http://prod-http-80-800498448.us-east-1.elb.amazonaws.com/w/images/8/81/WEC_Extreme_Conditions_Modeling_Workshop_Report.pdf>`_, Tech. Rep. NREL/ TP-5000-62305 SNL/ SAND2014-16384R, Sandia National Laboratories, Albuquerque, New Mexico (2014).
44+
-- R. Coe, V. Neary, M. Lawson, Y.-H. Yu, J. Weber, `Extreme conditions modeling workshop report <http://prod-http-80-800498448.us-east-1.elb.amazonaws.com/w/images/8/81/WEC_Extreme_Conditions_Modeling_Workshop_Report.pdf>`_, Tech. Rep. NREL/ TP-5000-62305 SNL/ SAND2014-16384R, Sandia National Laboratories, Albuquerque, New Mexico (2014).
3945

40-
[8] R. G. Coe, V. S. Neary, `Review of methods for modeling wave energy converter survival in extreme sea states <http://vtechworks.lib.vt.edu/bitstream/handle/10919/49221/101-Coe.pdf?sequence=1&isAllowed=y>`_, in: Proceedings of the 2nd Marine Energy Technology Symposium, Seattle, WA, USA, 2014.
46+
-- R. G. Coe, V. S. Neary, `Review of methods for modeling wave energy converter survival in extreme sea states <http://vtechworks.lib.vt.edu/bitstream/handle/10919/49221/101-Coe.pdf?sequence=1&isAllowed=y>`_, in: Proceedings of the 2nd Marine Energy Technology Symposium, Seattle, WA, USA, 2014.

examples/data/NDBC46022.h5

3.42 MB
Binary file not shown.

examples/example_contourApproach.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import h5py
1010
import os
1111

12+
1213
# Load data from example_envSampling.py
1314
envFile = h5py.File(os.path.join('data', 'NDBC46022.h5'), 'r')
1415
Hs = np.array(envFile['buoy_Data/Hs'])
@@ -68,8 +69,8 @@
6869
ax.plot(T_Return, Hs_Return, np.zeros_like(T_Return), 'k')
6970
ax.plot(T_sample, Hs_sample, np.zeros_like(Hs_sample), 'yo')
7071
for i in range(len(T_sample)):
71-
ax.plot([T_sample[i], T_sample[i]], [Hs_sample[i], Hs_sample[i]], [0, ev[i]],
72-
'-', linewidth=2, color='b', alpha=.5)
72+
ax.plot([T_sample[i], T_sample[i]], [Hs_sample[i], Hs_sample[i]],
73+
[0, ev[i]], '-', linewidth=2, color='b', alpha=0.5)
7374
ax.plot(T_sample, Hs_sample, ev, '-o')
7475
ax.set_xlabel('Energy period, $T_e$ (s)')
7576
ax.set_ylabel('Sig. wave height, $H_s$ (m)')
@@ -82,6 +83,5 @@
8283
plt.grid(True)
8384
plt.xlabel('$x$')
8485
plt.ylabel('$CDF(x)$')
85-
plt.show()
8686

8787
plt.show()

0 commit comments

Comments
 (0)