Exemplo n.º 1
0
# plot
param.plot_var = 'pv'
param.freq_plot = 10
a = 4.
param.cax = [-a, a]
param.plot_interactive = True
param.plot_psi = True
param.plot_pvback = True
param.colorscheme = 'symmetric'
param.imshow_interpolation = 'bilinear'
param.generate_mp4 = True

# physics
param.beta = 1.
param.Rd = 0.1  # 2*grid.dx
param.bottom_torque = True
param.forcing = False
param.forcing_module = 'forcing_dipoles'
param.noslip = False
param.diffusion = False

grid = Grid(param)
param.Kdiff = 0.1e-3 * grid.dx

# add an island
# grid.msk[28:32,34:38]=0
# grid.finalize()

f2d = Fluid2d(param, grid)
model = f2d.model
Exemplo n.º 2
0
param.list_diag = ['pv', 'pv2']
param.freq_his = 1
param.freq_diag = 1

# plot
param.plot_var = 'pv'
param.freq_plot = 10
a = 0.2
param.cax = [-a, a]
param.plot_interactive = False
param.colorscheme = 'symmetric'
param.generate_mp4 = False

# physics
param.beta = 0.
param.Rd = 10.  # 2*grid.dx
param.forcing = False
param.noslip = False
param.diffusion = False

grid = Grid(param)
param.Kdiff = 0.1e-3 * grid.dx

f2d = Fluid2d(param, grid)
model = f2d.model

xr, yr = grid.xr, grid.yr
vor = model.var.get('pv')


def vortex(param, grid, x0, y0, sigma, vortex_type, ratio=1):
Exemplo n.º 3
0
param.list_diag = ['ke', 'pv', 'pv2']
param.freq_his = 50
param.freq_diag = 10

# plot
param.plot_var = 'pv'
param.freq_plot = 10
a = 0.5
param.cax = [-a, a]
param.plot_interactive = True
param.colorscheme = 'imposed'
param.generate_mp4 = False

# physics
param.beta = 1.
param.Rd = 0.01  # 2*grid.dx
param.forcing = False
param.noslip = False
param.diffusion = False

grid = Grid(param)
param.Kdiff = 0.1e-3 * grid.dx

# add an island
# grid.msk[28:32,34:38]=0
# grid.finalize()

f2d = Fluid2d(param, grid)
model = f2d.model

xr, yr = grid.xr, grid.yr
Exemplo n.º 4
0
# *** plot ***
param.plot_var='pv' # variable to plot (depends on the model)
param.freq_plot=10 # number of time step between two plots
param.cax=[-1,1] # colorscale if colorscheme='imposed'
param.plot_interactive=False # activate the interactive plot
param.colorscheme='imposed' # 'imposed', 'minmax', 'symmetric'
param.plotting_module='plotting_adv' # name of the plotting
                                     # script. The default one is
                                     # core/plotting.py



# *** physics ***
param.beta=1.  # beta parameter (for QG model only)
param.Rd=1.    # Rossby deformation radius (for QG only)
param.gravity=1. # for Boussinesq model
param.forcing = True  # activate the forcing
param.forcing_module='forcing_dbl_gyre' #python module name where the forcing is defined
param.noslip = False # active the no-slip boundary condition (causes energy dissipation)
param.diffusion=False # activate a diffusion on tracer.
param.additional_tracer=['tracer'] # you may add an additional passive
                                   # tracer, by simply adding this
                                   # line. Example in inverse_cascade.py


grid  = Grid(param) # define the grid coordinates grid.xr, grid.yr and
                    # the mask, grid.msk. You may modify the mask just below

param.Kdiff=0.5e-4*grid.dx # diffusion coefficient (same for all
                           # tracers), there is a possibility to
Exemplo n.º 5
0
param.list_diag = 'all'
param.freq_his = 50
param.freq_diag = 10

# plot
param.plot_var = 'pv'
param.freq_plot = 10
a = 0.5
param.cax = [-a, a]
param.plot_interactive = True
param.colorscheme = 'imposed'
param.generate_mp4 = True

# physics
param.beta = 1.
param.Rd = 1.  # 2*grid.dx
param.forcing = True
param.noslip = False
param.diffusion = False

grid = Grid(param)
param.Kdiff = 0.5e-4 * grid.dx

# add an island
# grid.msk[28:32,34:38]=0
# grid.finalize_msk()

f2d = Fluid2d(param, grid)
model = f2d.model

# set the forcing
Exemplo n.º 6
0
param.list_diag = 'all'
param.freq_his = 20
param.freq_diag = 5.

# plot
param.plot_var = 'pv'
param.freq_plot = 10
a = 0.5
param.cax = [-a, a]
param.plot_interactive = True
param.colorscheme = 'imposed'
param.generate_mp4 = False

# physics
param.beta = 1.
param.Rd = .1
param.forcing = False
param.forcing_module = 'forcing'  # not yet implemented
param.noslip = False
param.diffusion = False
param.isisland = True

psi0 = -5e-4  # this sets psi on the Northern wall (psi=0 on the Southern wall)

grid = Grid(param)

nh = grid.nh


def disc(param, grid, x0, y0, sigma):
    """ function to set up a circular island
Exemplo n.º 7
0
param.list_diag = ['ke', 'pv', 'pv2']
param.freq_plot = 5
param.freq_his = 10
param.freq_diag = 1

# plot
param.plot_interactive = True
param.plot_psi = True
param.cmap = 'inferno'
param.plot_var = 'pv'
param.cax = np.array([-1, 1]) * .5
param.colorscheme = 'imposed'

# physics
param.beta = 1.
param.Rd = 50.  # 2*grid.dx
param.forcing = False
param.noslip = False
param.diffusion = False
#
# you may activate the forcing and use the forcing below
# it's a white noise forcing with some time correlation
# such forcing is often used in turbulence studies
# param.forcing_module='forcing_euler'

grid = Grid(param)
param.Kdiff = 5e-4 * grid.dx

f2d = Fluid2d(param, grid)
model = f2d.model