This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Defines | |
#define | SPLINES_BC AXITRUE |
#define | NULGRAD 0 |
#define | NUL 1 |
#define | NULGRAD2 2 |
Functions | |
void | bc_vector_bound (real2D u, real2D v, int nx, int ny) |
void | bc_vector (real2D u, real2D cu, real2D v, real2D cv, int nx, int ny) |
void | bc_vector_div (real2D u, real2D v, real2D ap, interface in, int nx, int ny) |
void | bc_pressure_inside (real2D p, real2D ap, int nx, int ny) |
void | bc_pressure (real2D p, real2D ap, real pe, real R, int nx, int ny) |
void | bc_scalar (real2D scal, int nx, int ny, char sw) |
int | bc_xcoord (int i, int nx) |
int | bc_ycoord (int j, int ny) |
|
Definition at line 11 of file make_bc.h. Referenced by bc_scalar(), mgsolve(), and mgvcycle(). |
|
Definition at line 10 of file make_bc.h. Referenced by bc_pressure(), bc_scalar(), mgfas(), mginit(), mgvcycle(), and timestep(). |
|
Definition at line 12 of file make_bc.h. Referenced by bc_scalar(), mgvcycle(), pressure(), and timestep(). |
|
|
|
Definition at line 143 of file make_bc_wall.c. References bc_pressure_inside(), real, and real2D. Referenced by timestep().
00146 { 00147 int i, j; 00148 00149 bc_pressure_inside(p, ap, nx, ny); 00150 for (i = 2; i < nx; i++) { 00151 #ifdef WALL_TOP 00152 p[i][ny] = p[i][ny-1]; 00153 #else 00154 p[i][ny] = rp_pressure(pe, R, (real)i + 0.5, (real)ny + 0.5, nx, ny); 00155 #endif 00156 p[i][1] = p[i][2]; /* axisymmetric */ 00157 } 00158 for (j = 2; j < ny; j++) { 00159 #ifdef WALL_LEFT 00160 p[1][j] = p[2][j]; 00161 #else 00162 p[1][j] = rp_pressure(pe, R, 1.5, (real)j + 0.5, nx, ny); 00163 #endif 00164 #ifdef WALL_RIGHT 00165 p[nx][j] = p[nx-1][j]; 00166 #else 00167 p[nx][j] = rp_pressure(pe, R, (real)nx + 0.5, (real)j + 0.5, nx, ny); 00168 #endif 00169 } 00170 } |
|
Definition at line 132 of file make_bc_wall.c. Referenced by bc_pressure().
00133 { 00134 int i, j; 00135 00136 for (i = 2; i < nx; i++) 00137 for (j = 2; j < ny; j++) 00138 if (!INP(i,j)) 00139 p[i][j] = 0.0; 00140 } |
|
Definition at line 153 of file make_bc_grad.c. References NUL, NULGRAD, NULGRAD2, and real2D. Referenced by bc_pressure(), mgfas(), mginit(), mgsolve(), mgvcycle(), and pressure().
00154 { 00155 int i, j; 00156 00157 /* div: gradient equal to zero on y=0,1 planes */ 00158 switch(sw) { 00159 case NULGRAD: 00160 for (i = 1; i <= nx; i++) 00161 { 00162 scal[i][1] = scal[i][2]; 00163 scal[i][ny] = scal[i][ny - 1]; 00164 } 00165 for (j = 1; j <= ny; j++) { 00166 scal[1][j] = scal[2][j]; 00167 scal[nx][j] = scal[nx-1][j]; 00168 } 00169 break; 00170 case NULGRAD2: 00171 for (i = 1; i <= nx; i++) 00172 scal[i][1] = scal[i][2]; 00173 break; 00174 case NUL: 00175 /* residue equal to zero on the walls */ 00176 for (i = 1; i <= nx; i++) 00177 scal[i][1] = scal[i][ny] = 0.0; 00178 for (j = 1; j <= ny; j++) 00179 scal[1][j] = scal[nx][j] = 0.0; 00180 break; 00181 default: 00182 printf("illegal switch value for a scalar field\n"); 00183 exit(1); 00184 } 00185 } |
|
|
|
Definition at line 29 of file make_bc_grad.c. References real2D. Referenced by bc_vector(), bc_vector_div(), initialize(), and timestep().
00030 { 00031 int i, j; 00032 /* top and bottom walls */ 00033 for (i = 1; i <= nx; i++) { 00034 u[i][1] = u[i][2]; 00035 v[i][2] = 0.0; 00036 u[i][ny] = 2.*u[i][ny-1] - u[i][ny-2]; 00037 v[i][ny] = 2.*v[i][ny-1] - v[i][ny-2]; 00038 } 00039 /* left and right walls */ 00040 for (j = 1; j <= ny; j++) { 00041 u[1][j] = 2.*u[2][j] - u[3][j]; 00042 u[nx][j] = 2.*u[nx-1][j] - u[nx-2][j]; 00043 v[1][j] = 2.*v[2][j] - v[3][j]; 00044 v[nx][j] = 2.*v[nx-1][j] - v[nx-2][j]; 00045 } 00046 } |
|
Definition at line 68 of file make_bc_wall.c. References bc_vector_bound(), BU, BV, extra_velocity(), INU, INV, real, real2D, and UNDEFINED. Referenced by timestep().
00071 { 00072 int i, j; 00073 real eu, ev; 00074 00075 /* extrapolate the interfacial cells */ 00076 for (i = 3; i < nx; i++) { 00077 for (j = 2; j < ny; j++) 00078 if (!INU(i,j) && BU(i,j)) { 00079 /* 00080 if (INU(i+1,j) && INU(i-1,j)) { 00081 u[i][j] = (u[i+1][j] + u[i-1][j])/2.; 00082 printf("average u: %d,%d + %d,%d\n", i+1, j, i-1, j); 00083 } 00084 else if (INU(i,j+1) && INU(i,j-1)) { 00085 u[i][j] = (u[i][j+1] + u[i][j-1])/2.; 00086 printf("average u: %d,%d + %d,%d\n", i, j+1, i, j-1); 00087 } 00088 else { 00089 */ 00090 #ifdef EXTRA_LINEAR 00091 extra_velocity((real)i, (real)j + 0.5, u, v, ap, in, 00092 &eu, &ev, nx, ny); 00093 #else 00094 extra_velocity2((real)i, (real)j + 0.5, u, v, ap, in, 00095 &eu, &ev, nx, ny); 00096 #endif 00097 u[i][j] = eu; 00098 /* } */ 00099 } 00100 else if (!INU(i,j)) 00101 u[i][j] = UNDEFINED; 00102 for (j = 3; j < ny; j++) 00103 if (!INV(i,j) && BV(i,j)) { 00104 /* 00105 if (INV(i+1,j) && INV(i-1,j)) { 00106 v[i][j] = (v[i+1][j] + v[i-1][j])/2.; 00107 printf("average v: %d,%d + %d,%d\n", i+1, j, i-1, j); 00108 } 00109 else if (INV(i,j+1) && INV(i,j-1)) { 00110 v[i][j] = (v[i][j+1] + v[i][j-1])/2.; 00111 printf("average v: %d,%d + %d,%d\n", i, j+1, i, j-1); 00112 } 00113 else { 00114 */ 00115 #ifdef EXTRA_LINEAR 00116 extra_velocity((real)i + 0.5, (real)j, u, v, ap, in, 00117 &eu, &ev, nx, ny); 00118 #else 00119 extra_velocity2((real)i + 0.5, (real)j, u, v, ap, in, 00120 &eu, &ev, nx, ny); 00121 #endif 00122 v[i][j] = ev; 00123 /* } */ 00124 } 00125 else if (!INV(i,j)) 00126 v[i][j] = UNDEFINED; 00127 } 00128 bc_vector_bound(u, v, nx, ny); 00129 } |
|
Definition at line 188 of file make_bc_grad.c.
00189 { 00190 /* mirror symmetric boundary conditions */ 00191 if (i <= 1) 00192 return 3 - i; 00193 if (i >= nx) 00194 return 2*nx - i - 1; 00195 return i; 00196 } |
|
Definition at line 199 of file make_bc_grad.c.
00200 { 00201 /* mirror symmetric boundary conditions */ 00202 if (j <= 1) 00203 return 3 - j; 00204 if (j >= ny) 00205 return 2*ny - j - 1; 00206 return j; 00207 } |