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(only_root=False, **kargs)[source]
Bases:
InfoSolverPseudoSpectral
Information about the solver SW1L.
- _init_root()[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:
fluidsim.base.time_stepping.pseudo_spect.TimeSteppingPseudoSpectral
fluidsim.solvers.sw1l.OperatorsPseudoSpectralSW1L
fluidsim.base.preprocess.pseudo_spect.PreprocessPseudoSpectral
Solver-specific first-level classes are added:
fluidsim.solvers.sw1l.output.OutputSW1L
fluidsim.solvers.sw1l.forcing.ForcingSW1L
- class fluidsim.solvers.sw1l.solver.Simul(params)[source]
Bases:
SimulBasePseudoSpectral
A solver of the shallow-water 1 layer equations (SW1L).
- 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(state_spect=None, old=None)[source]
Compute the nonlinear tendencies.
- Parameters:
- state_spect
fluidsim.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.
- state_spect
- Returns:
- tendencies_fft
fluidsim.base.setofvariables.SetOfVariables
An array containing the tendencies for the velocities \(\mathbf u\) and the surface displacement scalar \(\eta\).
- tendencies_fft
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 cross-product of absolute potential vorticity with velocity. |
|
Classes
|
Information about the solver SW1L. |
|
A solver of the shallow-water 1 layer equations (SW1L). |