Jet#
- class fridom.nonhydro.initial_conditions.jet.Jet(mset: ModelSettings, jet_strength=1, jet_width=0.16, pert_strength=0.05, pert_wavenum=5, geo_proj=True)[source]#
Bases:
StateA 3D jet with horizontal and vertical shear.
Description#
Superposition of a zonal jet and a geostrophic perturbation. Following the setup of Chouksey et al. 2022. For very large jet_strengths, convective instabilities can occur.
Parameters#
- msetModelSettings
The model settings.
- jet_strengthfloat
The strength of the zonal jets.
- jet_widthfloat
The width of the zonal jets.
- pert_strengthfloat
The strength of the perturbation.
- pert_wavenumint
The wavenumber of the perturbation.
- geo_projbool
Whether to project the initial condition to the geostrophic subspace.
Examples#
import fridom.nonhydro as nh # Set up the model settings fac = 7 grid = nh.grid.cartesian.Grid( N=(2**fac, 2**fac, 2**(fac-3)), L=(4, 4, 1), periodic_bounds=(True, True, True)) mset = nh.ModelSettings(grid=grid, f0=1, N2=1.0, dsqr=0.2**2, Ro=0.1) mset.time_stepper.dt = 2**(-fac) * 2 mset.setup() # Create the initial conditions model = nh.Model(mset) model.z = nh.initial_conditions.Jet( mset, jet_strength=2, jet_width=0.16, pert_strength=0.1, pert_wavenum=2) model.run(runlen=50.0)
- __init__(mset: ModelSettings, jet_strength=1, jet_width=0.16, pert_strength=0.05, pert_wavenum=5, geo_proj=True)[source]#
Methods
__init__(mset[, jet_strength, jet_width, ...])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).
bBuoyancy
cflThe CFL number.
ekinThe kinetic energy
epotThe potential energy
etotThe total energy
field_listReturn the list of fields.
gridReturn the grid of the model.
linear_pot_vortLinearized potential vorticity
local_RoLocal Rossby number
pot_vortScaled potential vorticity field.
rel_vortThe relative vorticity
rel_vort_xX-component of the relative vorticity
rel_vort_yY-component of the relative vorticity
rel_vort_zZ-component of the relative vorticity (Horizontal Vorticity)
uVelocity in the x-direction.
vVelocity in the y-direction.
wVelocity in the z-direction.
xrState as xarray dataset
xrsState of sliced domain as xarray dataset