Physics
SWAN physics commands
Generation
GEN1
Bases: BaseComponent
First generation source terms GEN1.
.. code-block:: text
GEN1 [cf10] [cf20] [cf30] [cf40] [edmlpm] [cdrag] [umin] [cfpm]
With this command the user indicates that SWAN should run in first-generation mode (see Scientific/Technical documentation).
Examples
.. ipython:: python :okwarning:
from rompy_swan.components.physics import GEN1
gen = GEN1()
print(gen.render())
kwargs = dict(
cf10=188.0,
cf20=0.59,
cf30=0.12,
cf40=250.0,
edmlpm=0.0036,
cdrag=0.0012,
umin=1.0,
cfpm=0.13
)
gen = GEN1(**kwargs)
print(gen.render())
Source code in rompy_swan/components/physics.py
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | |
Attributes
model_type
class-attribute
instance-attribute
cf10
class-attribute
instance-attribute
cf10: Optional[float] = Field(default=None, description='Controls the linear wave growth (SWAN default: 188.0)')
cf20
class-attribute
instance-attribute
cf20: Optional[float] = Field(default=None, description='Controls the exponential wave growth (SWAN default: 0.59)')
cf30
class-attribute
instance-attribute
cf30: Optional[float] = Field(default=None, description='Controls the exponential wave growth (SWAN default: 0.12)')
cf40
class-attribute
instance-attribute
cf40: Optional[float] = Field(default=None, description='Controls the dissipation rate, i.e., the time decay scale (SWAN default: 250.0)')
edmlpm
class-attribute
instance-attribute
edmlpm: Optional[float] = Field(default=None, description='Maximum non-dimensionless energy density of the wind sea part of the spectrum according to Pierson Moskowitz (SWAN default: 0.0036)')
cdrag
class-attribute
instance-attribute
umin
class-attribute
instance-attribute
umin: Optional[float] = Field(default=None, description='Minimum wind velocity (relative to current; all wind speeds are taken at 10 m above sea level) (SWAN default: 1)')
cfpm
class-attribute
instance-attribute
cfpm: Optional[float] = Field(default=None, description='Coefficient which determines the Pierson Moskowitz frequency: `delta_PM = 2pi g / U_10` (SWAN default: 0.13)')
Functions
cmd
Command line string for this component.
Source code in rompy_swan/components/physics.py
GEN2
Bases: GEN1
Second generation source terms GEN2.
.. code-block:: text
GEN2 [cf10] [cf20] [cf30] [cf40] [cf50] [cf60] [edmlpm] [cdrag] [umin] [cfpm]
With this command the user indicates that SWAN should run in second-generation mode (see Scientific/Technical documentation).
Examples
.. ipython:: python :okwarning:
from rompy_swan.components.physics import GEN2
gen = GEN2()
print(gen.render())
kwargs = dict(
cf10=188.0,
cf20=0.59,
cf30=0.12,
cf40=250.0,
cf50=0.0023,
cf60=-0.223,
edmlpm=0.0036,
cdrag=0.0012,
umin=1.0,
cfpm=0.13
)
gen = GEN2(**kwargs)
print(gen.render())
Source code in rompy_swan/components/physics.py
161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 | |
Attributes
model_type
class-attribute
instance-attribute
cf50
class-attribute
instance-attribute
cf50: Optional[float] = Field(default=None, description='Controls the spectral energy scale of the limit spectrum (SWAN default: 0.0023)')
cf60
class-attribute
instance-attribute
cf60: Optional[float] = Field(default=None, description='Ccontrols the spectral energy scale of the limit spectrum (SWAN default: -0.223')
Functions
cmd
Command line string for this component.
Source code in rompy_swan/components/physics.py
GEN3
Bases: BaseComponent
Third generation source terms GEN3.
.. code-block:: text
GEN3 JANSSEN|KOMEN|->WESTHUYSEN|ST6 AGROW [a]
With this command the user indicates that SWAN should run in third-generation mode for wind input, quadruplet interactions and whitecapping.
Examples
.. ipython:: python :okwarning:
from rompy_swan.components.physics import GEN3
gen = GEN3(
source_terms=dict(
model_type="westhuysen",
wind_drag="wu",
agrow=True,
),
)
print(gen.render())
from rompy_swan.subcomponents.physics import ST6C1
gen = GEN3(source_terms=ST6C1())
print(gen.render())
Source code in rompy_swan/components/physics.py
Attributes
model_type
class-attribute
instance-attribute
source_terms
class-attribute
instance-attribute
source_terms: SOURCE_TERMS = Field(default_factory=WESTHUYSEN, description='SWAN source terms to be used (SWAN default: WESTHUYSEN)', discriminator='model_type')
Functions
Swell dissipation
NEGATINP
Bases: BaseComponent
Negative wind input.
.. code-block:: text
NEGATINP [rdcoef]
With this optional command the user activates negative wind input. This is
intended only for use with non-breaking swell dissipation SSWELL ZIEGER.
Parameter rdcoef is a fraction between 0 and 1, representing the strength of
negative wind input. As an example, with [rdcoef]=0.04, for a spectral bin that is
opposed to the wind direction, the wind input factor W(k, θ) is negative, and its
magnitude is 4% of the corresponding value of the spectral bin that is in the
opposite direction (i.e. in the wind direction). See Zieger et al. (2015) eq. 11,
where a0 is their notation for [rdcoef]. Default [rdcoef]=0.0 and rdcoef=0.04 is
recommended, though as implied by Zieger et al. (2015), this value is not
well-established, so the user is encouraged to experiment with other values.
References
Zieger, S., Babanin, A.V., Rogers, W.E. and Young, I.R., 2015. Observation-based source terms in the third-generation wave model WAVEWATCH. Ocean Modelling, 96, pp.2-25.
Examples
.. ipython:: python :okwarning:
from rompy_swan.components.physics import NEGATINP
negatinp = NEGATINP()
print(negatinp.render())
negatinp = NEGATINP(rdcoef=0.04)
print(negatinp.render())
Source code in rompy_swan/components/physics.py
Attributes
model_type
class-attribute
instance-attribute
model_type: Literal['negatinp', 'NEGATINP'] = Field(default='negatinp', description='Model type discriminator')
rdcoef
class-attribute
instance-attribute
rdcoef: Optional[float] = Field(default=None, description='Coefficient representing the strength of negative wind input', ge=0.0, le=1.0)
Functions
SSWELL_ARDHUIN
Bases: BaseComponent
Nonbreaking dissipation of Ardhuin et al. (2010).
.. code-block:: text
SSWELL ARDHUIN [cdsv]
References
Ardhuin, F., Rogers, E., Babanin, A.V., Filipot, J.F., Magne, R., Roland, A., Van Der Westhuysen, A., Queffeulou, P., Lefevre, J.M., Aouf, L. and Collard, F., 2010. Semiempirical dissipation source functions for ocean waves. Part I: Definition, calibration, and validation. Journal of Physical Oceanography, 40(9), pp.1917-1941.
Examples
.. ipython:: python :okwarning:
from rompy_swan.components.physics import SSWELL_ARDHUIN
sswell = SSWELL_ARDHUIN()
print(sswell.render())
sswell = SSWELL_ARDHUIN(cdsv=1.2)
print(sswell.render())
Source code in rompy_swan/components/physics.py
Attributes
model_type
class-attribute
instance-attribute
model_type: Literal['ardhuin', 'ARDHUIN'] = Field(default='ardhuin', description='Model type discriminator')
cdsv
class-attribute
instance-attribute
cdsv: Optional[float] = Field(default=None, description='Coefficient related to laminar atmospheric boundary layer (SWAN default: 1.2)')
Functions
SSWELL_ZIEGER
Bases: BaseComponent
Nonbreaking dissipation of Zieger et al. (2015).
.. code-block:: text
SSWELL ZIEGER [b1]
Swell dissipation of Young et al. (2013) updated by Zieger et al. (2015). The Zieger option is intended for use with negative wind input via the NEGATINP command. Zieger non-breaking dissipation follows the method used in WAVEWATCH III version 4 and does not include the steepness-dependent swell coefficient introduced in WAVEWATCH III version 5.
References
Zieger, S., Babanin, A.V., Rogers, W.E. and Young, I.R., 2015. Observation-based source terms in the third-generation wave model WAVEWATCH. Ocean Modelling, 96, pp.2-25.
Young, I.R., Babanin, A.V. and Zieger, S., 2013. The decay rate of ocean swell observed by altimeter. Journal of physical oceanography, 43(11), pp.2322-2333.
Examples
.. ipython:: python :okwarning:
from rompy_swan.components.physics import SSWELL_ZIEGER
sswell = SSWELL_ZIEGER()
print(sswell.render())
sswell = SSWELL_ZIEGER(b1=0.00025)
print(sswell.render())
Source code in rompy_swan/components/physics.py
Attributes
model_type
class-attribute
instance-attribute
model_type: Literal['zieger', 'ZIEGER'] = Field(default='zieger', description='Model type discriminator')
b1
class-attribute
instance-attribute
b1: Optional[float] = Field(default=None, description='Non-dimensional proportionality coefficient (SWAN default: 0.00025)')
Functions
SSWELL_ROGERS
Bases: BaseComponent
Nonbreaking dissipation of Rogers et al. (2012).
.. code-block:: text
SSWELL ROGERS [cdsv] [feswell]
References
Rogers, W.E., Babanin, A.V. and Wang, D.W., 2012. Observation-consistent input and whitecapping dissipation in a model for wind-generated surface waves: Description and simple calculations. Journal of Atmospheric and Oceanic Technology, 29(9), pp.1329-1346.
Examples
.. ipython:: python :okwarning:
from rompy_swan.components.physics import SSWELL_ROGERS
sswell = SSWELL_ROGERS()
print(sswell.render())
sswell = SSWELL_ROGERS(cdsv=1.2, feswell=0.5)
print(sswell.render())
Source code in rompy_swan/components/physics.py
Attributes
model_type
class-attribute
instance-attribute
model_type: Literal['rogers', 'ROGERS'] = Field(default='rogers', description='Model type discriminator')
cdsv
class-attribute
instance-attribute
cdsv: Optional[float] = Field(default=None, description='Coefficient related to laminar atmospheric boundary layer (SWAN default: 1.2)')
feswell
class-attribute
instance-attribute
Functions
cmd
Command file string for this component.
Source code in rompy_swan/components/physics.py
Whitecapping
WCAPPING_KOMEN
Bases: BaseComponent
Whitecapping according to Komen (1984).
.. code-block:: text
WCAPPING KOMEN [cds2] [stpm] [powst] [delta] [powk]
Notes
The SWAN default for delta has been changed since version 40.91A. The setting
delta = 1 will improve the prediction of the wave energy at low frequencies, and
hence the mean wave period. The original default was delta = 0, which corresponds
to WAM Cycle 3. See the Scientific/Technical documentation for further details.
References
Komen, G.J., Hasselmann, S. and Hasselmann, K., 1984. On the existence of a fully developed wind-sea spectrum. Journal of physical oceanography, 14(8), pp.1271-1285.
Examples
.. ipython:: python :okwarning:
from rompy_swan.components.physics import WCAPPING_KOMEN
wcapping = WCAPPING_KOMEN()
print(wcapping.render())
wcapping = WCAPPING_KOMEN(cds2=2.36e-5, stpm=3.02e-3, powst=2, delta=1, powk=2)
print(wcapping.render())
Source code in rompy_swan/components/physics.py
502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 | |
Attributes
model_type
class-attribute
instance-attribute
model_type: Literal['komen', 'KOMEN'] = Field(default='komen', description='Model type discriminator')
cds2
class-attribute
instance-attribute
cds2: Optional[float] = Field(default=None, description='Coefficient for determining the rate of whitecapping dissipation ($Cds$) (SWAN default: 2.36e-5)')
stpm
class-attribute
instance-attribute
stpm: Optional[float] = Field(default=None, description='Value of the wave steepness for a Pierson-Moskowitz spectrum ($s^2_{PM}$) (SWAN default: 3.02e-3)')
powst
class-attribute
instance-attribute
powst: Optional[float] = Field(default=None, description='Power of steepness normalized with the wave steepness of a Pierson-Moskowitz spectrum (SWAN default: 2)')
delta
class-attribute
instance-attribute
delta: Optional[float] = Field(default=None, description='Coefficient which determines the dependency of the whitecapping on wave number (SWAN default: 1)')
powk
class-attribute
instance-attribute
powk: Optional[float] = Field(default=None, description='power of wave number normalized with the mean wave number (SWAN default: 1)')
Functions
cmd
Command file string for this component.
Source code in rompy_swan/components/physics.py
WCAPPING_AB
Bases: BaseComponent
Whitecapping according to Alves and Banner (2003).
.. code-block:: text
WCAPPING AB [cds2] [br] CURRENT [cds3]
References
Alves, J.H.G. and Banner, M.L., 2003. Performance of a saturation-based dissipation-rate source term in modeling the fetch-limited evolution of wind waves. Journal of Physical Oceanography, 33(6), pp.1274-1298.
Examples
.. ipython:: python :okwarning:
from rompy_swan.components.physics import WCAPPING_AB
wcapping = WCAPPING_AB()
print(wcapping.render())
wcapping = WCAPPING_AB(cds2=5.0e-5, br=1.75e-3, current=True, cds3=0.8)
print(wcapping.render())
Source code in rompy_swan/components/physics.py
Attributes
model_type
class-attribute
instance-attribute
cds2
class-attribute
instance-attribute
cds2: Optional[float] = Field(default=None, description='proportionality coefficient due to Alves and Banner (2003) (SWAN default: 5.0e-5)')
br
class-attribute
instance-attribute
br: Optional[float] = Field(default=None, description='Threshold saturation level\t(SWAN default: 1.75e-3)')
current
class-attribute
instance-attribute
current: bool = Field(default=False, description='Indicates that enhanced current-induced dissipation as proposed by Van der Westhuysen (2012) is to be added')
cds3
class-attribute
instance-attribute
cds3: Optional[float] = Field(default=None, description='Proportionality coefficient (SWAN default: 0.8)')
Functions
cmd
Command file string for this component.
Source code in rompy_swan/components/physics.py
Quadruplet interactions
QUADRUPL
Bases: BaseComponent
Nonlinear quadruplet wave interactions.
.. code-block:: text
QUADRUPL [iquad] [lambda] [cnl4] [Csh1] [Csh2] [Csh3]
With this option the user can influence the computation of nonlinear quadruplet
wave interactions which are usually included in the computations. Can be
de-activated with command OFF QUAD. Note that the DIA approximation of the
quadruplet interactions is a poor approximation for long-crested waves and
frequency resolutions that are deviating much more than 10% (see command CGRID).
Note that DIA is usually updated per sweep, either semi-implicit (iquad = 1) or
explicit (iquad = 2). However, when ambient current is included, the bounds of
the directional sector within a sweep may be different for each frequency bin
(particularly the higher frequencies are modified by the current). So there may be
some overlap of frequency bins between the sweeps, implying non-conservation of
wave energy. To prevent this the user is advised to choose the integration of DIA
per iteration instead of per sweep, i.e. iquad = 3. If you want to speed up your
computation a bit more, than the choice iquad = 8 is a good choice.
Examples
.. ipython:: python :okwarning:
from rompy_swan.components.physics import QUADRUPL
quadrupl = QUADRUPL()
print(quadrupl.render())
kwargs = dict(
iquad=3, lambd=0.25, cnl4=3.0e7, csh1=5.5, csh2=0.833333, csh3=-1.25
)
quadrupl = QUADRUPL(**kwargs)
print(quadrupl.render())
Source code in rompy_swan/components/physics.py
658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 | |
Attributes
model_type
class-attribute
instance-attribute
model_type: Literal['quadrupl', 'QUADRUPL'] = Field(default='quadrupl', description='Model type discriminator')
iquad
class-attribute
instance-attribute
iquad: Optional[Literal[1, 2, 3, 8, 4, 51, 52, 53]] = Field(default=None, description='Numerical procedures for integrating the quadruplets: 1 = semi-implicit per sweep, 2 = explicit per sweep, 3 = explicit per iteration, 8 = explicit per iteration, but with a more efficient implementation, 4 = multiple DIA, 51 = XNL (deep water transfer), 52 = XNL (deep water transfer with WAM depth scaling), 53 XNL (finite depth transfer) (SWAN default: 2)')
lambd
class-attribute
instance-attribute
lambd: Optional[float] = Field(default=None, description='Coefficient for quadruplet configuration in case of DIA (SWAN default: 0.25)')
cnl4
class-attribute
instance-attribute
cnl4: Optional[float] = Field(default=None, description='Proportionality coefficient for quadruplet interactions in case of DIA (SWAN default: 3.0e7')
csh1
class-attribute
instance-attribute
csh1: Optional[float] = Field(default=None, description='Coefficient for shallow water scaling in case of DIA (SWAN default: 5.5)')
csh2
class-attribute
instance-attribute
csh2: Optional[float] = Field(default=None, description='Coefficient for shallow water scaling in case of DIA (SWAN default: 0.833333)')
csh3
class-attribute
instance-attribute
csh3: Optional[float] = Field(default=None, description='Coefficient for shallow water scaling in case of DIA (SWAN default: -1.25)')
Functions
cmd
Command file string for this component.
Source code in rompy_swan/components/physics.py
Wave breaking
BREAKING_CONSTANT
Bases: BaseComponent
Constant wave breaking index.
.. code-block:: text
BREAKING CONSTANT [alpha] [gamma]
Indicates that a constant breaker index is to be used.
Examples
.. ipython:: python :okwarning:
from rompy_swan.components.physics import BREAKING_CONSTANT
breaking = BREAKING_CONSTANT()
print(breaking.render())
breaking = BREAKING_CONSTANT(alpha=1.0, gamma=0.73)
print(breaking.render())
Source code in rompy_swan/components/physics.py
Attributes
model_type
class-attribute
instance-attribute
model_type: Literal['constant', 'CONSTANT'] = Field(default='constant', description='Model type discriminator')
alpha
class-attribute
instance-attribute
alpha: Optional[float] = Field(default=None, description='Proportionality coefficient of the rate of dissipation (SWAN default: 1.0)')
gamma
class-attribute
instance-attribute
gamma: Optional[float] = Field(default=None, description='The breaker index, i.e. the ratio of maximum individual wave height over depth (SWAN default: 0.73)')
Functions
cmd
Command file string for this component.
Source code in rompy_swan/components/physics.py
BREAKING_BKD
Bases: BaseComponent
Variable wave breaking index.
.. code-block:: text
BREAKING BKD [alpha] [gamma0] [a1] [a2] [a3]
Indicates that the breaker index scales with both the bottom slope (beta)
and the dimensionless depth (kd).
Examples
.. ipython:: python :okwarning:
from rompy_swan.components.physics import BREAKING_BKD
breaking = BREAKING_BKD()
print(breaking.render())
breaking = BREAKING_BKD(alpha=1.0, gamma0=0.54, a1=7.59, a2=-8.06, a3=8.09)
print(breaking.render())
Source code in rompy_swan/components/physics.py
Attributes
model_type
class-attribute
instance-attribute
alpha
class-attribute
instance-attribute
alpha: Optional[float] = Field(default=None, description='Proportionality coefficient of the rate of dissipation (SWAN default: 1.0)')
gamma0
class-attribute
instance-attribute
gamma0: Optional[float] = Field(default=None, description='The reference $gamma$ for horizontal slopes (SWAN default: 0.54)')
a1
class-attribute
instance-attribute
a1: Optional[float] = Field(default=None, description='First tunable coefficient for the breaker index (SWAN default: 7.59)')
a2
class-attribute
instance-attribute
a2: Optional[float] = Field(default=None, description='Second tunable coefficient for the breaker index (SWAN default: -8.06)')
a3
class-attribute
instance-attribute
a3: Optional[float] = Field(default=None, description='Third tunable coefficient for the breaker index (SWAN default: 8.09)')
Functions
cmd
Command file string for this component.
Source code in rompy_swan/components/physics.py
Bottom friction
FRICTION_JONSWAP
Bases: BaseComponent
Hasselmann et al. (1973) Jonswap friction.
.. code-block:: text
FRICTION JONSWAP CONSTANT [cfjon]
Indicates that the semi-empirical expression derived from the JONSWAP results for bottom friction dissipation (Hasselmann et al., 1973, JONSWAP) should be activated. This option is default.
References
Hasselmann, K., Barnett, T.P., Bouws, E., Carlson, H., Cartwright, D.E., Enke, K., Ewing, J.A., Gienapp, A., Hasselmann, D.E., Kruseman, P. and Meerburg, A., 1973. Measurements of wind-wave growth and swell decay during the Joint North Sea Wave Project (JONSWAP). Deutches Hydrographisches Institut, Hamburg, Germany, Rep. No. 12, 95 pp.
Examples
.. ipython:: python :okwarning:
from rompy_swan.components.physics import FRICTION_JONSWAP
friction = FRICTION_JONSWAP()
print(friction.render())
friction = FRICTION_JONSWAP(cfjon=0.038)
print(friction.render())
TODO: Implement VARIABLE option?
Source code in rompy_swan/components/physics.py
Attributes
model_type
class-attribute
instance-attribute
model_type: Literal['jonswap', 'JONSWAP'] = Field(default='jonswap', description='Model type discriminator')
cfjon
class-attribute
instance-attribute
cfjon: Optional[float] = Field(default=None, description='Coefficient of the JONSWAP formulation (SWAN default: 0.038)')
Functions
cmd
FRICTION_COLLINS
Bases: BaseComponent
Collins (1972) friction.
.. code-block:: text
FRICTION COLLINS [cfw]
Note that cfw is allowed to vary over the computational region; in that case use
the commands INPGRID FRICTION and READINP FRICTION to define and read the friction
data. This command FRICTION is still required to define the type of friction
expression. The value of cfw in this command is then not required (it will be
ignored).
References
Collins, J.I., 1972. Prediction of shallow-water spectra. Journal of Geophysical Research, 77(15), pp.2693-2707.
Examples
.. ipython:: python :okwarning:
from rompy_swan.components.physics import FRICTION_COLLINS
friction = FRICTION_COLLINS()
print(friction.render())
friction = FRICTION_COLLINS(cfw=0.038)
print(friction.render())
Source code in rompy_swan/components/physics.py
Attributes
model_type
class-attribute
instance-attribute
model_type: Literal['collins', 'COLLINS'] = Field(default='collins', description='Model type discriminator')
cfw
class-attribute
instance-attribute
cfw: Optional[float] = Field(default=None, description='Collins bottom friction coefficient (SWAN default: 0.015)')
Functions
FRICTION_MADSEN
Bases: BaseComponent
Madsen et al (1988) friction.
.. code-block:: text
FRICTION MADSEN [kn]
Note that kn is allowed to vary over the computational region; in that case use
the commands INPGRID FRICTION and READINP FRICTION to define and read the friction
data. This command FRICTION is still required to define the type of friction
expression. The value of kn in this command is then not required (it will be
ignored).
References
Madsen, O.S., Poon, Y.K. and Graber, H.C., 1988. Spectral wave attenuation by bottom friction: Theory. In Coastal engineering 1988 (pp. 492-504).
Madsen, O.S. and Rosengaus, M.M., 1988. Spectral wave attenuation by bottom friction: Experiments. In Coastal Engineering 1988 (pp. 849-857).
Examples
.. ipython:: python :okwarning:
from rompy_swan.components.physics import FRICTION_MADSEN
friction = FRICTION_MADSEN()
print(friction.render())
friction = FRICTION_MADSEN(kn=0.038)
print(friction.render())
Source code in rompy_swan/components/physics.py
Attributes
model_type
class-attribute
instance-attribute
model_type: Literal['madsen', 'MADSEN'] = Field(default='madsen', description='Model type discriminator')
kn
class-attribute
instance-attribute
kn: Optional[float] = Field(default=None, description='equivalent roughness length scale of the bottom (in m) (SWAN default: 0.05)')
Functions
FRICTION_RIPPLES
Bases: BaseComponent
Smith et al. (2011) Ripples friction.
.. code-block:: text
FRICTION RIPPLES [S] [D]
Indicates that the expression of Smith et al. (2011) should be activated. Here friction depends on the formation of bottom ripples and sediment size.
References
Smith, G.A., Babanin, A.V., Riedel, P., Young, I.R., Oliver, S. and Hubbert, G., 2011. Introduction of a new friction routine into the SWAN model that evaluates roughness due to bedform and sediment size changes. Coastal Engineering, 58(4), pp.317-326.
Examples
.. ipython:: python :okwarning:
from rompy_swan.components.physics import FRICTION_RIPPLES
friction = FRICTION_RIPPLES()
print(friction.render())
friction = FRICTION_RIPPLES(s=2.65, d=0.0001)
print(friction.render())
Source code in rompy_swan/components/physics.py
Attributes
model_type
class-attribute
instance-attribute
model_type: Literal['ripples', 'RIPPLES'] = Field(default='ripples', description='Model type discriminator')
s
class-attribute
instance-attribute
s: Optional[float] = Field(default=None, description='The specific gravity of the sediment (SWAN default: 2.65)')
d
class-attribute
instance-attribute
d: Optional[float] = Field(default=None, description='The sediment diameter (in m) (SWAN default: 0.0001)')
Functions
cmd
Command file string for this component.
Wave triads
TRIAD
Bases: BaseComponent
Wave triad interactions.
.. code-block:: text
TRIAD [itriad] [trfac] [cutfr] [a] [b] [urcrit] [urslim]
With this command the user can activate the triad wave-wave interactions. If this command is not used, SWAN will not account for triads.
Note
This is the TRIAD specification in SWAN < 41.45.
Examples
.. ipython:: python :okwarning:
from rompy_swan.components.physics import TRIAD
triad = TRIAD()
print(triad.render())
triad = TRIAD(
itriad=1,
trfac=0.8,
cutfr=2.5,
a=0.95,
b=-0.75,
ucrit=0.2,
urslim=0.01,
)
print(triad.render())
Source code in rompy_swan/components/physics.py
1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 | |
Attributes
model_type
class-attribute
instance-attribute
model_type: Literal['triad', 'TRIAD'] = Field(default='triad', description='Model type discriminator')
itriad
class-attribute
instance-attribute
itriad: Optional[Literal[1, 2]] = Field(default=None, description='Approximation method for the triad computation: \n\n* 1: the LTA method of Eldeberky (1996) \n* 2: the SPB method of Becq-Girard et al. (1999) (SWAN default: 1)')
trfac
class-attribute
instance-attribute
trfac: Optional[float] = Field(default=None, description='Proportionality coefficient (SWAN default: 0.8 in case of LTA method, 0.9 in case of SPB method)')
cutfr
class-attribute
instance-attribute
cutfr: Optional[float] = Field(default=None, description='Controls the maximum frequency that is considered in the LTA computation. The value of `cutfr` is the ratio of this maximum frequency over the mean frequency (SWAN default: 2.5)')
a
class-attribute
instance-attribute
a: Optional[float] = Field(default=None, description='First calibration parameter for tuning K in Eq. (5.1) of Becq-Girard et al. (1999). This parameter is associated with broadening of the resonance condition (SWAN default: 0.95)')
b
class-attribute
instance-attribute
b: Optional[float] = Field(default=None, description='Second calibration parameter for tuning K in Eq. (5.1) of Becq-Girard et al. (1999). This parameter is associated with broadening of the resonance condition (SWAN default: -0.75 for 1D, 0.0 for 2D')
ucrit
class-attribute
instance-attribute
ucrit: Optional[float] = Field(default=None, description='The critical Ursell number appearing in the expression for the biphase (SWAN default: 0.2)')
urslim
class-attribute
instance-attribute
urslim: Optional[float] = Field(default=None, description='The lower threshold for Ursell number, if the actual Ursell number is below this value triad interactions are be computed (SWAN default: 0.01)')
Functions
cmd
Command file string for this component.
Source code in rompy_swan/components/physics.py
TRIAD_DCTA
Bases: BaseComponent
Triad interactions with the DCTA method of Booij et al. (2009).
.. code-block:: text
TRIAD DCTA [trfac] [p] COLL|NONC BIPHHASE ELDEBERKY|DEWIT
References
Booij, N., Holthuijsen, L.H. and Bénit, M.P., 2009. A distributed collinear triad approximation in SWAN. In Proceedings Of Coastal Dynamics 2009: Impacts of Human Activities on Dynamic Coastal Processes (With CD-ROM) (pp. 1-10).
Note
This is the default method to compute the triad interactions in SWAN >= 41.45, it is not supported in earlier versions of the model.
Examples
.. ipython:: python :okwarning:
from rompy_swan.components.physics import TRIAD_DCTA
triad = TRIAD_DCTA()
print(triad.render())
triad = TRIAD_DCTA(
trfac=4.4,
p=1.3,
noncolinear=True,
biphase={"model_type": "dewit", "lpar": 0.0},
)
print(triad.render())
Source code in rompy_swan/components/physics.py
1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 | |
Attributes
model_type
class-attribute
instance-attribute
trfac
class-attribute
instance-attribute
trfac: Optional[float] = Field(default=None, description='Scaling factor that controls the intensity of the triad interaction due to DCTA (SWAN default: 4.4)')
p
class-attribute
instance-attribute
p: Optional[float] = Field(default=None, description='Shape coefficient to force the high-frequency tail(SWAN default: 4/3)')
noncolinear
class-attribute
instance-attribute
noncolinear: bool = Field(default=False, description='If True, the noncolinear triad interactions with the DCTA framework are accounted for')
biphase
class-attribute
instance-attribute
biphase: Optional[Union[ELDEBERKY, DEWIT]] = Field(default=None, description='Defines the parameterization of biphase (self-self interaction) (SWAN default: ELDEBERKY)')
Functions
cmd
Command file string for this component.
Source code in rompy_swan/components/physics.py
TRIAD_LTA
Bases: BaseComponent
Triad interactions with the LTA method of Eldeberky (1996).
.. code-block:: text
TRIAD LTA [trfac] [cutfr] BIPHHASE ELDEBERKY|DEWIT
References
Eldeberky, Y., Polnikov, V. and Battjes, J.A., 1996. A statistical approach for modeling triad interactions in dispersive waves. In Coastal Engineering 1996 (pp. 1088-1101).
Note
This method to compute the triad interactions is only supported in SWAN >= 41.45.
Examples
.. ipython:: python :okwarning:
from rompy_swan.components.physics import TRIAD_LTA
triad = TRIAD_LTA()
print(triad.render())
triad = TRIAD_LTA(
trfac=0.8,
cutfr=2.5,
biphase={"model_type": "eldeberky", "urcrit": 0.63},
)
print(triad.render())
Source code in rompy_swan/components/physics.py
1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 | |
Attributes
model_type
class-attribute
instance-attribute
trfac
class-attribute
instance-attribute
trfac: Optional[float] = Field(default=None, description='Scaling factor that controls the intensity of the triad interaction due to LTA (SWAN default: 0.8)')
cutfr
class-attribute
instance-attribute
cutfr: Optional[float] = Field(default=None, description='Controls the maximum frequency that is considered in the LTA computation. The value of `cutfr` is the ratio of this maximum frequency over the mean frequency (SWAN default: 2.5)')
biphase
class-attribute
instance-attribute
biphase: Optional[Union[ELDEBERKY, DEWIT]] = Field(default=None, description='Defines the parameterization of biphase (self-self interaction) (SWAN default: ELDEBERKY)')
Functions
cmd
Command file string for this component.
Source code in rompy_swan/components/physics.py
TRIAD_SPB
Bases: BaseComponent
Triad interactions with the SPB method of Becq-Girard et al. (1999).
.. code-block:: text
TRIAD SPB [trfac] [a] [b] BIPHHASE ELDEBERKY|DEWIT
References
Becq-Girard, F., Forget, P. and Benoit, M., 1999. Non-linear propagation of unidirectional wave fields over varying topography. Coastal Engineering, 38(2), pp.91-113.
Note
This method to compute the triad interactions is only supported in SWAN >= 41.45.
Examples
.. ipython:: python :okwarning:
from rompy_swan.components.physics import TRIAD_SPB
triad = TRIAD_SPB()
print(triad.render())
triad = TRIAD_SPB(
trfac=0.9,
a=0.95,
b=0.0,
biphase={"model_type": "eldeberky", "urcrit": 0.63},
)
print(triad.render())
Source code in rompy_swan/components/physics.py
1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 | |
Attributes
model_type
class-attribute
instance-attribute
trfac
class-attribute
instance-attribute
trfac: Optional[float] = Field(default=None, description='Scaling factor that controls the intensity of the triad interaction due to SPB (SWAN default: 0.9)')
a
class-attribute
instance-attribute
a: Optional[float] = Field(default=None, description='First calibration parameter for tuning K in Eq. (5.1) of Becq-Girard et al. (1999). This parameter is associated with broadening of the resonance condition. The default value is 0.95 and is calibrated by means of laboratory experiments (SWAN default: 0.95)')
b
class-attribute
instance-attribute
b: Optional[float] = Field(default=None, description='Second calibration parameter for tuning K in Eq. (5.1) of Becq-Girard et al. (1999). This parameter is associated with broadening of the resonance condition. The default value is -0.75 and is calibrated by means of laboratory experiments. However, it may not be appropriate for true 2D field cases as it does not scale with the wave field characteristics. Hence, this parameter is set to zero (SWAN default: 0.0)')
biphase
class-attribute
instance-attribute
biphase: Optional[Union[ELDEBERKY, DEWIT]] = Field(default=None, description='Defines the parameterization of biphase (self-self interaction) (SWAN default: ELDEBERKY)')
Functions
cmd
Command file string for this component.
Source code in rompy_swan/components/physics.py
Vegetaion dumping
VEGETATION
Bases: BaseComponent
Vegetation dumping.
.. code-block:: text
VEGETATION [iveg] < [height] [diamtr] [nstems] [drag] >
With this command the user can activate wave damping due to vegetation based on the Dalrymple's formula (1984) as implemented by Suzuki et al. (2011). This damping is uniform over the wave frequencies. An alternative is the frequency-dependent (canopy) dissipation model of Jacobsen et al. (2019). If this command is not used, SWAN will not account for vegetation effects.
The vegetation (rigid plants) can be divided over a number of vertical segments and so, the possibility to vary the vegetation vertically is included. Each vertical layer represents some characteristics of the plants. These variables as indicated below can be repeated as many vertical layers to be chosen.
References
Dalrymple, R.A., Kirby, J.T. and Hwang, P.A., 1984. Wave diffraction due to areas of energy dissipation. Journal of waterway, port, coastal, and ocean engineering, 110(1), pp.67-79.
Jacobsen, N.G., Bakker, W., Uijttewaal, W.S. and Uittenbogaard, R., 2019. Experimental investigation of the wave-induced motion of and force distribution along a flexible stem. Journal of Fluid Mechanics, 880, pp.1036-1069.
Suzuki, T., Zijlema, M., Burger, B., Meijer, M.C. and Narayan, S., 2012. Wave dissipation by vegetation with layer schematization in SWAN. Coastal Engineering, 59(1), pp.64-71.
Notes
Vertical layering of the vegetation is not yet implemented for the Jacobsen et al. (2019) method.
Examples
.. ipython:: python :okwarning:
from rompy_swan.components.physics import VEGETATION
# Single layer
vegetation = VEGETATION(
height=1.2,
diamtr=0.1,
drag=0.5,
nstems=10,
)
print(vegetation.render())
# 2 vertical layers
vegetation = VEGETATION(
iveg=1,
height=[1.2, 0.8],
diamtr=[0.1, 0.1],
drag=[0.5, 0.5],
nstems=[10, 5],
)
print(vegetation.render())
Source code in rompy_swan/components/physics.py
1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 | |
Attributes
model_type
class-attribute
instance-attribute
model_type: Literal['vegetation', 'VEGETATION'] = Field(default='vegetation', description='Model type discriminator')
iveg
class-attribute
instance-attribute
iveg: Literal[1, 2] = Field(default=1, description='Indicates the method for the vegetation computation (SWAN default: 1):\n\n* 1: Suzuki et al. (2011)\n* 2: Jacobsen et al. (2019)\n')
height
class-attribute
instance-attribute
diamtr
class-attribute
instance-attribute
diamtr: Union[float, list[float]] = Field(description='The diameter of each plant stand per layer (in m)')
drag
class-attribute
instance-attribute
nstems
class-attribute
instance-attribute
nstems: Union[int, list[int]] = Field(default=1, description='The number of plant stands per square meter for each layer. Note that `nstems` is allowed to vary over the computational region to account for the zonation of vegetation. In that case use the commands `IMPGRID NPLANTS` and `READINP NPLANTS` to define and read the vegetation density. The (vertically varying) value of `nstems` in this command will be multiplied by this horizontally varying plant density (SWAN default: 1)', validate_default=True)
Functions
number_of_layers
classmethod
Source code in rompy_swan/components/physics.py
jacomsen_layering_not_implemented
jacomsen_layering_not_implemented() -> VEGETATION
Source code in rompy_swan/components/physics.py
cmd
Command file string for this component.
Source code in rompy_swan/components/physics.py
Mud dumping
MUD
Bases: BaseComponent
Mud dumping.
.. code-block:: text
MUD [layer] [rhom] [viscm]
With this command the user can activate wave damping due to mud based on Ng (2000). If this command or the commands INPGRID MUDLAY and READINP MUDLAY are not used, SWAN will not account for muddy bottom effects.
References
Ng, C., 2000, Water waves over a muddy bed: A two layer Stokes' boundary layer model, Coastal Eng., 40, 221-242.
Examples
.. ipython:: python :okwarning:
from rompy_swan.components.physics import MUD
mud = MUD()
print(mud.render())
mud = MUD(
layer=2.0,
rhom=1300,
viscm=0.0076,
)
print(mud.render())
TODO: Validate layer must be prescribed if INPGRID MUDLAY isn't used.
Source code in rompy_swan/components/physics.py
1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 | |
Attributes
model_type
class-attribute
instance-attribute
layer
class-attribute
instance-attribute
layer: Optional[float] = Field(default=None, description='The thickness of the mud layer (in m). Note that `layer` is allowed to vary over the computational region to account for the zonation of muddy bottom. In that case use the commands `INPGRID MUDLAY` and `READINP MUDLAY` to define and read the layer thickness of mud. The value of `layer` in this command is then not required (it will be ignored)')
rhom
class-attribute
instance-attribute
rhom: Optional[float] = Field(default=None, description='The density of the mud layer (in kg/m3) (SWAN default: 1300)')
viscm
class-attribute
instance-attribute
viscm: Optional[float] = Field(default=None, description='The kinematic viscosity of the mud layer (in m2/s) (SWAN default: 0.0076)')
Functions
cmd
Command file string for this component.
Source code in rompy_swan/components/physics.py
Sea ice dissipation
SICE
Bases: BaseComponent
Sea ice dissipation.
.. code-block:: text
SICE [aice]
Using this command, the user activates a sink term to represent the dissipation of wave energy by sea ice. The default method is R19 empirical/parametric: a polynomial based on wave frequency (Rogers, 2019). This polynomial (in 1/m) has seven dimensional coefficients; see Scientific/Technical documentation for details. If this command is not used, SWAN will not account for sea ice effects.
References
Doble, M.J., De Carolis, G., Meylan, M.H., Bidlot, J.R. and Wadhams, P., 2015. Relating wave attenuation to pancake ice thickness, using field measurements and model results. Geophysical Research Letters, 42(11), pp.4473-4481.
Meylan, M.H., Bennetts, L.G. and Kohout, A.L., 2014. In situ measurements and analysis of ocean waves in the Antarctic marginal ice zone. Geophysical Research Letters, 41(14), pp.5046-5051.
Rogers, W.E., Meylan, M.H. and Kohout, A.L., 2018. Frequency distribution of dissipation of energy of ocean waves by sea ice using data from Wave Array 3 of the ONR “Sea State” field experiment. Nav. Res. Lab. Memo. Rep, pp.18-9801.
Rogers, W.E., Meylan, M.H. and Kohout, A.L., 2021. Estimates of spectral wave attenuation in Antarctic sea ice, using model/data inversion. Cold Regions Science and Technology, 182, p.103198.
Notes
Iis also necessary to describe the ice, using the ICE command (for uniform and
stationary ice) or INPGRID/READINP commands (for variable ice).
Examples
.. ipython:: python :okwarning:
from rompy_swan.components.physics import SICE
sice = SICE()
print(sice.render())
sice = SICE(aice=0.5)
print(sice.render())
TODO: Verify if the aice parameter should be used with SICE command, it is not
shown in the command tree but it is described as an option in the description.
Source code in rompy_swan/components/physics.py
1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 | |
Attributes
model_type
class-attribute
instance-attribute
aice
class-attribute
instance-attribute
aice: Optional[float] = Field(default=None, description='Ice concentration as a fraction from 0 to 1. Note that `aice` is allowed to vary over the computational region to account for the zonation of ice concentration. In that case use the commands `INPGRID AICE` and `READINP AICE` to define and read the sea concentration. The value of `aice` in this command is then not required (it will be ignored)', ge=0.0, le=1.0)
Functions
SICE_R19
Bases: SICE
Sea ice dissipation based on the method of Rogers et al (2019).
.. code-block:: text
SICE [aice] R19 [c0] [c1] [c2] [c3] [c4] [c5] [c6]
The default options recover the polynomial of Meylan et al. (2014), calibrated for a case of ice floes, mostly 10 to 25 m in diameter, in the marginal ice zone near Antarctica. Examples for other calibrations can be found in the Scientific/Technical documentation.
References
Meylan, M.H., Bennetts, L.G. and Kohout, A.L., 2014. In situ measurements and analysis of ocean waves in the Antarctic marginal ice zone. Geophysical Research Letters, 41(14), pp.5046-5051.
Rogers, W.E., Meylan, M.H. and Kohout, A.L., 2018. Frequency distribution of dissipation of energy of ocean waves by sea ice using data from Wave Array 3 of the ONR “Sea State” field experiment. Nav. Res. Lab. Memo. Rep, pp.18-9801.
Examples
.. ipython:: python :okwarning:
from rompy_swan.components.physics import SICE_R19
sice = SICE_R19()
print(sice.render())
kwargs = dict(
aice=0.5,
c0=0.0,
c1=0.0,
c2=1.06e-3,
c3=0.0,
c4=0.0,
c5=0.0,
c6=0.0,
)
sice = SICE_R19(**kwargs)
print(sice.render())
Source code in rompy_swan/components/physics.py
1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 | |
Attributes
model_type
class-attribute
instance-attribute
c0
class-attribute
instance-attribute
c0: Optional[float] = Field(default=None, description='Polynomial coefficient (in 1/m) for determining the rate of sea ice dissipation (SWAN default: 0.0)')
c1
class-attribute
instance-attribute
c1: Optional[float] = Field(default=None, description='Polynomial coefficient (in s/m) for determining the rate of sea ice dissipation (SWAN default: 0.0)')
c2
class-attribute
instance-attribute
c2: Optional[float] = Field(default=None, description='Polynomial coefficient (in s2/m) for determining the rate of sea ice dissipation (SWAN default: 1.06E-3)')
c3
class-attribute
instance-attribute
c3: Optional[float] = Field(default=None, description='Polynomial coefficient (in s3/m) for determining the rate of sea ice dissipation (SWAN default: 0.0)')
c4
class-attribute
instance-attribute
c4: Optional[float] = Field(default=None, description='Polynomial coefficient (in s4/m) for determining the rate of sea ice dissipation (SWAN default: 2.3E-2)')
c5
class-attribute
instance-attribute
c5: Optional[float] = Field(default=None, description='Polynomial coefficient (in s5/m) for determining the rate of sea ice dissipation (SWAN default: 0.0)')
c6
class-attribute
instance-attribute
c6: Optional[float] = Field(default=None, description='Polynomial coefficient (in s6/m) for determining the rate of sea ice dissipation (SWAN default: 0.0)')
Functions
cmd
Command file string for this component.
Source code in rompy_swan/components/physics.py
SICE_D15
Bases: SICE
Sea ice dissipation based on the method of Doble et al. (2015).
.. code-block:: text
SICE [aice] D15 [chf]
References
Doble, M.J., De Carolis, G., Meylan, M.H., Bidlot, J.R. and Wadhams, P., 2015. Relating wave attenuation to pancake ice thickness, using field measurements and model results. Geophysical Research Letters, 42(11), pp.4473-4481.
Examples
.. ipython:: python :okwarning:
from rompy_swan.components.physics import SICE_D15
sice = SICE_D15()
print(sice.render())
sice = SICE_D15(aice=0.2, chf=0.1)
print(sice.render())
Source code in rompy_swan/components/physics.py
SICE_M18
Bases: SICE
Sea ice dissipation based on the method of Meylan et al. (2018).
.. code-block:: text
SICE [aice] M18 [chf]
References
Meylan, M.H., Bennetts, L.G. and Kohout, A.L., 2014. In situ measurements and analysis of ocean waves in the Antarctic marginal ice zone. Geophysical Research Letters, 41(14), pp.5046-5051.
Examples
.. ipython:: python :okwarning:
from rompy_swan.components.physics import SICE_M18
sice = SICE_M18()
print(sice.render())
sice = SICE_M18(aice=0.8, chf=0.059)
print(sice.render())
Source code in rompy_swan/components/physics.py
SICE_R21B
Bases: SICE
Sea ice dissipation based on the method of Rogers et al. (2021).
.. code-block:: text
SICE [aice] R21B [chf] [npf]
References
Rogers, W.E., Meylan, M.H. and Kohout, A.L., 2021. Estimates of spectral wave attenuation in Antarctic sea ice, using model/data inversion. Cold Regions Science and Technology, 182, p.103198.
Examples
.. ipython:: python :okwarning:
from rompy_swan.components.physics import SICE_R21B
sice = SICE_R21B()
print(sice.render())
sice = SICE_R21B(aice=0.8, chf=2.9, npf=4.5)
print(sice.render())
Source code in rompy_swan/components/physics.py
Attributes
model_type
class-attribute
instance-attribute
chf
class-attribute
instance-attribute
chf: Optional[float] = Field(default=None, description='A simple coefficient of proportionality (SWAN default: 2.9)')
npf
class-attribute
instance-attribute
npf: Optional[float] = Field(default=None, description='Controls the degree of dependence on frequency and ice thickness (SWAN default: 4.5)')
Functions
cmd
Command file string for this component.
Source code in rompy_swan/components/physics.py
Turbulent viscosity
TURBULENCE
Bases: BaseComponent
Turbulent viscosity.
.. code-block:: text
TURBULENCE [ctb] (CURRENT [tbcur])
With this optional command the user can activate turbulent viscosity. This physical
effect is also activated by reading values of the turbulent viscosity using the
READGRID TURB command, but then with the default value of ctb. The command
READGRID TURB is necessary if this command TURB is used since the value of the
viscosity is assumed to vary over space.
Examples
.. ipython:: python :okwarning:
from rompy_swan.components.physics import TURBULENCE
turbulence = TURBULENCE(current=False)
print(turbulence.render())
turbulence = TURBULENCE(ctb=0.01, current=True, tbcur=0.004)
print(turbulence.render())
Source code in rompy_swan/components/physics.py
2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 | |
Attributes
model_type
class-attribute
instance-attribute
model_type: Literal['turbulence', 'TURBULENCE'] = Field(default='turbulence', description='Model type discriminator')
ctb
class-attribute
instance-attribute
ctb: Optional[float] = Field(default=None, description='The value of the proportionality coefficient appearing in the energy dissipation term (SWAN default: 0.01)')
current
class-attribute
instance-attribute
current: Optional[bool] = Field(default=True, description='If this keyword is present the turbulent viscosity will be derived from the product of the depth and the absolute value of the current velocity. If the command `READGRID TURB` is used, this option is ignored; the values read from file will prevail')
tbcur
class-attribute
instance-attribute
tbcur: Optional[float] = Field(default=None, description='The factor by which depth x current velocity is multiplied in order to get the turbulent viscosity (SWAN default: 0.004)')
Functions
tbcur_only_with_current
tbcur_only_with_current() -> TURBULENCE
cmd
Command file string for this component.
Source code in rompy_swan/components/physics.py
Bragg scattering
BRAGG
Bases: BaseComponent
Bragg scattering.
.. code-block:: text
BRAGG [ibrag] [nreg] [cutoff]
Using this optional command, the user activates a source term to represent the scattering of waves due to changes in the small-scale bathymetry based on the theory of Ardhuin and Herbers (2002). If this command is not used, SWAN will not account for Bragg scattering.
The underlying process is related to the bed elevation spectrum that describes the
random variability of the bathymetry at the scale of the wave length on top of a
slowly varying depth. To input this spectrum in the model, two options are
available. One option is to read a spectrum from a file. This single bottom
spectrum will subsequently be applied in all active grid points. The assumption
being made here is that the inputted bottom is gently sloping. Note that the bottom
spectrum must be given as a function of the wave number k.
Another option is to compute the spectrum by a Fourier transform from x to k of
the bed modulations around a computational grid point. First, one must define a
square region with a fixed size around the grid point in order to perform the
Fourier transform. The size should correspond to a multiple of the wave length at
which refraction is resolved (i.e. consistent with the mild slope assumption).
Next, the amplitude modulation of the small-scale bathymetry is obtained by
substracting a slowly varying bed level from the inputted high-resolution
bathymetric data within this square region. Here, the smooth bed level is achieved
using a bilinear fit. During the computation, however, SWAN employs the gently
sloping bed as the mean of the original bathymetry within the given square around
each computational grid point. Finally, the corresponding bottom spectrum is
computed with an FFT.
Notes
The Bragg scattering source term to the action balance equation gives rise to a
fairly stiff equation. The best remedy is to run SWAN in the nonstationary mode
with a relatively small time step or in the stationary mode with some under
relaxation (see command NUM STAT [alfa]).
Examples
.. ipython:: python :okwarning:
from rompy_swan.components.physics import BRAGG
bragg = BRAGG(nreg=200)
print(bragg.render())
bragg = BRAGG(ibrag=1, nreg=200, cutoff=5.0)
print(bragg.render())
Source code in rompy_swan/components/physics.py
2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 | |
Attributes
model_type
class-attribute
instance-attribute
model_type: Literal['bragg', 'BRAGG'] = Field(default='bragg', description='Model type discriminator')
ibrag
class-attribute
instance-attribute
ibrag: Optional[Literal[1, 2, 3]] = Field(default=None, description='Indicates the computation of Bragg scattering term:\n\n* 1: source term is calculated per sweep and bottom spectrum is interpolated at the difference wave number a priori (thus requiring storage)\n* 2: source term is calculated per sweep and bottom spectrum is interpolated at the difference wave number per sweep (no storage)\n* 3: source term is calculated per iteration and bottom spectrum is interpolated at the difference wave number per iteration (no storage)\n\n(SWAN default: 1)')
nreg
class-attribute
instance-attribute
nreg: int = Field(description='Size of square region around computational grid point (centered) for computing the mean depth and, if desired, the bed elevation spectrum. It is expressed in terms of the number of grid points (per direction) of the inputted bottom grid')
cutoff
class-attribute
instance-attribute
cutoff: Optional[float] = Field(default=None, description='Cutoff to the ratio between surface and bottom wave numbers. Note: seethe Scientific/Technical documentation for details (SWAN default: 5.0)')
Functions
cmd
Command file string for this component.
Source code in rompy_swan/components/physics.py
BRAGG_FT
Bases: BRAGG
Bragg scattering with bottom spectrum computed from FFT.
.. code-block:: text
BRAGG [ibrag] [nreg] [cutoff] FT
If this keyword is present the bottom spectrum will be computed in each active grid point using a Fast Fourier Transform (FFT).
Notes
The depth in each computational grid point is computed as the average of the inputted (high-resolution) bed levels within the square region.
Examples
.. ipython:: python :okwarning:
from rompy_swan.components.physics import BRAGG_FT
bragg = BRAGG_FT(nreg=350)
print(bragg.render())
bragg = BRAGG_FT(ibrag=2, nreg=350, cutoff=5.0)
print(bragg.render())
Source code in rompy_swan/components/physics.py
Attributes
model_type
class-attribute
instance-attribute
Functions
BRAGG_FILE
Bases: BRAGG
Bragg scattering with bottom spectrum from file.
.. code-block:: text
BRAGG [ibrag] [nreg] [cutoff] FILE 'fname' [idla] [mkx] [mky] [dkx] [dky]
The bed elevation spectrum FB(kx, ky) is read from a file.
Notes
This spectrum is taken to be uniform over the entire computational domain.
Examples
.. ipython:: python :okwarning:
from rompy_swan.components.physics import BRAGG_FILE
bragg = BRAGG_FILE(fname="bottom_spectrum.txt", nreg=500, mkx=99, dkx=0.1)
print(bragg.render())
kwargs = dict(
ibrag=3,
nreg=500,
cutoff=5.0,
fname="bottom_spectrum.txt",
mkx=99,
mky=149,
dkx=0.1,
dky=0.1,
)
bragg = BRAGG_FILE(**kwargs)
print(bragg.render())
Source code in rompy_swan/components/physics.py
2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 | |
Attributes
model_type
class-attribute
instance-attribute
fname
class-attribute
instance-attribute
idla
class-attribute
instance-attribute
idla: Optional[IDLA] = Field(default=None, description='Order in which the values should be given in the input files')
mkx
class-attribute
instance-attribute
mkx: int = Field(description='Number of cells in x-direction of the wave number grid related to bottom spectrum (this is one less than the number of points in this direction)')
mky
class-attribute
instance-attribute
mky: Optional[int] = Field(default=None, description='Number of cells in y-direction of the wave number grid related to bottom spectrum (this is one less than the number of points in this direction)(SWAN default: `mky = mkx`)')
dkx
class-attribute
instance-attribute
dkx: float = Field(description='Mesh size in x-direction of the wave number grid related to bottom spectrum (1/m)')
dky
class-attribute
instance-attribute
dky: Optional[float] = Field(default=None, description='Mesh size in y-direction of the wave number grid related to bottom spectrum (1/m) (SWAN default: `dky = dkx`)')
Functions
cmd
Command file string for this component.
Source code in rompy_swan/components/physics.py
Limiter
LIMITER
Bases: BaseComponent
Physics limiter.
.. code-block:: text
LIMITER [ursell] [qb]
With this command the user can de-activate permanently the quadruplets when
the actual Ursell number exceeds ursell. Moreover, as soon as the actual
fraction of breaking waves exceeds qb then the action limiter will not be
used in case of decreasing action density.
Examples
.. ipython:: python :okwarning:
from rompy_swan.components.physics import LIMITER
limiter = LIMITER()
print(limiter.render())
limiter = LIMITER(ursell=10.0, qb=1.0)
print(limiter.render())
Source code in rompy_swan/components/physics.py
Attributes
model_type
class-attribute
instance-attribute
model_type: Literal['limiter', 'LIMITER'] = Field(default='limiter', description='Model type discriminator')
ursell
class-attribute
instance-attribute
ursell: Optional[float] = Field(default=None, description='The upper threshold for Ursell number (SWAN default: 10.0)')
qb
class-attribute
instance-attribute
qb: Optional[float] = Field(default=None, description='The threshold for fraction of breaking waves (SWAN default: 1.0)')
Functions
cmd
Command file string for this component.
Obstacle
OBSTACLE
Bases: BaseComponent
Subgrid obstacle.
.. code-block:: text
OBSTACLE ->TRANSM|TRANS1D|TRANS2D|GODA|DANGREMOND REFL [reflc] ->RSPEC|RDIFF &
(FREEBOARD [hgt] [gammat] [gammar] QUAY) LINE < [xp] [yp] >
With this optional command the user provides the characteristics of a (line of) sub-grid obstacle(s) through which waves are transmitted or against which waves are reflected (possibly both at the same time). The obstacle is sub-grid in the sense that it is narrow compared to the spatial meshes; its length should be at least one mesh length.
The location of the obstacle is defined by a sequence of corner points of a line. The obstacles interrupt the propagation of the waves from one grid point to the next wherever this obstacle line is located between two neighbouring grid points (of the computational grid; the resolution of the obstacle is therefore equal to the computational grid spacing). This implies that an obstacle to be effective must be located such that it crosses at least one grid line. This is always the case when an obstacle is larger than one mesh length.
Notes
- The advise is to define obstacles with the least amount of points possible.
- SWAN checks if the criterion
reflc^2 + trcoef^2 LE 1is fulfilled.
Examples
.. ipython:: python :okwarning:
from rompy_swan.components.physics import OBSTACLE
obs = OBSTACLE(
transmission=dict(model_type="transm", trcoef=0.5),
reflection=dict(reflc=0.5),
line=dict(xp=[174.1, 174.2, 174.3], yp=[-39.1, -39.1, -39.1]),
)
print(obs.render())
Source code in rompy_swan/components/physics.py
2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 | |
Attributes
model_type
class-attribute
instance-attribute
model_type: Literal['obstacle', 'OBSTACLE'] = Field(default='obstacle', description='Model type discriminator')
transmission
class-attribute
instance-attribute
reflection
class-attribute
instance-attribute
reflection: Optional[REFL] = Field(default=None, description='Wave reflection')
reflection_type
class-attribute
instance-attribute
freeboard
class-attribute
instance-attribute
freeboard: Optional[FREEBOARD] = Field(default=None, description='Freeboard')
line
class-attribute
instance-attribute
line: LINE = Field(default=None, description='Line of obstacle')
Functions
hgt_consistent
hgt_consistent() -> OBSTACLE
Warns if hgt has different values in DAM and FREEBOARD specifications.
Source code in rompy_swan/components/physics.py
cmd
Command file string for this component.
Source code in rompy_swan/components/physics.py
OBSTACLE_FIG
Bases: BaseComponent
Obstacle for free infragravity radiation.
.. code-block:: text
OBSTACLE FIG [alpha1] [hss] [tss] (REFL [reflc]) LINE <[xp] [yp]>
With this optional command the user specifies the obstacles along which the free infra-gravity (FIG) energy is radiated. By placing the obstacles close to the shorelines SWAN will include the FIG source term along the coastlines according to the parametrization of Ardhuin et al. (2014).
The location of the obstacle is defined by a sequence of corner points of a line. For an obstacle line to be effective its length is at least one mesh size large. It is recommended to place the obstacles at the inner area of the computational grid, not at or through the boundaries. In particular, each obstacle line must be bordered by wet points on both sides.
In addition, the orientation of the obstacle line determines from which side of the obstacle the FIG wave energy is radiated away. If the begin point of the line is below or left of the end point, that is, pointing upwards/to the right, then FIG energy is radiated from the west/north side of the line. If the begin point is above or right of the end point (pointing downwards/to the left), then FIG energy is radiated away from the east/south side of the obstacle line.
References
Ardhuin, F., Rawat, A. and Aucan, J., 2014. A numerical model for free infragravity waves: Definition and validation at regional and global scales. Ocean Modelling, 77, pp.20-32.
Notes
Either hss or tss or both are allowed to vary over the computational domain.
In that case use the commands INPGRID HSS and READINP HSS and/or the commands
INPGRID TSS and READINP TSS to define and read the sea-swell wave height/period
It is permissible to have constant sea-swell height and non-constant sea-swell
period, or vice versa. The command OBST FIG is still required to define the
obstacles. The values of hss and/or tss in this command are then not required
(they will be ignored).
Examples
.. ipython:: python :okwarning:
from rompy_swan.components.physics import OBSTACLE_FIG
obs = OBSTACLE_FIG(
alpha1=5e-4,
hss=2.5,
tss=10.3,
line=dict(xp=[174.1, 174.2, 174.3], yp=[-39.1, -39.1, -39.1]),
)
print(obs.render())
obs = OBSTACLE_FIG(
alpha1=5e-4,
hss=2.5,
tss=10.3,
reflection=dict(reflc=0.5),
line=dict(xp=[174.1, 174.2, 174.3], yp=[-39.1, -39.1, -39.1]),
)
print(obs.render())
Source code in rompy_swan/components/physics.py
2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 | |
Attributes
model_type
class-attribute
instance-attribute
alpha1
class-attribute
instance-attribute
alpha1: float = Field(description='Calibration parameter (in 1/s) for determining the rate of radiating FIG energy from the shorelines, values in Table 1 of Ardhuin et al. (2014) are between 4e-4 and 8.1e-4')
hss
class-attribute
instance-attribute
tss
class-attribute
instance-attribute
reflection
class-attribute
instance-attribute
reflection: Optional[REFL] = Field(default=None, description='Wave reflection')
Functions
cmd
Command file string for this component.
Source code in rompy_swan/components/physics.py
OBSTACLES
Bases: BaseComponent
List of swan obstacles.
.. code-block:: text
OBSTACLE ... LINE < [xp] [yp] >
OBSTACLE ... LINE < [xp] [yp] >
.
This group component is a convenience to allow defining and rendering a list of obstacle components.
Examples
.. ipython:: python :okwarning:
from rompy_swan.components.physics import OBSTACLES, OBSTACLE, OBSTACLE_FIG
obst1 = dict(
model_type="obstacle",
reflection=dict(reflc=1.0),
line=dict(xp=[174.1, 174.2, 174.3], yp=[-39.1, -39.1, -39.1]),
)
obst2 = OBSTACLE(
transmission=dict(model_type="transm"),
line=dict(xp=[174.3, 174.3], yp=[-39.1, -39.2]),
)
obst3 = OBSTACLE_FIG(
alpha1=5e-4,
hss=2.5,
tss=10.3,
line=dict(xp=[174.1, 174.2, 174.3], yp=[-39.1, -39.1, -39.1]),
)
obstacles = OBSTACLES(obstacles=[obst1, obst2, obst3])
for obst in obstacles.render():
print(obst)
Source code in rompy_swan/components/physics.py
Wave setup
SETUP
Bases: BaseComponent
Wave setup.
.. code-block:: text
SETUP [supcor]
If this command is given, the wave-induced set-up is computed and accounted for in
the wave computations (during the computation it is added to the depth that is
obtained from the READ BOTTOM and READ WLEVEL commands). This approximation in
SWAN can only be applied to open coast (unlimited supply of water from outside the
domain, e.g. nearshore coasts) in contrast to closed basin, e.g. lakes and
estuaries, where this option should not be used. Note that set-up is not computed
correctly with spherical coordinates.
Notes
- The SETUP command cannot be used in case of unstructured grids.
- Set-up is not supported in case of parallel runs using either MPI or OpenMP.
Examples
.. ipython:: python :okwarning:
from rompy_swan.components.physics import SETUP
setup = SETUP()
print(setup.render())
setup = SETUP(supcor=0.5)
print(setup.render())
Source code in rompy_swan/components/physics.py
Attributes
model_type
class-attribute
instance-attribute
model_type: Literal['setup', 'SETUP'] = Field(default='setup', description='Model type discriminator')
supcor
class-attribute
instance-attribute
supcor: Optional[float] = Field(default=None, description='By default the wave-induced set-up is computed with a constant added such that the set-up is zero in the deepest point in the computational grid. The user can modify this constant by the value of `supcor`. The user can thus impose a set-up in any one point (and only one) in the computational grid by first running SWAN, then reading the set-up in that point and adding or subtracting the required value of `supcor` (in m; positive if the set-up has to rise) (SWAN default: 0.0)')
Functions
Wave diffraction
DIFFRACTION
Bases: BaseComponent
Wave diffraction.
.. code-block:: text
DIFFRACTION [idiffr] [smpar] [smnum] [cgmod]
If this optional command is given, the diffraction is included in the wave computation. But the diffraction approximation in SWAN does not properly handle diffraction in harbours or in front of reflecting obstacles (see Scientific/Technical documentation). Behind breakwaters with a down-wave beach, the SWAN results seem reasonable. The spatial resolution near (the tip of) the diffraction obstacle should be 1/5 to 1/10 of the dominant wave length.
Notes
Without extra measures, the diffraction computations with SWAN often converge poorly or not at all. Two measures can be taken:
-
(RECOMMENDED) The user can request under-relaxation. See command
NUMERICparameteralphaand Scientific/Technical documentation (Eq. (3.31)). Very limited experience suggestsalpha = 0.01. -
Alternatively, the user can request smoothing of the wave field for the computation of the diffraction parameter (the wave field remains intact for all other computations and output). This is done with a repeated convolution filtering.
Examples
.. ipython:: python
from rompy_swan.components.physics import DIFFRACTION
diffraction = DIFFRACTION()
print(diffraction.render())
diffraction = DIFFRACTION(idiffr=True, smpar=0.0, smnum=1.0)
print(diffraction.render())
Source code in rompy_swan/components/physics.py
2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 | |
Attributes
model_type
class-attribute
instance-attribute
model_type: Literal['diffraction', 'DIFFRACTION'] = Field(default='diffraction', description='Model type discriminator')
idiffr
class-attribute
instance-attribute
idiffr: Optional[bool] = Field(default=None, description='Indicates the use of diffraction. If `idiffr=0` then no diffraction is taken into account (SWAN default: 1)')
smpar
class-attribute
instance-attribute
smpar: Optional[float] = Field(default=None, description='Smoothing parameter for the calculation of ∇ · √Etot. During every smoothing step all grid points exchange `smpar` times the energy with their neighbours. Note that `smpar` is parameter a in the above text (SWAN default: 0.0)')
smnum
class-attribute
instance-attribute
smnum: Optional[int] = Field(default=None, description='Number of smoothing steps relative to `smpar` (SWAN default: 0)')
cgmod
class-attribute
instance-attribute
cgmod: Optional[float] = Field(default=None, description='Adaption of propagation velocities in geographic space due to diffraction. If `cgmod=0` then no adaption (SWAN default: 1.0)')
Functions
cmd
Command file string for this component.
Source code in rompy_swan/components/physics.py
Surfbeat
SURFBEAT
Bases: BaseComponent
Surfbeat.
.. code-block:: text
SURFBEAT [df] [nmax] [emin] UNIFORM/LOGARITHMIC
Using this optional command, the user activates the Infragravity Energy Module (IEM) of Reniers and Zijlema (2022). Besides the energy balance equation for a sea-swell wave field, another energy balance is included to account for the transfer of sea-swell energy to the bound infragravity (BIG) wave. This infragravity energy balance also involves a nonlinear transfer, expressed by the biphase, through the phase coupling between the radiation stress forcing and the BIG wave. For the prediction of the biphase for obliquely incident waves, an evolution equation is provided under the assumption that the bottom slopes are mild and alongshore uniform.
References
Reniers, A. and Zijlema, M., 2022. Swan surfbeat-1d. Coastal Engineering, 172, p.104068.
Examples:
.. ipython:: python
from rompy_swan.components.physics import SURFBEAT
surfbeat = SURFBEAT()
print(surfbeat.render())
surfbeat = SURFBEAT(df=0.01, nmax=50000, emin=0.05, spacing="logarithmic")
print(surfbeat.render())
Source code in rompy_swan/components/physics.py
2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 | |
Attributes
model_type
class-attribute
instance-attribute
model_type: Literal['surfbeat', 'SURFBEAT'] = Field(default='surfbeat', description='Model type discriminator')
df
class-attribute
instance-attribute
df: Optional[float] = Field(default=None, description='The constant size of BIG frequency bin (in Hz) (SWAN default: 0.01)', ge=0.0)
nmax
class-attribute
instance-attribute
nmax: Optional[int] = Field(default=None, description='The maximum number of short-wave pairs for creating bichromatic wave groups (SWAN default: 50000)', ge=0)
emin
class-attribute
instance-attribute
emin: Optional[float] = Field(default=None, description='The energy threshold in fraction of energy spectrum peak. With this threshold one takes into account those short wave components to create bichromatic wave groups while their energy levels are larger than `emin x E_max` with `E_max` the peak of the spectrum (SWAN default: 0.05)')
spacing
class-attribute
instance-attribute
spacing: Optional[Literal['uniform', 'logarithmic']] = Field(default=None, description='Define if frequencies for reflected ig waves are uniformly or logarithmically distributed')
Functions
cmd
Command file string for this component.
Source code in rompy_swan/components/physics.py
Scattering
SCAT
Bases: BaseComponent
Scattering.
.. code-block:: text
SCAT [iqcm] (GRID [rfac]) (TRUNC [alpha] [qmax])
Using this optional command, the user activates a source term that allows for the generation and propagation of cross correlations between scattered waves due to variations in the bathymetry and mean currents. Such variations are rapid compared to the distancebetween the crossing waves (at the scale of 100-1000 m) and is particularly relevant for cases involving narrowband waves (swells) in coastal regions with shallow water and ambient currents. In turn, the immediate spatial effects of coherent scattering, interference, refraction and diffraction can cause large-scale changes in the wave parameters.
References
Smit, P.B. and Janssen, T.T., 2013. The evolution of inhomogeneous wave statistics through a variable medium. Journal of Physical Oceanography, 43(8), pp.1741-1758.
Smit, P.B., Janssen, T.T. and Herbers, T.H.C., 2015. Stochastic modeling of inhomogeneous ocean waves. Ocean Modelling, 96, pp.26-35.
Smit, P.B., Janssen, T.T. and Herbers, T.H.C., 2015. Stochastic modeling of coherent wave fields over variable depth. Journal of Physical Oceanography, 45(4), pp.1139-1154.
Akrish, G., Smit, P., Zijlema, M. and Reniers, A., 2020. Modelling statistical wave interferences over shear currents. Journal of Fluid Mechanics, 891, p.A2.
Notes
Implemented in SWAN 41.41.
If both alpha and qmax options are provided to truncate the infinite
convolution sum their mimimum is considered as the final limit on the sum.
Examples:
.. ipython:: python
from rompy_swan.components.physics import SCAT
scat = SCAT()
print(scat.render())
scat = SCAT(iqcm=2, rfac=1.0, alpha=1.0)
print(scat.render())
Source code in rompy_swan/components/physics.py
2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 | |
Attributes
model_type
class-attribute
instance-attribute
iqcm
class-attribute
instance-attribute
iqcm: Optional[Literal[0, 1, 2]] = Field(default=None, description='Indicates the modelling and computation of QC scattering:\n\n* 0: no scattering\n* 1: scattering due to non-uniform bathymetry and currents (the latter only if applicable; see command `INPGRID CURRENT`)\n* 2: wave-current interaction under the assumption of a slowly varying bathymetry\n\n(SWAN default: 1)')
rfac
class-attribute
instance-attribute
rfac: Optional[float] = Field(default=None, description='The resolution factor through which the incident spectral width ismultiplied (SWAN default: 1.0)', ge=1.0)
alpha
class-attribute
instance-attribute
alpha: Optional[float] = Field(default=None, description='The coefficient by which the mean wave number is multiplied to set thelimit on the convolution sum (SWAN default: 1.0)')
qmax
class-attribute
instance-attribute
qmax: Optional[float] = Field(default=None, description='The maximum scattering wave number (in 1/m)')
Functions
warn_if_qmax_and_alpha
warn_if_qmax_and_alpha() -> SCAT
Source code in rompy_swan/components/physics.py
cmd
Command file string for this component.
Source code in rompy_swan/components/physics.py
Off
OFF
Bases: BaseComponent
Deactivate physics commands.
.. code-block:: text
OFF WINDGROWTH|QUADRUPL|WCAPPING|BREAKING|REFRAC|FSHIFT|BNDCHK
This command deactivates physics commands. The command can be used to switch off the computation of a certain physics component without having to remove the command from the input file. This is useful for testing purposes.
Examples:
.. ipython:: python
from rompy_swan.components.physics import OFF
off = OFF(physics="windgrowth")
print(off.render())
Source code in rompy_swan/components/physics.py
Attributes
model_type
class-attribute
instance-attribute
physics
class-attribute
instance-attribute
physics: PhysicsOff = Field(description='Physics command to be switched off')
Functions
OFFS
Bases: BaseComponent
Deactivate multiple physics commands.
.. code-block:: text
OFF WINDGROWTH|QUADRUPL|WCAPPING|BREAKING|REFRAC|FSHIFT|BNDCHK
OFF WINDGROWTH|QUADRUPL|WCAPPING|BREAKING|REFRAC|FSHIFT|BNDCHK
.
This group component is a convenience to allow defining and rendering
a list of OFF components.
Examples
.. ipython:: python :okwarning:
from rompy_swan.components.physics import OFFS
off1 = dict(physics="windgrowth")
off2 = dict(physics="wcapping")
offs = OFFS(offs=[off1, off2])
for off in offs.render():
print(off)
Source code in rompy_swan/components/physics.py
Attributes
model_type
class-attribute
instance-attribute
offs
class-attribute
instance-attribute
offs: list[OFF] = Field(description='Physics commands to deactivate')