Grid Generation

Preamble

This page is meant for the discretization of geometrically simple domains, specifically rectangles and radial annulii. For more complicated domains you will need to use a more sophisticated grid generator like CUBIT or other such programs. CUBIT can be licensed free (at least to US institutions) for educational purposes. In case you do use CUBIT, please refer to Kate Hedstrom's manual

Creating the executable

Here is the gzipped and tarred file for simple-domain grid generation. Follow the directions below to generate a grid:
  1. Uncompress and untar the file. This will create a directory called Rect.
  2. Edit the Makefile to set the right compiler and its flags. The code is written in F90.
  3. Build the executables
     make rectelem
     make radelem
    
  4. Run the code, for example "rectelem < rectelem.in". The grid is written to a file called fort.8; its format is explained in the tutorial. By default, the boundary conditions listed are of type Dirichlet all around the domain boundaries. The format of the rectelem.in file is described below.

Format of rectelem.in

The file should have the following information:
nx ny npts	        ! line1
xc(1) xc(2) ... xc(nx)	! nx x-coordinates of element corners
yc(1) yc(2) ... yc(ny)	! ny y-coordinates of element corners
The example above will create a grid with (nx-1) elements in the x-direction, (ny-1) elements in the y-direction, and each element will have npts*npts collocation points at the Gauss-Lobatto roots of the Legendre polynomial of degree (npts-1). If a staggered pressure grid file needs to be generated the code can be run again with npts replaced by npts-2.

The format of the radelem.in file is the same except that the x-direction refers now to the radial direction, and the y-direction to the azimuthal direction. The coordinates in the azimuthal direction are in degrees. Do not duplicate the first and last node in the azimuthal direction since the domain is assumed periodic azimuthally. Notice that the elements are curved in this case, and care must taken to make sure the shape of the element can be well represented by the isoparametric mapping, i.e. the spectral expansion is high enough to represent the distortion (in general the mapping is tolerant of some pretty distorted elements).
The picture shows the elemental grid created with radelem.in. The element number is shown inside each element and the interior collocation points are omitted. This figure was created with a drawcoast script .