예제 #1
0
def test():

    sim = Simulation()  # Create a simulation object

    # Geometry and Model Equations
    sim.geomx = 'walls'
    sim.geomy = 'walls'
    sim.stepper = Step.AB3
    sim.method = 'Spectral'
    sim.dynamics = 'Nonlinear'
    sim.flux_method = Flux.spectral_sw

    # Specify paramters
    sim.Lx = 4000e3
    sim.Ly = 4000e3
    sim.Nx = 128
    sim.Ny = 128
    sim.Nz = 1
    sim.g = 9.81
    sim.f0 = 1.e-4
    sim.beta = 0e-11
    sim.cfl = 0.1
    sim.Hs = [100.]
    sim.rho = [1025.]
    sim.end_time = 5. * minute

    sim.animate = 'None'
    sim.output = False
    sim.diagnose = False

    # Initialize the grid and zero solutions
    sim.initialize()

    for ii in range(sim.Nz):  # Set mean depths
        sim.soln.h[:, :, ii] = sim.Hs[ii]

    # Gaussian initial conditions
    W = 200.e3  # Width
    amp = 1.  # Amplitude
    sim.soln.h[:, :, 0] += amp * np.exp(-(sim.X / W)**2 - (sim.Y / W)**2)

    # Run the simulation
    sim.run()
예제 #2
0
def test():

    sim = Simulation()  # Create a simulation object

    # Geometry and Model Equations
    sim.geomx       = 'periodic'
    sim.geomy       = 'periodic'
    sim.stepper     = Step.AB3      
    sim.method      = 'Spectral'    
    sim.dynamics    = 'Nonlinear'  
    sim.flux_method = Flux.spectral_sw 

    # Specify paramters
    sim.Lx  = 4000e3  
    sim.Ly  = 4000e3   
    sim.Nx  = 128       
    sim.Ny  = 128      
    sim.Nz  = 1         
    sim.g   = 9.81       
    sim.f0  = 1.e-4       
    sim.beta = 0e-11       
    sim.cfl = 0.1           
    sim.Hs  = [100.]         
    sim.rho = [1025.]         
    sim.end_time = 5.*minute 

    sim.animate = 'None'    
    sim.output = False       
    sim.diagnose = False

    # Initialize the grid and zero solutions
    sim.initialize()

    for ii in range(sim.Nz):  # Set mean depths
        sim.soln.h[:,:,ii] = sim.Hs[ii]

    # Gaussian initial conditions
    W  = 200.e3                # Width
    amp = 1.                  # Amplitude
    sim.soln.h[:,:,0] += amp*np.exp(-(sim.X/W)**2 - (sim.Y/W)**2)

    # Run the simulation
    sim.run() 
예제 #3
0
sim.run_name = '2D GeoAdjust'

# Geometry and Model Equations
sim.geomx       = 'periodic'       # Geometry Types: 'periodic' or 'walls'
sim.geomy       = 'periodic'
sim.stepper     = Step.AB3         # Time-stepping algorithm: Euler, AB2, RK4
sim.method      = 'Spectral'       # Numerical method: 'Spectral'
sim.dynamics    = 'Nonlinear'      # Dynamics: 'Nonlinear' or 'Linear'
sim.flux_method = Flux.spectral_sw # Flux method: spectral_sw is only option currently

# Specify paramters
sim.Lx  = 4000e3          # Domain extent               (m)
sim.Ly  = 3000e3          # Domain extent               (m)
sim.Nx  = 128               # Grid points in x
sim.Ny  = 128             # Grid points in y
sim.Nz  = 1               # Number of layers
sim.g   = 9.81            # Gravity                     (m/sec^2)
sim.f0  = 1.e-4           # Coriolis                    (1/sec)
sim.beta = 0e-11          # Coriolis beta parameter     (1/m/sec)
sim.cfl = 0.1             # CFL coefficient             (m)
sim.Hs  = [100.]          # Vector of mean layer depths (m)
sim.rho = [1025.]         # Vector of layer densities   (kg/m^3)
sim.end_time = 2.*24.*hour   # End Time                    (sec)

# Parallel? Only applies to the FFTWs
sim.num_threads = 4

# Plotting parameters
sim.plott   = 15.*minute  # Period of plots
sim.animate = 'Anim'      # 'Save' to create video frames,
                          # 'Anim' to animate,
예제 #4
0
sim.run_name = '2D_Bickley_Jet_H500'

# Geometry and Model Equations
sim.geomx = 'periodic'  # Geometry Types: 'periodic' or 'walls'
sim.geomy = 'walls'
sim.stepper = Step.AB3  # Time-stepping algorithm: Euler, AB2, RK4
sim.method = 'Spectral'  # Numerical method: 'Spectral'
sim.dynamics = 'Nonlinear'  # Dynamics: 'Nonlinear' or 'Linear'
sim.flux_method = Flux.spectral_sw  # Flux method: spectral_sw is only option currently

# Specify paramters
sim.Lx = 200e3  # Domain extent               (m)
sim.Ly = 200e3  # Domain extent               (m)
sim.Nx = 128  # Grid points in x
sim.Ny = 128  # Grid points in y
sim.Nz = 1  # Number of layers
sim.g = 9.81  # Gravity                     (m/sec^2)
sim.f0 = 1.e-4  # Coriolis                    (1/sec)
sim.beta = 0e-10  # Coriolis beta               (1/m/sec)
sim.Hs = [500.]  # Vector of mean layer depths (m)
sim.rho = [1025.]  # Vector of layer densities   (kg/m^3)
sim.end_time = 20 * 24. * hour  # End Time                    (sec)

# Parallel? Only applies to the FFTWs
sim.num_threads = 32

# Plotting parameters
sim.plott = 12. * hour  # Period of plots
sim.animate = 'Save'  # 'Save' to create video frames,
# 'Anim' to animate,
# 'None' otherwise