Skip to content

Free surface equation

free_surface_equation

This module contains the free surface terms.

All terms implement the UFL residual as it would be on the LHS of the equation:

\[ dq / dt + F(q) = 0. \]

surface_velocity_term(eq, trial)

Term for the normal component of motion at the free surface: \(-u \dot n\).

Source code in g-adopt/gadopt/free_surface_equation.py
18
19
20
21
22
def surface_velocity_term(
    eq: Equation, trial: fd.Argument | Indexed | fd.Function
) -> fd.Form:
    r"""Term for the normal component of motion at the free surface: $-u \dot n$."""
    return -eq.buoyancy_scale * eq.test * fd.dot(eq.u, eq.n) * eq.ds(eq.boundary_id)

mass_term(eq, trial)

Mass term for the free surface theta-scheme time discretisation.

Note: This mass term does not use Irksome's Dt operator; StokesSolver manually implements the time discretisation: (eta - eta_old) / dt.

Parameters:

Name Type Description Default
eq Equation

G-ADOPT Equation.

required
trial Argument | Indexed | Function

Firedrake trial function.

required

Returns:

Type Description
Form

The UFL form associated with the mass term of the equation.

Source code in g-adopt/gadopt/free_surface_equation.py
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
def mass_term(eq: Equation, trial: fd.Argument | Indexed | fd.Function) -> fd.Form:
    r"""Mass term for the free surface theta-scheme time discretisation.

    Note: This mass term does not use Irksome's `Dt` operator; `StokesSolver` manually
    implements the time discretisation: `(eta - eta_old) / dt`.

    Args:
        eq:
          G-ADOPT Equation.
        trial:
          Firedrake trial function.

    Returns:
        The UFL form associated with the mass term of the equation.

    """
    n_up = vertical_component(eq.n)

    return eq.buoyancy_scale * eq.test * trial * n_up * eq.ds(eq.boundary_id)