Jet

Contents

Jet#

class fridom.shallowwater.initial_conditions.jet.Jet(mset: ModelSettings, wavenum: int = 2, waveamp: float = 0.1, pos: float = 0.5, width: float = 0.1, geo_proj: bool = True)[source]#

Bases: State

Two opposing instable jets.

Description#

An instable jet setup with a small pressure perturbation on top of it. The jet is given by:

\[u = \exp\left(-\left(\frac{y - p L_y}{\sigma L_y}\right)^2\right)\]

where \(L_y\) is the domain length in the y-direction, \(p\) is the relative position of the jet and \(\sigma\) is the relative width of the jet. The perturbation is given by:

\[p = A \sin \left( \frac{2 \pi}{L_x} k_p x \right)\]

where \(A\) is the amplitude of the perturbation and \(k_p\) is the wavenumber of the perturbation. When geo_proj is set to True, the initial condition is projected to the geostrophic subspace using the geostrophic eigenvectors.

Parameters#

msetModelSettings

The model settings.

wavenumint

The relative wavenumber of the perturbation.

waveampfloat

The amplitude of the perturbation.

posfloat

The relative position of the jet in the y-direction

widthfloat

The relative width of the jet.

geo_projbool

Whether to project the initial condition to the geostrophic subspace.

__init__(mset: ModelSettings, wavenum: int = 2, waveamp: float = 0.1, pos: float = 0.5, width: float = 0.1, geo_proj: bool = True)[source]#

Methods

__init__(mset[, wavenum, waveamp, pos, ...])

dot(other)

Calculate the dot product of the state with another state.

fft([padding])

Calculate the Fourier transform of the state.

from_netcdf(mset, path)

Read the state from a NetCDF file.

has_nan()

Check if the state contains NaN values.

ifft([padding])

Calculate the inverse Fourier transform of the state.

norm_l2()

Calculate the L2 norm of the state.

norm_of_diff(other)

The norm of the difference between two states.

project(p_vec, q_vec)

Project the state on a (spectral) vector.

sync()

Synchronize the state.

to_netcdf(path)

Write the state to a NetCDF file.

Attributes

arr_dict

Return the dictionary of arrays (not FieldVariables).

cfl

The CFL number.

ekin

Vertically integrated kinetic energy

epot

Vertically integrated kinetic energy

etot

The total energy

field_list

Return the list of fields.

grid

Return the grid of the model.

local_Ro

Local Rossby number

p

Pressure \(p = g \eta\), where \(\eta\) is the free surface elevation.

pot_vort

Scaled potential vorticity field.

rel_vort

Relative vorticity

u

Velocity in the x-direction.

v

Velocity in the y-direction.

xr

State as xarray dataset

xrs

State of sliced domain as xarray dataset

Examples using fridom.shallowwater.initial_conditions.Jet#

Barotropic Instability

Barotropic Instability