#include "utilf.h"#include "stypes.h"#include "markers.h"#include "extra.h"#include "extra1.h"#include "make_bc.h"#include "make_bc_periodic.h"#include "inout.h"Include dependency graph for make_bc_wall.c:

Go to the source code of this file.
Defines | |
| #define | WALL_LEFT |
| #define | WALL_TOP |
Functions | |
| void | bc_vector_bound (real2D u, real2D v, 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 20 of file make_bc_wall.c. |
|
|
Definition at line 22 of file make_bc_wall.c. |
|
||||||||||||||||||||||||||||
|
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 173 of file make_bc_wall.c. References NUL, NULGRAD, NULGRAD2, and real2D. Referenced by bc_pressure(), mgfas(), mginit(), mgsolve(), mgvcycle(), and pressure().
00174 {
00175 int i, j;
00176
00177 /* div: gradient equal to zero on y=0,1 planes */
00178 switch(sw) {
00179 case NULGRAD:
00180 for (i = 1; i <= nx; i++) {
00181 scal[i][1] = scal[i][2]; /* axisymmetric */
00182 scal[i][ny] = scal[i][ny - 1];
00183 }
00184 for (j = 1; j <= ny; j++) {
00185 scal[1][j] = scal[2][j];
00186 scal[nx][j] = scal[nx-1][j];
00187 }
00188 break;
00189 case NULGRAD2:
00190 for (i = 1; i <= nx; i++)
00191 scal[i][1] = scal[i][2]; /* axisymmetric */
00192 #ifdef WALL_LEFT
00193 for (j = 1; j <= ny; j++)
00194 scal[1][j] = scal[2][j];
00195 #endif
00196 #ifdef WALL_RIGHT
00197 for (j = 1; j <= ny; j++)
00198 scal[nx][j] = scal[nx-1][j];
00199 #endif
00200 #ifdef WALL_TOP
00201 for (i = 1; i <= nx; i++)
00202 scal[i][ny] = scal[i][ny-1];
00203 #endif
00204 break;
00205 case NUL:
00206 /* residue equal to zero on the walls */
00207 for (i = 1; i <= nx; i++) {
00208 scal[i][1] = 0.0; /* axisymmetric */
00209 scal[i][ny] = 0.0;
00210 }
00211 for (j = 1; j <= ny; j++)
00212 scal[1][j] = scal[nx][j] = 0.0;
00213 break;
00214 default:
00215 printf("illegal switch value for a scalar field\n");
00216 exit(1);
00217 }
00218 }
|
|
||||||||||||||||||||
|
Definition at line 36 of file make_bc_wall.c. References real2D. Referenced by bc_vector(), bc_vector_div(), initialize(), and timestep().
00037 {
00038 int i, j;
00039 /* top and bottom walls */
00040 for (i = 1; i <= nx; i++) {
00041 u[i][1] = u[i][2]; /* axisymmetric */
00042 v[i][2] = 0.0; /* axisymmetric */
00043 u[i][ny] = u[i][ny-1];
00044 #ifdef WALL_TOP
00045 v[i][ny] = 0.0;
00046 #else
00047 v[i][ny+1] = v[i][ny];
00048 #endif
00049 }
00050 /* left and right walls */
00051 for (j = 1; j <= ny; j++) {
00052 #ifdef WALL_LEFT
00053 u[2][j] = 0.0;
00054 #else
00055 u[1][j] = u[2][j];
00056 #endif
00057 #ifdef WALL_RIGHT
00058 u[nx][j] = 0.0;
00059 #else
00060 u[nx+1][j] = u[nx][j];
00061 #endif
00062 v[1][j] = v[2][j];
00063 v[nx][j] = v[nx-1][j];
00064 }
00065 }
|
|
||||||||||||||||||||||||||||
|
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 221 of file make_bc_wall.c.
00222 {
00223 /* mirror symmetric boundary conditions */
00224 if (i <= 1)
00225 return 3 - i;
00226 if (i >= nx)
00227 return 2*nx - i - 1;
00228 return i;
00229 }
|
|
||||||||||||
|
Definition at line 232 of file make_bc_wall.c.
00233 {
00234 /* mirror symmetric boundary conditions */
00235 if (j <= 1)
00236 return 3 - j;
00237 if (j >= ny)
00238 return 2*ny - j - 1;
00239 return j;
00240 }
|
1.2.18