Mesh generation
Contents
Grid generation tool
We recommend SMS [1] for grid generation.
Beware of CFL number
You may be familiar with the CFL restriction associated with explicit (mode-splitting) models; the CFL number, defined as
CFL=(|u|+sqrt(g*h))*dt/dx
must be <1 for given dx,dt in such models. Here h is the local water depth, and u is the flow velocity. Note that the sqrt() term is related to surface wave celerity.
Being an implicit model using Eulerian-Lagrangian method (ELM), SELFE has a somewhat opposite requirement: CFL>0.4. Therefore care must be taken in the grid generation process; otherwise numerical diffusion in ELM would ruin your results, which may manifest itself in the form of either noise or dissipation.
With xmgredit5[2], you can very easily visualize CFL for the entire grid. Note, however, that CFL number is undefined when h<0. In these shallow regions, we should use |u| alone and neglect the wave celerity term (sqrt(g*h)). E.g., if we estimate |u| ~ 1m/s, with a time step of 100s, the max. dx in regions of h<0 should be 250m; with dt=50s, dx_max=125m.
Viz CFL number in xmgredit5
- xmgredit5 -belel -1.e-10 hgrid.gr3 (note: '-belel -1.e-10' is used mainly to increase precision for lat/lon grid)
- since the CFL inside ACE is calculated without u, we should impose a min depth of 0.1 (so that sqrt(g*h)>=1m/s); you can do this by:
Edit-->Edit over grid/regions-->Evaluate, and then in the dialogue box, type depth=max(depth,0.1). (Note that the Evaluate function is also very useful for generation of other .gr3 files needed by SELFE) - Special-->Dimensionless numbers, and then in the right half of the dialogue box, type in dt, Warning value (say 0.4), Unacceptable value (say 0.4) and depress 'Display filled' button. The color will appear in the main window, with red indicating good CFL, and green for bad CFL. You may also 'Display Courant number' but this may take a while to refresh, and so you may want to zoom into a small region first.
- revise your grid accordingly
Remember, if you have to reduce the time step for some reason, you may have to refine grid because of CFL. It's wise to plan for a smallest dt you expect to use for a system, and design your grid according to this dt. This issue is closely related to the convergence property of SELFE[3].
In tsunami simulations, dt has to be small due to small wavelength, and you can bypass the CFL condition by turning off advection in deeper depths as the advection is negligible there. You also need to make sure that each wavelength is resolved by at least 20 grid points.
Grid near wetting and drying
It's important to have the grid follow the initial shoreline. Reasonable grid transition should be done from shoreline to dryland. Use comaprable or finer grid resolution in the dryland that is expected to be wetted, and then transition to coarser resolution beyond (to account for rare inunation).
Barotropic simulation
Grid quality requirement is relatively lax for barotropic simulations. Besides the considerations above, you mainly need to use appropriate resolution based on physics (e.g., generally coarser resolution in deeper depths and finer resolution for shallow depths). Remember: you are on unstructured grid territory, and so you are free to resolve features as you wish!
Another commonly asked question is the max. element skewness. SELFE, in either barotropic or baroclinic configuration, can tolerate elements as skew as 20! (skewness is defined as the ratio between the max. side and the equivalent radius)
Baroclinic simulation
The transport process is influenced by your choice of grid, and so grid for baroclinic simulations needs some attention. For example, the channels should be gridded as quasi-structured grid ('Patches' in SMS).
The Courant number condition for transport should be accounted for during gridgen. In SELFE, the time steps used for momentum and transport can be different, with the latter being usually smaller (the model will automatically calculate the transport step for you and do sub-cycling). The Courant number condition for the transport equations is:
Cu=c*|u|*dtb/dx<1
where c=1 for upwind and c<1 for TVD; dtb is the transport time step.
Therefore for upwind/TVD schemes, you should avoid accessively refining areas that expect high flow. This is particularly important for TVD. Fortunately, there are tools to help you identify 'choke' regions. Here File:SaltIntrusionwithSELFE-Oct2011.pdf is a document on how to do a good salt intrusion study with SELFE's TVD scheme.