tset F and G in boundary cells - ns2dfd - 2D finite difference Navier Stokes solver for fluid dynamics
 (HTM) git clone git://src.adamsgaard.dk/ns2dfd
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) LICENSE
       ---
 (DIR) commit 58f406613c0c30ec7f453095e1d9399539341ad5
 (DIR) parent e3c43ff247f84337b66a8782d923b7e293ae03d5
 (HTM) Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
       Date:   Tue,  4 Mar 2014 11:27:50 +0100
       
       set F and G in boundary cells
       
       Diffstat:
         M src/main.c                          |       2 ++
         M src/solution.c                      |      10 ++++++++++
       
       2 files changed, 12 insertions(+), 0 deletions(-)
       ---
 (DIR) diff --git a/src/main.c b/src/main.c
       t@@ -82,6 +82,8 @@ int main(int argc, char** argv)
            allocate_matrix(&RES, nx+2, ny+2);
        
            print_matrix("P", P, nx+2, ny+2);
       +    print_matrix("U", U, nx+2, ny+2);
       +    print_matrix("V", V, nx+2, ny+2);
            while (t <= t_end+dt) {
        
                dt = select_time_step(tau, re, dx, dy, nx, ny, U, V);
 (DIR) diff --git a/src/solution.c b/src/solution.c
       t@@ -88,6 +88,16 @@ void compute_f_g(double **F, double **G,
                                - duv_dx(U, V, i, j, dx, gamma)
                                - dvv_dy(V, i, j, dy, gamma)
                                + gy);
       +
       +    for (j=1; j<=ny; j++) {
       +        F[0][j]  = U[0][j];
       +        F[nx][j] = U[nx][j];
       +    }
       +
       +    for (i=1; i<=nx; i++) {
       +        G[i][0]  = V[i][0];
       +        G[i][ny] = V[i][ny];
       +    }
        }
        
        /* Find the right hand side value of the Poisson equation */