\[\begin{equation}
\label{eq02}
\begin{cases}
\nu_k^\psi \frac{\partial K}{\partial z} = 0, z = -h \text{ or } \eta\\
\nu_\psi \frac{\partial\psi}{\partial z} = \kappa_0 n \nu_\psi \frac{\psi}{l}, z = -h\\
\nu_\psi \frac{\partial\psi}{\partial z} = -\kappa_0 n \nu_\psi \frac{\psi}{l}, z = \eta
\end{cases}
\end{equation}\]
and essential B.C.:
\[\begin{equation}
\label{eq03}
\begin{cases}
K = ( c_\mu^0 )^{-2} \nu \left| \frac{\partial u}{\partial z} \right|\\
l = \kappa_0\Delta, \text{ at } z = -h \text{ or } \eta\\
\psi = ( c_\mu^0 )^p K^m ( \kappa_0 \Delta )^n
\end{cases}
\end{equation}\]
where \(K\) is the TKE, \(l\) is the mixing length, \(c_{\psi *}\) are constants, \(\psi = ( c_\mu^0 )^p K^m l^n\) is a generic length-scale variable, and \(\Delta\) is the distance to the boundary (surface or bottom). The turbulence production and dissipation terms are:
In the code, the natural B.C. is applied first (see the FEM formulation below), and the essential B.C. is then used
to overwrite the boundary values of the unknown, as suggested by GOTM. We also follow some other models and neglect
the advection terms here.
In the FEM formulation,
\(K\), \(\psi\) are defined at nodes and whole levels. Furthermore, the sums of \(M^2\) and \(N^2\) are
treated explicitly/implicitly depending on the sign. The final equations look similar to those for the momentum equation:
where \(\begin{Bmatrix}\end{Bmatrix}\) indicates the alternative explicit/implicit schemes mentioned above, and \(\mathcal{H}\) is a step function. We have applied the natural B.C. (Eqs. \(\ref{eq02}\)) in these equations, and after \(K\) and \(\psi\) are solved, the essential B.C. (Eqs \(\ref{eq03}\)) is then used to overwrite the boundary values.
References
Umlauf, L. and H. Burchard (2003) A generic length-scale equation for geophysical turbulence models. J. Mar. Res., 6, pp. 235-265.