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:
StateTwo 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_dictReturn the dictionary of arrays (not FieldVariables).
cflThe CFL number.
ekinVertically integrated kinetic energy
epotVertically integrated kinetic energy
etotThe total energy
field_listReturn the list of fields.
gridReturn the grid of the model.
local_RoLocal Rossby number
pPressure \(p = g \eta\), where \(\eta\) is the free surface elevation.
pot_vortScaled potential vorticity field.
rel_vortRelative vorticity
uVelocity in the x-direction.
vVelocity in the y-direction.
xrState as xarray dataset
xrsState of sliced domain as xarray dataset
Examples using
fridom.shallowwater.initial_conditions.Jet#