Authors, 'Scattering of surface waves by ocean currents: the U2H map', Journal of Fluid Mechanics, (https://doi.org/10.1017/jfm.2024.964). Key words: to follow
© The Authors, 2024. Published by Cambridge University Press.
To edit and run the notebooks: (1) click the 'Edit...' button; (2) on the following screen, click 'Use CoCalc Anonymously', (3) then click 'Create New Project'.

The U2H map
In this notebook, we demonstrate the application of the "U2H map" introduced in our paper (ArXiv link: https://arxiv.org/abs/2402.05652). Given a snapshot of current velocities and information on the incoming wave spectrum, the U2H map generates the current-induced changes in the significant wave height of deep-water surface gravity waves (SGWs), based on the assumptions listed in section 2 in our paper.
The current velocities are by default imported from an MITgcm model output, identical to the one in figure 1 in our paper. Users can change the currents to other forms to their liking.
The background wave energy spectrum is by default set to be the same as the example in figure 1 in our paper. Users can modify the background wave energy spectrum to other arbitrary forms in the wavenumber-direction space.
We also demonstrate the U2H map with the asymptotic expressions assuming highly directional waves. This requires assuming the LHCS model spectrum (described in Appendix B1). Users can vary the angular-width parameter to investigate the impact of directional spreading on the validity of the asymptotic approximation.
Defining the incoming wave energy spectrum. By default we assume it takes the same form as figure 1 in our paper, following the LHCS model with parameters and . You can change it to any other spectra you'd like to investigate.
Load a set of precomputed current velocity snapshot to be used to compute the U2H map.
You can replace the current velocity field with your own, and recompute the U2H map. To do that without modifying the code cells after this, please format your field so that: (1) the 2-dimensional variables u,v, which refer to velocity components along or , are formatted so that u[ix,iy] refers to u evaluated at x1d[ix] and y1d[iy], where x1d or y1d are the equally spaced grids in or , and (2) the number of grid points of the one-dimensional variables x1d and y1d are even, in order for the fast-Fourier transform package ("hwffts") applied in the code to work.
Pad with zeros in space. This is to circumvent artifacts from the non-periodic boundaries in the current's snapshot.
Compute the U2H map.
Plotting the snapshot of the current speed and the computed from the U2H map. Under default configurations, this corresponds to the panels (a,b) of figure 1 in our paper.
If the wave spectrum is LHCS with integer and centered at , then the next cell block computes the U2H map that uses the asymptotic expression of transfer function in the limit of large , as shown in equation (5.15) in the paper.
You can change s defined in cell [2] and re-run the notebook, to check that larger s leads to a better agreement between the swell approximation and the original U2H map.