The second term introduces an additional complication, since not only the boundary, but also the integrand depends on
\(a_j\). Split the domain according to partition (
1). We can now make the dependency of the boundary on
\(\eta \) explicit by splitting the integral into two parts
$$\begin{aligned} \begin{aligned} \int _0^T\partial _{a_j} M_2(t)\,\mathrm {d}t&=-\int _0^T \partial _{a_j}\int _{\mathcal {D}_{t,s,h}}\int _{ z=0}^{\eta _h}\frac{\partial \phi _h^t}{\partial t}( x, y, z)\,\mathrm {d}z\,\mathrm {d}x\,\mathrm {d}y\,\mathrm {d}t\\&\quad -\int _0^T\int _{{\varOmega }_{t,h}\setminus {\varOmega }_{t,\eta }}\frac{\partial }{\partial a_j}\left( \frac{\partial \phi _h^t}{\partial t}\right) \,\mathrm {d}{\varOmega }\,\mathrm {d}t, \end{aligned} \end{aligned}$$
(11)
where we used (
1) to represent the free surface with the height functions
\(\eta _h^l\). Next, we apply first Leibniz’ theorem to the first term on the right hand side in (
11) and then Reynolds transport theorem to the second term
$$\begin{aligned} \int _0^T\partial _{a_j} M_2(t)\,\mathrm {d}t&=-\int _0^T\int _{\mathcal {D}_{t,s,h}}\frac{\partial \phi _h^t}{\partial t}( x, y, \eta _h)\eta _j^t( x, y)\,\mathrm {d}x\,\mathrm {d}y\,\mathrm {d}t\\&\quad -\int _{{\varOmega }_T}\frac{\partial \phi ^T}{\partial a_j}\,\mathrm {d}{\varOmega }+\int _{{\varOmega }_0}\frac{\partial \phi ^0}{\partial a_j}\,\mathrm {d}{\varOmega }+\int _0^T\int _{\partial {\varOmega }_{t,h}}\frac{\partial \phi _h^t}{\partial a_j}v\cdot \nu \,\mathrm {d}S\,\mathrm {d}t, \end{aligned}$$
with
\(v=\frac{\mathrm {d}x}{\mathrm {d}t}|_{\partial {\varOmega }_t}\). Since we assume that
\(\delta \phi (0,\cdot )=\delta \phi (T,\cdot )=0\) the integrals over
\({\varOmega }_T\) and
\({\varOmega }_0\) vanish. We also use the relations
$$\begin{aligned} v\cdot \nu |_{\partial {\varOmega }_{t,s,h}}\,\mathrm {d}S&=\frac{\mathrm {d}}{\mathrm {d}t}( x, y,\eta _h)\cdot \left( -\frac{\partial \eta _h}{\partial x}, -\frac{\partial \eta _h}{\partial y}, 1\right) \,\mathrm {d}x\,\mathrm {d}y=\frac{\partial \eta _h}{\partial t}\,\mathrm {d}x\,\mathrm {d}y \end{aligned}$$
and
$$\begin{aligned} v\cdot \nu |_{\partial {\varOmega }_{t,R,h}}&=\frac{\partial R}{\partial t}\cdot \nu _R, \end{aligned}$$
with
\(\nu _R=\nu |_{\partial {\varOmega }_{t,R,h}}\), resulting in
$$\begin{aligned} \int _0^T\partial _{a_j} M_2(t)\,\mathrm {d}t&=-\int _0^T\int _{\mathcal {D}_{t,s,h}}\frac{\partial \phi _h^t}{\partial t}( x, y, \eta _h)\eta _j^t( x, y)\,\mathrm {d}x\,\mathrm {d}y\,\mathrm {d}t\nonumber \\&\quad +\int _0^T\int _{\partial {\varOmega }_{t,R,h}}\frac{\partial \phi _h^t}{\partial a_j}\frac{\partial R}{\partial t}\cdot \nu _R\,\mathrm {d}S\,\mathrm {d}t\nonumber \\&\quad +\int _0^T\int _{\mathcal {D}_{t,s,h}}\frac{\partial \phi _h^t}{\partial a_j}( x, y, \eta _h)\frac{\partial \eta _h}{\partial t}(t, x, y)\,\mathrm {d}x\,\mathrm {d}y\,\mathrm {d}t. \end{aligned}$$
(12)
It is beneficial to further evaluate the second term on the right hand side in (
12) using (7.2) in Flanders [
7], splitting this contribution into a line integral that will be used when applying (7.2) in [
7] to the integrals over
\(\mathcal {D}_{t,s,h}\) and an expression where
\(\frac{\partial }{\partial a_j}\) is the outermost operator, which is convenient when constructing the Hamiltonian. This results in
$$\begin{aligned} \int _{\partial {\varOmega }_{t, R, h}}\frac{\partial \phi _h}{\partial a_j}\frac{\partial R}{\partial t}\cdot \nu _R\,\mathrm {d}S&=-\int _{\partial {\varOmega }_{t,R,h}}\nabla \cdot \left( \phi _h\frac{\partial R}{\partial t}\right) \frac{\partial x}{\partial a_j}\cdot \nu _R\,\mathrm {d}S\nonumber \\&\quad +\int _{\partial {\varOmega }_{t,R,h}\cap \partial {\varOmega }_{t,s,h}}\left( \frac{\partial x}{\partial a_j}\times \phi _h\frac{\partial R}{\partial t}\right) \cdot \tau \,\mathrm {d}l\\&\quad +\frac{\partial }{\partial a_j}\int _{\partial {\varOmega }_{t,R,h}}\phi _h\frac{\partial R}{\partial t}\cdot \nu _R\,\mathrm {d}S,\nonumber \end{aligned}$$
(13)
with
\(\tau \) the unit tangential vector at the interface
\(\partial {\varOmega }_{t,R,h}\cap \partial {\varOmega }_{t,s,h}\). Note that
\(\tau \) is orthogonal to
\(\nu _R\). The vector
\(\frac{\partial x}{\partial a_j}\) links the mesh velocity to the free surface velocity. Since the mesh is a tessellation of the domain, the mesh at
\(\partial {\varOmega }_{t,R,h}\) can only move parallel to
\(\partial {\varOmega }_{t,R,h}\), hence the first integral on the right hand side in (
13) is zero. At the solid wall-free surface intersection
\(\partial {\varOmega }_{t,R,h}\cap \partial {\varOmega }_{t,s,h}\) we need to enforce that the free surface moves tangentially to the solid wall, hence we have to apply the correction
$$\begin{aligned} \frac{\partial x}{\partial a_j}=\frac{\partial x_{s,R}}{\partial a_j}-\left( \frac{\partial x_{s,R}}{\partial a_j}\cdot \nu _R\right) \nu _R, \end{aligned}$$
(14)
with
\(x_{s,R}=\begin{pmatrix}x,&y,&\eta _h\end{pmatrix}\). An alternative interpretation of this is that an infinitesimally small sliver of
\(\mathcal {D}_{t,s,h}\) nearest to the wave maker is rotated, such that it aligns correctly. By introducing
\(t_R=\tau \times \nu _R\) (
14) can also be written as
$$\begin{aligned} \frac{\partial x}{\partial a_j}=\left( \frac{\partial x_{s,R}}{\partial a_j}\cdot \tau \right) \tau +\left( \frac{\partial x_{s,R}}{\partial a_j}\cdot t_R\right) t_R. \end{aligned}$$
The second integral on the right hand side in (
13) is then equal to
$$\begin{aligned}&\int _{\partial {\varOmega }_{t,R,h}\cap \partial {\varOmega }_{t,s,h}}\left( \frac{\partial x}{\partial a_j}\times \phi _h\frac{\partial R}{\partial t}\right) \cdot \tau \,\mathrm {d}l\\&\quad = \int _{\partial {\varOmega }_{t,R,h}\cap \partial {\varOmega }_{t,s,h}} \left( \tau \times \left( \left( \frac{\partial x_{s,R}}{\partial a_j}\cdot \tau \right) \tau +\left( \frac{\partial x_{s,R}}{\partial a_j}\cdot t_R\right) t_R\right) \right) \cdot \phi _h\frac{\partial R}{\partial t}\,\mathrm {d}l\\&\quad =\int _{\partial {\varOmega }_{t,R,h}\cap \partial {\varOmega }_{t,s,h}}-\left( \frac{\partial x_{s,R}}{\partial a_j}\cdot t_R\right) \left( \nu _R\cdot \frac{\partial R}{\partial t}\right) \phi _h\,\mathrm {d}l. \end{aligned}$$
Since
\(\frac{\partial x_{s,R}}{\partial a_j}=\begin{pmatrix}0,&0,&\eta _j^t\end{pmatrix}\) we obtain
\(t_R\cdot \frac{\partial x_{s,R}}{\partial a_j}=(\tau \times \nu _R)\cdot e_z\eta _j^t\) with
\(e_z=(0,0,1)^T\). After collecting all terms, the final result for (
13) then becomes
$$\begin{aligned} \int _{\partial {\varOmega }_{t, R, h}}\frac{\partial \phi _h}{\partial a_j}\frac{\partial R}{\partial t}\cdot \nu _R\,\mathrm {d}S&=-\int _{\partial {\varOmega }_{t,R,h}\cap \partial {\varOmega }_{t,s,h}}\left( \frac{\partial R}{\partial t}\cdot \nu _R\right) \left( \tau \times \nu _R\right) \cdot e_z\eta _j^t\phi _h^t\,\mathrm {d}l\\&\quad +\frac{\partial }{\partial a_j}\int _{\partial {\varOmega }_{t,R,h}}\phi _h\frac{\partial R}{\partial t}\cdot \nu _R\,\mathrm {d}S. \end{aligned}$$
Using the compatibility condition at the free surface (
5) we obtain then
$$\begin{aligned} \begin{aligned} \partial _{a_j}M_2&= -\int _{\mathcal {D}_{t,s,h}}\partial _t\left( \sum _{k\in N_s}b_{k}\eta _k\right) \eta _j\,\mathrm {d}x\,\mathrm {d}y \\&\quad + \partial _{a_j}\int _{\partial {\varOmega }_{t,R,h}}\frac{\partial R}{\partial t}\cdot \nu _R\sum _{i\in {\mathcal {N}}}b_i\phi _i\,\mathrm {d}S\\&\quad -\int _{\partial {\varOmega }_{t,R,h}\cap \partial {\varOmega }_{t,s,h}}\left( \frac{\partial R}{\partial t}\cdot \nu _R\right) \left( \tau \times \nu _R\right) \cdot e_z\eta _j\sum _{k\in {\mathcal {N}}}b_k\eta _k\,\mathrm {d}l\\&\quad +\int _{\mathcal {D}_{t,s,h}}\frac{\partial }{\partial a_j}\left( \sum _{k\in N_s}b_k\eta _k^t\right) \frac{\partial \eta _h}{\partial t}\,\mathrm {d}x\,\mathrm {d}y. \end{aligned} \end{aligned}$$
(15)
Since the basis functions
\(\eta _k^t\) do not depend on
\(a_j\) the last integral in (
15) is zero and
\(\partial _{a_j} M_2\) can be expressed as
$$\begin{aligned} \partial _{a_j}M_2=\left( -\mathcal {E}{\dot{{b}}}_s-\mathcal {D}{b}_s-\mathcal {E}_R{b}_s\right) [j]+\partial _{a_j}({\varPhi }_R\cdot {b}). \end{aligned}$$
For the third term we simply write
$$\begin{aligned} \partial _{a_j}M_3 = -\partial _{a_j}\int _{{\varOmega }_{t,h}}\frac{1}{2} \left| \sum _{i\in {\mathcal {N}}}b_i\nabla \phi _i^t\right| ^2 \,\mathrm {d}{\varOmega }= -\partial _{a_j}\left( \frac{1}{2}{b}^T{\varPhi }{b}\right) . \end{aligned}$$
Combining the three terms we obtain for the variations of
\({\mathcal {L}}_h\) with respect to
\(a_j\)
$$\begin{aligned} 0&=-\mathcal {E}{{\dot{{b}}}}_s(t)-\mathcal {D}{b}_s(t)-\mathcal {E}_R{b}_s(t)-\mathcal {E}{a}(t)g_z\\&\quad -\partial _{a}\left( \frac{1}{2}{b}(t)^T{\varPhi }{b}(t)-{\varPhi }_R\cdot {b}(t)\right) - G, \end{aligned}$$
which is equivalent to (
9a). For Eqs. (
9b) and (
9c) consider the variations with respect to
\(b_j\). The first term does not depend on
\(b_j\), hence
$$\begin{aligned} \partial _{b_j}M_1=0. \end{aligned}$$
For the second term use (
4) again to obtain
$$\begin{aligned} \partial _{b_j}M_2&=\partial _{b_j}\left( \int _{\partial {\varOmega }_{t,R,h}}\frac{\partial R}{\partial t}\cdot \nu \sum _{i\in N_R}b_i\phi _i\,\mathrm {d}S\nonumber \right. \\&\quad \left. +\,\int _{\mathcal {D}_{t,s,h}}\partial _t\left( \sum _{k\in N_s} a_k\eta _k\right) \sum _{i\in N_s}b_i\phi _i\,\mathrm {d}x\,\mathrm {d}y\right) \nonumber \\&=\int _{\partial {\varOmega }_{t,R,h}}\frac{\partial R}{\partial t}\cdot \nu \phi _j\,\mathrm {d}S+\int _{\mathcal {D}_{t,s,h}}\partial _t\left( \sum _{k\in N_s} a_k\eta _k\right) \eta _j\,\mathrm {d}x\,\mathrm {d}y\nonumber \\&={\left\{ \begin{array}{ll}({\varPhi }_{1,{a},R}+\mathcal {E}{{\dot{{a}}}}+\mathcal {D}{a})[j]&{}j\in N_s,\\ {\varPhi }_{2,{a},R}[j]&{}j\notin N_s. \end{array}\right. } \end{aligned}$$
(16)
Finally, the third term is just a straightforward differentiation. We have
$$\begin{aligned} \partial _{b_j}M_3=-\int _{{\varOmega }_{t,h}}\sum _{i\in {\mathcal {N}}}b_i\nabla \phi _i\cdot \nabla \phi _j\,\mathrm {d}{\varOmega }=-({\varPhi }{b})[j]. \end{aligned}$$
After applying the decompositions (
7) and (
8) the terms can be combined to give (
9b) and (
9c).
\(\square \)