fluidsim.solvers.sw1l.solver

One-layer shallow-water (Saint Venant) equations solver (fluidsim.solvers.sw1l.solver)

This module provides two classes defining the pseudo-spectral solver for biperiodic one-layer shallow water equations, expressed using primitive variables, i.e. the horizontal velocities and surface dispacement.

class fluidsim.solvers.sw1l.solver.InfoSolverSW1L(**kargs)[source]

Bases: fluidsim.base.solvers.pseudo_spect.InfoSolverPseudoSpectral

Information about the solver SW1L.

_init_root(self)[source]

The simulation object is instantiated with classes defined in this function.

The super function InfoSolverPseudoSpectral._init_root is called first. A few classes defined by this function are retained as it is:

Solver-specific first-level classes are added:

class fluidsim.solvers.sw1l.solver.Simul(params)[source]

Bases: fluidsim.base.solvers.pseudo_spect.SimulBasePseudoSpectral

A solver of the shallow-water 1 layer equations (SW1L).

Inheritance diagram of Simul
InfoSolver

alias of InfoSolverSW1L

static _complete_params_with_default(params)[source]

This static method is used to complete the params container.

Notes

  • \(f\) is the system rotation.

  • \(c\) is the phase speed of surface gravity waves in the short- wave limit.

  • \(k_d\) is the Rossby deformation wavenumber.

  • \(\beta\) is differential rotation parameter, approximately given by \(\partial_y f\).

The present solver will not work in the beta-plane. However a vorticity-divergence formulation can be solved with a beta term.

tendencies_nonlin(self, state_spect=None, old=None)[source]

Compute the nonlinear tendencies.

Parameters
state_spectfluidsim.base.setofvariables.SetOfVariables

optional

Array containing the state, i.e. the horizontal velocities and surface displacement scalar in Fourier space. When state_spect is provided, the variables vorticity and the velocities and surface displacement are computed from it, otherwise, they are taken from the global state of the simulation, self.state.

These two possibilities are used during the Runge-Kutta time-stepping.

Returns
tendencies_fftfluidsim.base.setofvariables.SetOfVariables

An array containing the tendencies for the velocities \(\mathbf u\) and the surface displacement scalar \(\eta\).

Notes

The one-layer shallow water equations can be written as:

\[\partial_t \mathbf u = - \nabla (|\mathbf u|^2/2 + c^2 \eta) - (\zeta + f) \times \mathbf u\]
\[\partial_t \eta = - \nabla. ((\eta + H) \mathbf u)\]

This function computes all terms on the RHS of the equations above, including the nonlinear term. The linear dissipation term (not shown above) is computed implicitly, as demonstrated in fluidsim.base.time_stepping.pseudo_spect.TimeSteppingPseudoSpectral.

Functions

compute_Frot(rot, ux, uy, f)

Compute cross-product of absolute potential vorticity with velocity.

compute_pressure(c2, eta, ux, uy)

Classes

InfoSolverSW1L(**kargs)

Information about the solver SW1L.

Simul(params)

A solver of the shallow-water 1 layer equations (SW1L).