33import numpy as np
44
55
6- class RunupModel (object ):
6+ class RunupModel (metaclass = ABCMeta ):
77 """
88 Abstract base class which our empirical runup models will inherit from
99 """
1010
11- __metaclass__ = ABCMeta
12-
1311 doi = None
1412
1513 def __init__ (self , Hs = None , Tp = None , beta = None , Lp = None ):
1614 """
17- Test
18-
19- :param Hs: description
20- :param Tp: description
21- :param beta: description
22- :param Lp: description
15+ Args:
16+ Hs (:obj:`float` or :obj:`list`): Significant wave height. In order to
17+ account for energy dissipation in the nearshore, transform the wave to
18+ the nearshore, then reverse-shoal to deep water.
19+ beta (:obj:`float` or :obj:`list`): Beach slope. Typically defined as the
20+ slope between the region of :math:`\\ pm2\\ sigma` where :math:`\\ sigma`
21+ is the standard deviation of the continuous water level record.
22+ Tp (:obj:`float` or :obj:`list`): Peak wave period.
23+ Must be defined if :attr:`Lp` is not defined.
24+ Lp (:obj:`float` or :obj:`list`): Peak wave length
25+ Must be definied if :attr:`Tp` is not defined.
2326 """
2427
2528 self .Hs = Hs
@@ -87,11 +90,48 @@ def swash(self):
8790
8891
8992class Stockdon2006 (RunupModel ):
93+ """
94+
95+ This class implements the empirical wave runup model from:
96+
97+ Stockdon, H. F., Holman, R. A., Howd, P. A., & Sallenger, A. H. (2006).
98+ Empirical parameterization of setup, swash, and runup. Coastal Engineering,
99+ 53(7), 573–588. https://doi.org/10.1016/j.coastaleng.2005.12.005
100+
101+ Examples:
102+ Calculate 2% exceedence runup level, including setup component and swash
103+ component given Hs=4m, Tp=11s, beta=0.1.
104+
105+ >>> from py_wave_runup.models import Stockdon2006
106+ >>> sto06 = Stockdon2006(Hs=4, Tp=11, beta=0.1)
107+ >>> sto06.R2
108+ 2.54
109+ >>> sto06.setup
110+ 0.96
111+ >>> sto06.swash
112+ 2.64
113+ """
90114
91115 doi = "10.1016/j.coastaleng.2005.12.005"
92116
93117 @property
94118 def R2 (self ):
119+ """
120+ Returns:
121+ The 2% exceedence runup level. For dissipative beaches (i.e.
122+ :math:`\\ zeta < 0.3`) Eqn (18) from the paper is used:
123+
124+ .. math:: R_{2} = 0.043(H_{s}L_{p})^{0.5}
125+
126+ For intermediate and reflective beaches (i.e. :math:`\\ zeta > 0.3`),
127+ the function returns the result from Eqn (19):
128+
129+ .. math::
130+
131+ R_{2} = 1.1 \\ left( 0.35 \\ beta (H_{s}L_{p})^{0.5} + \\ frac{H_{s}L_{p}(
132+ 0.563 \\ beta^{2} +0.004)^{0.5}}{2} \\ right)
133+ """
134+
95135 # Generalized runup (Eqn 19)
96136 result = 1.1 * (
97137 0.35 * self .beta * (self .Hs * self .Lp ) ** 0.5
@@ -109,24 +149,50 @@ def R2(self):
109149
110150 @property
111151 def setup (self ):
152+ """
153+ Returns:
154+ The setup level using Eqn (10):
155+
156+ .. math:: \\ bar{\\ eta} = 0.35 \\ beta (H_{s}L_{p})^{0.5}
157+
158+
159+ """
112160 result = 0.35 * self .beta * (self .Hs * self .Lp ) ** 0.5
113161 result = self ._return_one_or_array (result )
114162 return result
115163
116164 @property
117165 def sinc (self ):
166+ """
167+ Returns:
168+ Incident component of swash using Eqn (11):
169+
170+ .. math:: S_{inc} = 0.75 \\ beta (H_{s}L_{p})^{0.5}
171+ """
118172 result = 0.75 * self .beta * (self .Hs * self .Lp ) ** 0.5
119173 result = self ._return_one_or_array (result )
120174 return result
121175
122176 @property
123177 def sig (self ):
178+ """
179+ Returns:
180+ Infragravity component of swash using Eqn (12):
181+
182+ .. math:: S_{ig} = 0.06 (H_{s}L_{p})^{0.5}
183+ """
124184 result = 0.06 * (self .Hs * self .Lp ) ** 0.5
125185 result = self ._return_one_or_array (result )
126186 return result
127187
128188 @property
129189 def swash (self ):
190+ """
191+ Returns:
192+ Total amount of swash using Eqn (7):
193+
194+ .. math:: S = \\ sqrt{S_{inc}^{2}+S_{ig}^{2}}
195+ """
130196 result = np .sqrt (self .sinc ** 2 + self .sig ** 2 )
131197 result = self ._return_one_or_array (result )
132198 return result
0 commit comments