BarotropicJet

BarotropicJet#

class fridom.nonhydro.initial_conditions.barotropic_jet.BarotropicJet(mset: ModelSettings, wavenum=5, waveamp=0.1, jet_width=0.04, geo_proj=True)[source]#

Bases: State

Barotropic instable jet setup with 2 zonal jets

Description#

A Barotropic instable jet setup with 2 zonal jets and a perturbation on top of it. The jet is given by:

\[u = 2.5 \left( \exp\left(-\left(\frac{y - 0.75 L_y}{\sigma L_y \pi}\right)^2\right) - \exp\left(-\left(\frac{y - 0.25 L_y}{\sigma L_y \pi}\right)^2\right) \right)\]

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

\[v = 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 wavenumber of the perturbation.

waveampfloat

The amplitude of the perturbation.

jet_widthfloat

The width of the jet.

geo_projbool

Whether to project the initial condition to the geostrophic subspace.

__init__(mset: ModelSettings, wavenum=5, waveamp=0.1, jet_width=0.04, geo_proj=True)[source]#

Methods

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

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).

b

Buoyancy

cfl

The CFL number.

ekin

The kinetic energy

epot

The potential energy

etot

The total energy

field_list

Return the list of fields.

grid

Return the grid of the model.

linear_pot_vort

Linearized potential vorticity

local_Ro

Local Rossby number

pot_vort

Scaled potential vorticity field.

rel_vort

The relative vorticity

rel_vort_x

X-component of the relative vorticity

rel_vort_y

Y-component of the relative vorticity

rel_vort_z

Z-component of the relative vorticity (Horizontal Vorticity)

u

Velocity in the x-direction.

v

Velocity in the y-direction.

w

Velocity in the z-direction.

xr

State as xarray dataset

xrs

State of sliced domain as xarray dataset

Examples using fridom.nonhydro.initial_conditions.BarotropicJet#

Barotropic Jet

Barotropic Jet