0
$\begingroup$

I have a code given by my professor in which he applies the boundary conditions for the lid driven cavity flow. All the enforcement of boundary conditions I have seen elsewhere completely differ from what he has done. In this case, he has set the link coefficients of all neighbor cells to 0 and only the considered cell to 1 for all the boundary walls and only for the top wall he has given 1 for the source term. For example when solving the U-Momentum:

! set boundary conditions for coefficients in the equations
! south
    aw(:,1)=0.
    ae(:,1)=0.
    as(:,1)=0.
    an(:,1)=0.
    ap(:,1)=1.
    su(:,1)=0.
! west
    aw(1,:)=0.
    ae(1,:)=0.
    as(1,:)=0.
    an(1,:)=0.
    ap(1,:)=1.
    su(1,:)=0.
! north
    aw(:,iNyUNodes)=0.
    ae(:,iNyUNodes)=0.
    as(:,iNyUNodes)=0.
    an(:,iNyUNodes)=0.
    ap(:,iNyUNodes)=1.
    su(:,iNyUNodes)=1.

! east
    aw(iNxUNodes,:)=0.
    ae(iNxUNodes,:)=0.
    as(iNxUNodes,:)=0.
    an(iNxUNodes,:)=0.
    ap(iNxUNodes,:)=1.
    su(iNxUNodes,:)=0.

I have tried to understand why he has done this, but I'm not getting any intuition at all. I can send a link of the code if needed. What I have tried so far:

  1. Tried changing all the coefficients to 1, which diverges the solution.
  2. Tried changing all coefficients to 1 except the corresponding wall, i.e. if south wall, as = 0. Also diverges the solution.
  3. Tried using a small value for the source, which resulted in expected behavior of a symmetric contour for the u-velocity since for a small lid velocity, diffusion would dominate.
$\endgroup$
2
  • $\begingroup$ I imagine these terribly-named variables have some meaning (e.g., the second letter indicates west, east, south, north, ?, ?), but without seeing it in context, I doubt anyone can address this. Perhaps it might be better to simply ask the person who gave you this code? $\endgroup$
    – Kyle Kanos
    Commented Feb 8, 2023 at 22:13
  • $\begingroup$ @KyleKanos yes, this was the work of our professor who gave us this code for an assignment with no context. I have figured it out recently but as you said the question itself couldn't be answered without seeing the whole code and with more context. I'll probably remove the question. $\endgroup$ Commented Feb 9, 2023 at 23:04

0