This is a finite-differencing model for the stream function-relative voticity equation:
-
$\psi$ is the stream function whose dimension is$U^2L$ with$U$ and$L$ denoting the characteristic velocity scale and length scale; -
$\zeta=\nabla^2\psi=(\partial_{xx}+\partial_{yy})\psi$ is the relative vorticity with a dimension of$1/T$ and time scale$T$ ; -
$k_d=1/R_d$ is the reciprocal of the deformation radius$R_d=\sqrt{gH}/f_0$ with the gravitational acceleration$g$ , mean water depth$H$ , and the Coriolis parameter$f_0$ ; -
$J(\psi,\zeta)=\psi_x\zeta_y-\zeta_x\psi_y$ is the nonlinear advection written in a Jacobian form; -
$\beta$ is the topographic beta effect, it has a dimension of$1/(LT)$ ; -
$\gamma$ is the Ekman decaying rate with dimension$T^{-1}$ ; -
$Q$ is the forcing in terms of$\zeta$ injection thus its dimension is$T^{-2}$ .
The
In this project, we use the
The geometry configuration was captured by a camera as real-color pictures saved in ./for_grid_gen/. The location/orientation of the wall was varied in some experiments, so you may find multiple images there. The following is an example showing one configuration in the experiment:
Each image can be used by genXYgrid_vect.m to create a gird file for a specific geometry configuration. The grid file is named as N?.mat with ? standing for the horizontal grid resolution(default value 500. It should be noted that if changing the resolution to a higher value, say 1000, the number of iteration used for the Possion-equation solver needs to be increased as well, otherwise the level of numerical convergence is low and the large-scale pattern cannot be presented correctly. Ps the computation cost for the high-resolution runs could be much more expensive than those low-resolution runs). The grid file must be generated before runing the code and is saved in the same directory as genXYgrid_vect.m.
The square domain occupied by the tank is discretized into a horizontal Cartesian grid. Only the region inside the tank is modeled.
genXYgrid_vect.m defines the boundary points(the points located at the side wall of the tank), ghost points(points dropping outside of the tank with a distance of 1 genXYgrid_vect.m with one side joining the tank wall. Therefore there are 4 sides for the numerical domain.
sweep_run.m defines the parameter space to survey and runs the model using each combination of these parameters. The key parameters are:
- amplitude of the forcign vortex: Amp,
$s^-2$ ; - radius of the forcing vortex: forcing_R , cm;
- barotropic deformation radius: Rd,cm;
- Ekman friction: gamma,
$s^{-1}$ ; - bulck viscosity: Ah,
$cm^2/s$
Given the simplicity of the sweep_run.m, user can also specify
- the total time of integration:T_tot,s;
- output frequency:dt,s;
- logical switch for the types of the boundary condition: noslip=true by default;
- logical switch for nonlinear advection: nonlinear=true by default; otherwise the nonlinear term won't be included.
pars.m checks if this is a new run or a restart from any previous run. If there is no folder with the name specified as the parameter combination given in sweep_run.m, then a new folder will be created and the output files from the new run will be saved there. If there exists a folder with the same name as specified by the parameter combination in sweep_run.m and that folder contains multiple output files (.mat), then this is a restart run. Its initial condition is given by the last output file from the previous run. The restart run then append output files to the old folder. pars.m also contains other experimental parameters needed for the simulation and useful coefficients for the Possion equation solver and those for the time marching schemes.
main_iter_4step_RungeKutta.m is the main iteration. It marches the governning eq. in time using 4th-order explicit Runge-Kutta scheme for the nonlinear term(with Arakawa 1966's conserving scheme for the spatial discretization) if nonlinear=true, and explicit (2nd-order central differencing) for the other terms(beta term, Ekman term, diffusion term).
allocate_matrices.m initialize the useful matrices by allocating 1D vectors for them. This allocation is called everytime when the model starts (no matter if it is a new run or a restart run). When time integration finishes without overflow, the final-step
One example of the simulation results is shown in the .
bplume_slantwall_unrotate_lab.m formulated a Double-Fourier(linear) theory. This theory is used to decompose the total wave field into the incidental and the reflected ones in a rectangular domain (a Cartesian coordinate system). It shows that the formation of the meanders at the flanks of the
