Main Page   Data Structures   File List   Data Fields   Globals  

make_bc_rad.c File Reference

#include "utilf.h"
#include "stypes.h"
#include "markers.h"
#include "extra.h"
#include "make_bc.h"
#include "make_bc_periodic.h"

Include dependency graph for make_bc_rad.c:

Include dependency graph

Go to the source code of this file.

Functions

void bc_vector_bound (real2D u, real2D v, real R, real Rp, real xc, int nx, int ny)
void bc_vector (real2D u, real2D a, real2D v, real2D c, interface in, real R, real Rp, int nx, int ny)
void bc_vector_div (real2D u, real2D a, real2D v, real2D c, interface in, real R, real Rp, int nx, int ny)
void bc_pressure (real2D p, real2D cc, interface in, real pe, real pg, real pR, real R, real Rp, int nx, int ny)
void bc_tensor (real2D S11, real2D S22, real2D S12, 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)


Function Documentation

void bc_pressure real2D    p,
real2D    cc,
interface    in,
real    pe,
real    pg,
real    pR,
real    R,
real    Rp,
int    nx,
int    ny
 

Definition at line 119 of file make_bc_rad.c.

References bc_scalar(), NULGRAD, real, and real2D.

00122 {
00123   int i, j;
00124 
00125   /* extrapolate the interfacial cells */
00126   for (i = 2; i < nx; i++) {
00127     for (j = 2; j < ny; j++) {
00128       if (cc[i][j] > 0.0 && cc[i][j] < 1.0)
00129         p[i][j] = interplate_p(p, cc, in,
00130                                0.5 + (real)i, 0.5 + (real)j, nx, ny);
00131       if (cc[i][j] == 0.0)
00132         p[i][j] = pg;
00133     }
00134   }
00135 
00136   for (i = 1; i <= nx; i++)
00137     p[i][ny - 1] = rp_pressure(pe, pR, R, Rp, 
00138                                0.5 + (real)i, 0.5 + (real)(ny - 1), 
00139                                0.5*(nx - 2.) + 2.);
00140   for (j = 1; j <= ny; j++) {
00141     p[2][j] = rp_pressure(pe, pR, R, Rp, 
00142                           2.5, 0.5 + (real)j, 
00143                           0.5*(nx - 2.) + 2.);
00144     p[nx - 1][j] = rp_pressure(pe, pR, R, Rp, 
00145                                0.5 + (real)(nx - 1), 0.5 + (real)j,
00146                                0.5*(nx - 2.) + 2.);
00147   }
00148   bc_scalar(p, nx, ny, NULGRAD);
00149 }

void bc_scalar real2D    scal,
int    nx,
int    ny,
char    sw
 

Definition at line 168 of file make_bc_rad.c.

References NUL, NULGRAD, NULGRAD2, and real2D.

00169 {
00170   int i, j;
00171   
00172   /*  div: gradient equal to zero on y=0,1 planes  */
00173   switch(sw) {
00174     case NULGRAD:
00175       for (i = 1; i <= nx; i++)
00176         {
00177           scal[i][1] = scal[i][2];
00178           scal[i][ny] = scal[i][ny - 1];
00179         }
00180       for (j = 1; j <= ny; j++) {
00181         scal[1][j] = scal[2][j];
00182         scal[nx][j] = scal[nx-1][j];
00183       }
00184       break;
00185     case NULGRAD2:
00186       for (i = 1; i <= nx; i++)
00187         scal[i][1] = scal[i][2];
00188       break;
00189     case NUL:
00190       /*  residue equal to zero on the walls  */ 
00191       for (i = 1; i <= nx; i++)
00192         scal[i][1] = scal[i][ny] = 0.0;
00193       for (j = 1; j <= ny; j++)
00194         scal[1][j] = scal[nx][j] = 0.0;
00195       break;
00196     default:
00197       printf("illegal switch value for a scalar field\n");
00198       exit(1);
00199   }
00200 }

void bc_tensor real2D    S11,
real2D    S22,
real2D    S12,
int    nx,
int    ny
 

Definition at line 152 of file make_bc_rad.c.

References real2D.

00153 {
00154   int i, j;
00155   
00156   /*  slip conditions on the walls S12 = 0  */
00157   for (i = 2; i <= nx - 1; i++) {
00158     S12[i][2] = 0.0;
00159     S12[i][ny] = S12[i][ny-1];
00160   }
00161   for (j = 2; j <= ny - 1; j++) {
00162     S12[2][j] = S12[3][j];
00163     S12[nx][j] = S12[nx-1][j];
00164   }
00165 }

void bc_vector real2D    u,
real2D    a,
real2D    v,
real2D    c,
interface    in,
real    R,
real    Rp,
int    nx,
int    ny
 

Definition at line 62 of file make_bc_rad.c.

References bc_vector_bound(), INTERPLATE_FULL, real, and real2D.

00066 {
00067   int i, j;
00068 
00069   /* extrapolate the interfacial cells */
00070   for (i = 2; i < nx; i++)
00071     for (j = 2; j < ny; j++) {
00072       if (a[i-1][j] > 0.0 && a[i-1][j] < 1.0)
00073         u[i][j] = interplate_u(u, a, NULL,
00074                                (real)i, 0.5 + (real)j, nx, ny, INTERPLATE_FULL);
00075       if (i != 2 && a[i-1][j] == 0.0)
00076         u[i][j] = 0.0;
00077       if (c[i][j-1] > 0.0 && c[i][j-1] < 1.0)
00078         v[i][j] = interplate_v(v, c, NULL, 
00079                                0.5 + (real)i, (real)j, nx, ny, INTERPLATE_FULL);
00080       if (c[i][j-1] == 0.0)
00081         v[i][j] = 0.0;
00082     }
00083 
00084   bc_vector_bound(u, v, R, Rp, 0.5*(nx - 2.) + 2., nx, ny);
00085 }

void bc_vector_bound real2D    u,
real2D    v,
real    R,
real    Rp,
real    xc,
int    nx,
int    ny
 

Definition at line 31 of file make_bc_rad.c.

References cube, real, real2D, and sq.

00034 {
00035   int i, j;
00036   real r;
00037 
00038   R *= R;
00039   /* top and bottom walls */
00040   for (i = 1; i <= nx; i++) {
00041     u[i][1] = u[i][2];
00042     v[i][2] = 0.0;
00043     r = sqrt(sq((real)i - xc) + sq((real)ny + 0.5 - 2.));
00044     u[i][ny] = R/cube(r)*Rp*((real)i - xc);
00045     r = sqrt(sq((real)i + 0.5 - xc) + sq((real)ny - 2.));
00046     v[i][ny] = R/cube(r)*Rp*((real)ny - 2.);
00047   }
00048   /* left and right walls */
00049   for (j = 1; j <= ny; j++) {
00050     r = sqrt(sq(2. - xc) + sq((real)j + 0.5 - 2.));
00051     u[2][j] = R/cube(r)*Rp*(2. - xc);
00052     r = sqrt(sq((real)nx - xc) + sq((real)j + 0.5 - 2.));
00053     u[nx][j] = R/cube(r)*Rp*((real)nx - xc);
00054     r = sqrt(sq(1.5 - xc) + sq((real)j - 2.));
00055     v[1][j] = R/cube(r)*Rp*((real)j - 2.);
00056     r = sqrt(sq((real)nx + 0.5 - xc) + sq((real)j - 2.));
00057     v[nx][j] = R/cube(r)*Rp*((real)j - 2.);
00058   }
00059 }

void bc_vector_div real2D    u,
real2D    a,
real2D    v,
real2D    c,
interface    in,
real    R,
real    Rp,
int    nx,
int    ny
 

Definition at line 88 of file make_bc_rad.c.

References bc_vector_bound(), extra_velocity(), real, and real2D.

00092 {
00093   int i, j;
00094   real eu, ev, a11, a22, a12, a21;
00095 
00096   /* extrapolate the interfacial cells */
00097   for (i = 2; i < nx; i++)
00098     for (j = 2; j < ny; j++) {
00099       if (a[i-1][j] > 0.0 && a[i-1][j] < 1.0) {
00100         extra_velocity((real)i, 0.5 + (real)j, u, a, v, c, in, 
00101                        &eu, &ev, &a11, &a22, &a12, &a21, nx, ny);
00102         u[i][j] = eu;
00103       }
00104       if (i != 2 && a[i-1][j] == 0.0)
00105         u[i][j] = 0.0;
00106       if (c[i][j-1] > 0.0 && c[i][j-1] < 1.0) {
00107         extra_velocity(0.5+(real)i, (real)j, u, a, v, c, in, 
00108                        &eu, &ev, &a11, &a22, &a12, &a21, nx, ny);
00109         v[i][j] = ev;
00110       }
00111       if (c[i][j-1] == 0.0)
00112         v[i][j] = 0.0;
00113     }
00114 
00115   bc_vector_bound(u, v, R, Rp, 0.5*(nx - 2.) + 2., nx, ny);
00116 }

int bc_xcoord int    i,
int    nx
 

Definition at line 203 of file make_bc_rad.c.

00204 {
00205   /* mirror symmetric boundary conditions */
00206   if (i <= 1)
00207     return 3 - i;
00208   if (i >= nx)
00209     return 2*nx - i - 1;
00210   return i;
00211 }

int bc_ycoord int    j,
int    ny
 

Definition at line 214 of file make_bc_rad.c.

00215 {
00216   /* mirror symmetric boundary conditions */
00217   if (j <= 1)
00218     return 3 - j;
00219   if (j >= ny)
00220     return 2*ny - j - 1;
00221   return j;
00222 }


Generated on Wed Feb 19 22:27:45 2003 for Markers by doxygen1.2.18