next up previous contents
Next: Running the test Up: Cavity flow Previous: Initial conditions   Contents

Boundary conditions

Boundary conditions for the testXY case are specified by ensuring that all boundary markers are no-slip boundary conditions of type 4. The testXZ case is somewhat more complicated, as the western and eastern-most edge is of type 4 with the channel sides parallel to the flow closed with type 1. No-slip top and bottom boundary conditions are specified by setting CdT -1 and CdB -1 in suntans.dat. Deflection of the free surface, as would be expected to be developed in response to flows, is controlled via the rigid lid approximation by setting grav=9.81e6 in suntans.dat.

For the testXY case all boundary velocities are 0 except the lid as specified in BoundaryVelocities() of boundariesXY.c via

  for(jptr=grid->edgedist[4];jptr<grid->edgedist[5];jptr++) {
    j = grid->edgep[jptr];
    ib=grid->grad[2*j];
    boundary_index = jptr-grid->edgedist[2];

    for(k=grid->ctop[ib];k<grid->Nk[ib];k++) {
      if(grid->ye[j]<0.000010)
        phys->boundary_u[boundary_index][k]= 1.0;
      else
       phys->boundary_u[boundary_index][k] = 0.0;
       phys->boundary_v[boundary_index][k] = 0.0;
       phys->boundary_w[boundary_index][k] = 0.0;
    }
  }
Observe that this function specifies the boundary value for each edge of type 4, where the lid (located at the southern end of the domain) is driven by a constant flow towards the east.

The boundary conditions for testXZ are somewhat similar, but have the driven lid on the western most end of the domain with flow towards the south. Their specification in BoundaryVelocities() in boundariesXZ.c follows.

  for(jptr=grid->edgedist[4];jptr<grid->edgedist[5];jptr++) {

    j = grid->edgep[jptr];
    ib=grid->grad[2*j];
    boundary_index = jptr-grid->edgedist[2];

    for(k=grid->ctop[ib];k<grid->Nk[ib];k++) {
      if(grid->xe[j]<0.5)
        phys->boundary_w[boundary_index][k]= -1.0;
      else
        phys->boundary_w[boundary_index][k]=0.0;
      phys->boundary_v[boundary_index][k] = 0.0;
      phys->boundary_u[boundary_index][k] = 0.0;
    }
  }
The lid velocity for both cases is unity to allow easy specification of Reynolds numbers via $\nu$.


next up previous contents
Next: Running the test Up: Cavity flow Previous: Initial conditions   Contents
2014-08-06