Gravitational Adjustment
===================================

The goal of this test case, also known as Lock-Exchange experiment, is to evaluate 
different numerical advection schemes on representing the adiabatic process in a dam 
breaking experiment. At the initial time, a vertical density front separates two 
density classes. Adjustment occurs in which lighter water moves above heavier 
water :cite:p:`shin_gravity_2004`. The model experiments are designed to reproduce 
the lock-exchange problem described in :cite:t:`ilicak_spurious_2012`. Analytical 
solutions to this problem exist and from Bernouilli’s equation for an ideal fluid, 
the front propagates with speed :math:`0.5 \sqrt{gH \delta \rho / \rho_0}`. This speed 
may be slowed down by mixing between the two layers due to numerical diapycnal diffusion.


The setup is a closed, two-dimensional (x,z) domain with a constant depth of H = 20 m 
and a length of L = 64 km. At t = 0 the two initial densities that represent the two 
water masses are separated by a vertical barrier. The right and left halves of the domain 
have densities of 1020 and 1025 :math:`\text{kg/m}^3` respectively. To investigate the 
impact of the model resolution and the choice of advection scheme on spurious mixing, 
the model uses three different horizontal and vertical model grid spacings: coarse 
(dx=2 km; N=10); medium is default (dx=500 m, N=40); fine (dx=125 m, N=160).

A non-hydrostatique version can be run (#define NBQ) in a smaller domain of 3 m by 30 cm 
and resolution of 1 cm. In this case, Kelvin-Helmholtz instabilities develop along the 
front during the gravitational adjustment.

::

    # define GRAV_ADJ

CPP options:

::

    # undef  OPENMP
    # undef  MPI
    # undef  NBQ
    # undef  XIOS 
    # define SOLVE3D
    # define NEW_S_COORD
    # define UV_ADV
    # define TS_HADV_WENO5
    # define TS_VADV_WENO5
    # define UV_HADV_WENO5
    # define UV_VADV_WENO5
    # ifdef NBQ
    #  define W_HADV_WENO5
    #  define W_VADV_WENO5
    # endif
    # undef  UV_VIS2
    # define ANA_GRID
    # define ANA_INITIAL
    # define ANA_SMFLUX
    # define ANA_STFLUX
    # define ANA_BTFLUX
    # undef  PASSIVE_TRACER
    # define NO_FRCFILE
    # undef  CVTK_DEBUG

**Settings :**

**Results :**

.. figure:: figures/test_cases/test_cases_gravadj.png
            :scale: 50 %

            GRAV_ADJ results : density front evolution for a medium resolution of 500m.


.. raw:: latex

    \clearpage