next up previous contents
Next: No-slip boundary conditions Up: Specifying boundary conditions Previous: Open or velocity-specified boundary   Contents

Open or stage-specified boundary conditions

A good example of specifying stage boundary conditions (type 3) is the suntans/main/examples/ estuary example, where a stage boundary condition is specified at the ocean boundary to the west of the domain. A simplified tidal signal is specified via the following code contained within the function BoundaryVelocities() of suntans/main/examples/estuary/boundaries.c.

  for(iptr=grid->celldist[1];iptr<grid->celldist[2];iptr++) {
    i = grid->cellp[iptr];

In this example, type 2 boundary conditions result in indicies to computational cells adjacent to type 2 boundary condition being stored in [ celldist[1], celldist[2]). Stage information for these cells can then be specified by setting the cell stage via the cell pointer i=grid->cellp[iptr]. In this example, prop->amp specifies tidal amplitude $A$, prop->omega specifies the frequency $\omega$, and prop->rtime the simulation time $t$ within the prototype function $h = -A\sin\left(\omega t\right)$.