# finally, we need to impose the flow condition to make the gas move # an example would be a shear flow, established by having the upper boundary # giving a 'kick' in a prefered direction, such as: for j in range(0,lenx): if cell[1,j-1]&2: # anything coming in from the left, goes right, comes in from right, reflected back right celln[0,j] += 32 #upper boundary is even if cell[1,j]&4: celln[0,j] += 32 #upper boundary is even # note that a shear boundary is much easier than flow across the boundary since mass needs to be conserved # in the interor of the problem