Skip to content

Latest commit

 

History

History
283 lines (208 loc) · 11.7 KB

shape_3.rst

File metadata and controls

283 lines (208 loc) · 11.7 KB

Shape class 3

This shape class describes long crested waves propagating in infinite, constant or varying water depth. Consequently, it may be interpreted as a generalization of Shape 1 <shape_1> and Shape 2 <shape_2>. Because the storage and CPU requirements are similar to those specialized classes we may consider to only apply this class for all long crested waves independent of the actual sea floor formulation.

$$\phi(x, z, t)= \sum_{j=0}^n \mathcal{Re} \Bigl\{c_j(t)\, X_j(x) \Bigr\} Z_j(z) + \sum_{j=0}^{\hat{n}} \mathcal{Re}\Bigl\{\hat{c}_j(t)\, X_j(x) \Bigr\} \hat{Z}_j(z)$$

$$\zeta(x, t)= \sum_{j=0}^n \mathcal{Re} \Bigl\{h_j(t)\, X_j(x) \Bigr\}$$

$$X_j(x) = e^{-i k_j x}, \quad Z_j(z) = e^{k_j z}, \quad \hat{Z}_j(z) = e^{-k_j z}, \quad k_j = j\cdot\Delta k, \quad i=\sqrt{-1}$$

The set of real constants kj resemble wave numbers. It follows that the kinematics is periodic in space


ϕ(x + λmax, z, t) = ϕ(x, z, t),  ζ(x + λmax, t) = ζ(x, t)

$$\lambda_{\max} = \frac{2\pi}{\Delta k}, \qquad \lambda_{\min} = \frac{\lambda_{\max}}{n}$$

where λmin and λmax are the shortest and longest wave lengths resolved respectively.

The actual set of shape functions is uniquely defined by the three input parameters Δk, n and .

Note

The fields related to j = 0 are uniform in space (DC bias). Non-zero values of h0(t) violates mass conservation. The amplitude c0(t) and 0(t) adds a uniform time varying ambient pressure field not influencing the flow field. Consequently, these components will by default be suppressed in the kinematic calculations. However, there is an option in the API for including all DC values provided by the wave generator<wave-generator>.

The fields related to j = n are expected to correspond to the Nyquist frequency of the physical resolution applied in the wave generator<wave-generator>. Hence, typical n = ⌊nfft/2⌋ where nfft is the physical spatial resolution applied in the wave generator<wave-generator>.

The sea floor

The sea floor zsf(x) is assumed single valued and is periodic with respect to the x-location


zsf(x + λmax) = zsf(x)

Hence, the seafloor steepness is finite but may be arbitrary large. In the current version of the API the sea floor is continous and piecewise linear. As illustrated in the figure below, the sea floor is defined by linear interpolation between nsf offset points (xsf, zsf)i for i ∈ {1, 2, …, nsf}. The sequence xsf(i) is monotonic increasing and covering the range xsf(i) ∈ [0, λmax]

Infinite water depth

The infinite depth formulation follows directly by specifying nsf = 0 and  =  − 1. Consequently the formulation is equivalent to Shape 1 <shape_1> and there are no spectral amplitudes j(t).

Constant water depth

Constant water depth d is defined by assigning nsf = 1. Hence d ≡  − zsf(1). The classical shallow water equations (ref Shape 2 <shape_2>) are reformulated using exponential terms

$$C_j(t) \frac{\cosh k_j(z+d)}{\cosh k_j d} \equiv c_j(t) Z_j(z) + \hat{c}_j(t) \hat{Z}_j(z)$$

$$c_j(t) = \gamma_j C_j(t), \qquad \hat{c}_j(t) = \hat{\gamma}_j c_j(t), \qquad \gamma_j = \frac{1+\tanh k_j d}{2}, \qquad \hat{\gamma}_j = e^{-2k_j d}$$

Consequently, we only store cj(t) in the SWD-file<swd-terminology>. At the beginning of each new time step we construct j(t) using cj(t) and the coefficient γ̂j. Because this relation is valid for all time instances the same relations are valid for the temporal derivatives too

$$\frac{d c_j(t)}{dt} = \gamma_j \frac{d C_j(t)}{dt}, \qquad \frac{d \hat{c}_j(t)}{dt} = \hat{\gamma}_j \frac{d c_j(t)}{dt}$$

This formulation is potential faster and more numerical stable than direct evaluation of the hyperbolic functions.

Hint

In practice  < n because the corresponding neglected high-frequency components do not contribute significantly to any boundary conditions. For the free surface conditions this follows from the property


|j(t)j(z)| = |γ̂jcj(t)e − kjz| = e − 2kj(d + z)|cj(t)Zj(z)| ≪ |cj(t)Zj(z)|


  j > ,  z ∈ [ − ζmax, ζmax],  d > ζmax

where ζmax is the maximum wave elevation. Near the sea floor the exponential coefficient e − 2kj(d + z) → 1. Consequently, the contribution to the boundary conditions at the sea floor vanish too, because |cj(t)Zj(z)| vanish for large j.

Due to finite precision arithmetic the following upper limit is recommended

$$\hat{n} \le \frac{\tanh^{-1}(1 - 100 \epsilon_m)}{\Delta k\cdot d}$$

where ϵm is the machine precision (1 + ϵm = 1).

Varying water depth

Varying water depth (bathymetry) is assumed if nsf > 1. In this case also the coefficients j(t) needs to be stored in the SWD file.

Hint

For varying water depth, the additional complex valued coefficients j(t) at time t are expected to be determined in the wave generator<wave-generator> by adding zero-flux boundary conditions at 2 distributed collocation points on the sea floor.

Due to finite precision arithmetic the following upper limit is recommended

$$\hat{n} \le \frac{\tanh^{-1}(1 - 100 \epsilon_m)}{-\Delta k\cdot \min\{z_{zf}\}}$$

where ϵm is the machine precision (1 + ϵm = 1).

Kinematics

Given the definitions above we obtain the following explicit kinematics:

$$\phi(\bar{x},\bar{y},\bar{z},\bar{t})= \sum_{j=0}^n \mathcal{Re} \Bigl\{c_j(t)\, X_j(x)\Bigr\} Z_j(z) + \sum_{j=0}^{\hat{n}} \mathcal{Re}\Bigl\{\hat{c}_j(t)\, X_j(x) \Bigr\} \hat{Z}_j(z)$$

$$\varphi(\bar{x},\bar{y},\bar{z},\bar{t})= \sum_{j=0}^n \mathcal{Im} \Bigl\{c_j(t)\, X_j(x)\Bigr\} Z_j(z) - \sum_{j=0}^{\hat{n}} \mathcal{Im}\Bigl\{\hat{c}_j(t)\, X_j(x)\Bigr\} \hat{Z}_j(z)$$

$$\frac{\partial\phi}{\partial \bar{t}}(\bar{x},\bar{y},\bar{z},\bar{t}) = \sum_{j=0}^n \mathcal{Re} \Bigl\{\frac{d c_j(t)}{dt} \, X_j(x)\Bigr\} Z_j(z) + \sum_{j=0}^{\hat{n}} \mathcal{Re}\Bigl\{\frac{d \hat{c}_j(t)}{dt}\, X_j(x)\Bigr\} \hat{Z}_j(z)$$

$$\zeta(\bar{x},\bar{y},\bar{t})= \sum_{j=0}^n \mathcal{Re} \Bigl\{h_j(t)\, X_j(x)\Bigr\}$$

$$\frac{\partial\zeta}{\partial \bar{t}}(\bar{x},\bar{y},\bar{t}) = \sum_{j=0}^n \mathcal{Re} \Bigl\{\frac{d h_j(t)}{dt} \, X_j(x)\Bigr\}$$

$$\frac{\partial\zeta}{\partial \bar{x}}(\bar{x},\bar{y},\bar{t}) = \zeta_x\cos\beta, \qquad \frac{\partial\zeta}{\partial \bar{y}}(\bar{x},\bar{y},\bar{t}) = \zeta_x\sin\beta$$

$$\zeta_x = \sum_{j=0}^n k_j\mathcal{Im} \Bigl\{h_j(t)\, X_j(x)\Bigr\}$$

$$\bar{\nabla}\phi(\bar{x},\bar{y},\bar{z},\bar{t}) = [\phi_x\cos\beta,\phi_x\sin\beta,\phi_z]^T$$

$$\phi_x = \sum_{j=0}^n k_j\mathcal{Im} \Bigl\{c_j(t)\, X_j(x)\Bigr\} \, Z_j(z) + \sum_{j=0}^\hat{n} k_j\mathcal{Im} \Bigl\{\hat{c}_j(t)\, X_j(x)\Bigr\} \, \hat{Z}_j(z)$$

$$\phi_z = \sum_{j=0}^n k_j\mathcal{Re} \Bigl\{c_j(t)\, X_j(x)\Bigr\} \, Z_j(z) - \sum_{j=0}^\hat{n} k_j\mathcal{Re} \Bigl\{\hat{c}_j(t)\, X_j(x)\Bigr\} \, \hat{Z}_j(z)$$

$$\frac{\partial\bar{\nabla}\phi}{\partial \bar{t}}(\bar{x},\bar{y},\bar{z},\bar{t}) = [\phi_{xt}\cos\beta,\phi_{xt}\sin\beta,\phi_{zt}]^T$$

$$\phi_{xt} = \sum_{j=0}^n k_j \mathcal{Im} \Bigl\{\frac{d c_j(t)}{dt} \, X_j(x)\Bigr\} Z_j(z) + \sum_{j=0}^\hat{n} k_j \mathcal{Im} \Bigl\{\frac{d \hat{c}_j(t)}{dt} \, X_j(x)\Bigr\} \hat{Z}_j(z)$$

$$\phi_{zt} = \sum_{j=0}^n k_j \mathcal{Re} \Bigl\{\frac{d c_j(t)}{dt} \, X_j(x)\Bigr\} Z_j(z) - \sum_{j=0}^\hat{n} k_j \mathcal{Re} \Bigl\{\frac{d \hat{c}_j(t)}{dt} \, X_j(x)\Bigr\} \hat{Z}_j(z)$$

$$\frac{d\bar{\nabla}\phi}{d\bar{t}}(\bar{x},\bar{y},\bar{z},\bar{t}) = \frac{\partial\bar{\nabla}\phi}{\partial \bar{t}} + \bar{\nabla}\phi \cdot \bar{\nabla}\bar{\nabla}\phi$$

$$\begin{aligned} \bar{\nabla}\bar{\nabla}\phi (\bar{x},\bar{y},\bar{z},\bar{t}) = \begin{bmatrix} \phi_{\bar{x},\bar{x}} & \phi_{\bar{x},\bar{y}} & \phi_{\bar{x},\bar{z}} \\\ \phi_{\bar{x},\bar{y}} & \phi_{\bar{y},\bar{y}} & \phi_{\bar{y},\bar{z}} \\\ \phi_{\bar{x},\bar{z}} & \phi_{\bar{y},\bar{z}} & \phi_{\bar{z},\bar{z}} \end{bmatrix} \end{aligned}$$


ϕ,  = ϕxxcos2β,  ϕ,  = ϕxxsin βcos β,  ϕ,  = ϕxzcos β


ϕ,  = ϕxxsin2β,  ϕ,  = ϕxzsin β,  ϕ,  = ϕzz =  − ϕxx

$$\phi_{xx} = -\sum_{j=0}^n k_j^2 \mathcal{Re} \Bigl\{c_j(t) \, X_j(x)\Bigr\} Z_j(z) -\sum_{j=0}^\hat{n} k_j^2 \mathcal{Re} \Bigl\{\hat{c}_j(t) \, X_j(x)\Bigr\} \hat{Z}_j(z)$$

$$\phi_{zz} = \sum_{j=0}^n k_j^2 \mathcal{Re} \Bigl\{c_j(t) \, X_j(x)\Bigr\} Z_j(z) + \sum_{j=0}^\hat{n} k_j^2 \mathcal{Re} \Bigl\{\hat{c}_j(t) \, X_j(x)\Bigr\} \hat{Z}_j(z) = - \phi_{xx}$$

$$\phi_{xz} = \sum_{j=0}^n k_j^2 \mathcal{Im} \Bigl\{c_j(t) \, X_j(x)\Bigr\} Z_j(z) - \sum_{j=0}^\hat{n} k_j^2 \mathcal{Im} \Bigl\{\hat{c}_j(t) \, X_j(x)\Bigr\} \hat{Z}_j(z)$$

$$\frac{\partial^2\zeta}{\partial \bar{x}^2}(\bar{x},\bar{y},\bar{t}) = \zeta_{xx}\cos^2\beta \qquad \frac{\partial^2\zeta}{\partial \bar{y}^2}(\bar{x},\bar{y},\bar{t}) = \zeta_{xx}\sin^2\beta$$

$$\frac{\partial^2\zeta}{\partial\bar{x}\partial\bar{y}}(\bar{x},\bar{y},\bar{t}) = \zeta_{xx}\sin\beta\cos\beta$$

$$\zeta_{xx} = -\sum_{j=0}^n k_j^2 \mathcal{Re} \Bigl\{h_j(t) \, X_j(x)\Bigr\}$$

$$p = -\rho\frac{\partial\phi}{\partial \bar{t}} -\frac{1}{2}\rho\bar{\nabla}\phi\cdot\bar{\nabla}\phi -\rho g \bar{z}$$

where $\bar{\nabla}$ denotes gradients with respect to , and . The particle acceleration is labeled $\frac{d\bar{\nabla}\phi}{d\bar{t}}$.

The stream function φ is related to the velocity potential ϕ. Hence ϕ/∂x = ∂φ/∂z and ϕ/∂z =  − ∂φ/∂x.

Implementation notes

Evaluation of costly transcendental functions (cos , sin , exp , ...) are almost eliminated by exploiting the following recursive relations


Xj(x) = X1(x) Xj − 1(x),  Zj(z) = Z1(z) Zj − 1(z),  j(z) = 1(z) j − 1(z)

In case the wave generator<wave-generator> applies a perturbation theory of order q we apply the following Taylor expansions above the calm free surface.

$$Z_j(z) = 1 + \sum_{p=1}^{q-1}\frac{(k_j z)^p}{p!}, \qquad \hat{Z}_j(z) = 1 + \sum_{p=1}^{q-1}\frac{(-k_j z)^p}{p!}, \qquad z > 0$$