Partial 3D seq
This commit is contained in:
parent
4c374c82c7
commit
7dc7ab68d1
@ -39,11 +39,15 @@ $(BUILD_DIR)/%.s: %.c
|
|||||||
|
|
||||||
.PHONY: clean distclean tags info asm format
|
.PHONY: clean distclean tags info asm format
|
||||||
|
|
||||||
clean:
|
clean: vis
|
||||||
$(info ===> CLEAN)
|
$(info ===> CLEAN)
|
||||||
@rm -rf $(BUILD_DIR)
|
@rm -rf $(BUILD_DIR)
|
||||||
@rm -f tags
|
@rm -f tags
|
||||||
|
|
||||||
|
vis:
|
||||||
|
$(info ===> REMOVING VIZUALISATION FILES)
|
||||||
|
@rm -f vtk_files/particle*.vtk
|
||||||
|
|
||||||
distclean: clean
|
distclean: clean
|
||||||
$(info ===> DIST CLEAN)
|
$(info ===> DIST CLEAN)
|
||||||
@rm -f $(TARGET)
|
@rm -f $(TARGET)
|
||||||
|
@ -7,56 +7,64 @@
|
|||||||
|
|
||||||
name backstep # name of flow setup
|
name backstep # name of flow setup
|
||||||
|
|
||||||
bcTop 1 # flags for boundary conditions
|
bcLeft 3 # flags for boundary conditions
|
||||||
bcBottom 1 # 1 = no-slip 3 = outflow
|
bcRight 3 # 1 = no-slip 3 = outflow
|
||||||
bcLeft 3 # 2 = free-slip 4 = periodic
|
bcBottom 1 # 2 = free-slip 4 = periodic
|
||||||
bcRight 3 #
|
bcTop 1 #
|
||||||
|
bcFront 1 #
|
||||||
|
bcBack 1 #
|
||||||
|
|
||||||
gx 0.0 # Body forces (e.g. gravity)
|
gx 0.0 # Body forces (e.g. gravity)
|
||||||
gy 0.0 #
|
gy 0.0 #
|
||||||
|
gz 0.0 #
|
||||||
|
|
||||||
re 36500.0 # Reynolds number
|
re 36000.0 # Reynolds number
|
||||||
|
|
||||||
u_init 1.0 # initial value for velocity in x-direction
|
u_init 0.0 # initial value for velocity in x-direction
|
||||||
v_init 0.0 # initial value for velocity in y-direction
|
v_init 0.0 # initial value for velocity in y-direction
|
||||||
p_init 1.0 # initial value for pressure
|
w_init 0.0 # initial value for velocity in z-direction
|
||||||
|
p_init 1.0 # initial value for pressure
|
||||||
|
|
||||||
# Geometry Data:
|
# Geometry Data:
|
||||||
# -------------
|
# -------------
|
||||||
|
|
||||||
xlength 7.0 # domain size in x-direction
|
xlength 7.0 # domain size in x-direction
|
||||||
ylength 1.5 # domain size in y-direction
|
ylength 1.5 # domain size in y-direction
|
||||||
imax 210 # number of interior cells in x-direction
|
zlength 1.0 # domain size in z-direction
|
||||||
jmax 45 # number of interior cells in y-direction
|
imax 70 # number of interior cells in x-direction
|
||||||
|
jmax 15 # number of interior cells in y-direction
|
||||||
|
kmax 10 # number of interior cells in z-direction
|
||||||
|
|
||||||
# Time Data:
|
# Time Data:
|
||||||
# ---------
|
# ---------
|
||||||
|
|
||||||
te 60.0 # final time
|
te 60.0 # final time
|
||||||
dt 0.02 # time stepsize
|
dt 0.02 # time stepsize
|
||||||
tau 0.5 # safety factor for time stepsize control (<0 constant delt)
|
tau 0.5 # safety factor for time stepsize control (<0 constant delt)
|
||||||
|
|
||||||
# Pressure Iteration Data:
|
# Pressure Iteration Data:
|
||||||
# -----------------------
|
# -----------------------
|
||||||
|
|
||||||
itermax 500 # maximal number of pressure iteration in one time step
|
itermax 500 # maximal number of pressure iteration in one time step
|
||||||
eps 0.0001 # stopping tolerance for pressure iteration
|
eps 0.0001 # stopping tolerance for pressure iteration
|
||||||
rho 0.52
|
omg 0.52
|
||||||
omg 1.8 # relaxation parameter for SOR iteration
|
omg 1.7 # relaxation parameter for SOR iteration
|
||||||
gamma 0.9 # upwind differencing factor gamma
|
gamma 0.9 # upwind differencing factor gamma
|
||||||
|
|
||||||
# Particle Tracing Data:
|
# Particle Tracing Data:
|
||||||
# -----------------------
|
# -----------------------
|
||||||
|
|
||||||
numberOfParticles 200
|
numberOfParticles 200
|
||||||
startTime 0
|
startTime 100
|
||||||
injectTimePeriod 1.0
|
injectTimePeriod 2.0
|
||||||
writeTimePeriod 0.5
|
writeTimePeriod 0.2
|
||||||
|
|
||||||
x1 0.0
|
x1 0.0
|
||||||
y1 0.5
|
y1 0.0
|
||||||
|
z1 1.0
|
||||||
x2 0.0
|
x2 0.0
|
||||||
y2 1.5
|
y2 4.0
|
||||||
|
z2 1.0
|
||||||
|
|
||||||
# Obstacle Geometry Data:
|
# Obstacle Geometry Data:
|
||||||
# -----------------------
|
# -----------------------
|
||||||
@ -68,7 +76,7 @@ yCenter 0.0
|
|||||||
zCenter 0.0
|
zCenter 0.0
|
||||||
xRectLength 2.0
|
xRectLength 2.0
|
||||||
yRectLength 1.0
|
yRectLength 1.0
|
||||||
zRectLength 1.0
|
zRectLength 2.0
|
||||||
circleRadius 1.0
|
circleRadius 1.0
|
||||||
|
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
|
21011
BasicSolver/3D-seq/backstep.vtk
Normal file
21011
BasicSolver/3D-seq/backstep.vtk
Normal file
File diff suppressed because it is too large
Load Diff
@ -18,9 +18,9 @@ gx 0.0 # Body forces (e.g. gravity)
|
|||||||
gy 0.0 #
|
gy 0.0 #
|
||||||
gz 0.0 #
|
gz 0.0 #
|
||||||
|
|
||||||
re 100.0 # Reynolds number
|
re 5000.0 # Reynolds number
|
||||||
|
|
||||||
u_init 1.0 # initial value for velocity in x-direction
|
u_init 0.0 # initial value for velocity in x-direction
|
||||||
v_init 0.0 # initial value for velocity in y-direction
|
v_init 0.0 # initial value for velocity in y-direction
|
||||||
w_init 0.0 # initial value for velocity in z-direction
|
w_init 0.0 # initial value for velocity in z-direction
|
||||||
p_init 0.0 # initial value for pressure
|
p_init 0.0 # initial value for pressure
|
||||||
@ -38,7 +38,7 @@ kmax 40 # number of interior cells in z-direction
|
|||||||
# Time Data:
|
# Time Data:
|
||||||
# ---------
|
# ---------
|
||||||
|
|
||||||
te 60.0 # final time
|
te 200.0 # final time
|
||||||
dt 0.02 # time stepsize
|
dt 0.02 # time stepsize
|
||||||
tau 0.5 # safety factor for time stepsize control (<0 constant delt)
|
tau 0.5 # safety factor for time stepsize control (<0 constant delt)
|
||||||
|
|
||||||
@ -54,10 +54,10 @@ gamma 0.9 # upwind differencing factor gamma
|
|||||||
# Particle Tracing Data:
|
# Particle Tracing Data:
|
||||||
# -----------------------
|
# -----------------------
|
||||||
|
|
||||||
numberOfParticles 30
|
numberOfParticles 200
|
||||||
startTime 10
|
startTime 0
|
||||||
injectTimePeriod 2.0
|
injectTimePeriod 2.0
|
||||||
writeTimePeriod 2.0
|
writeTimePeriod 1.0
|
||||||
|
|
||||||
x1 1.0
|
x1 1.0
|
||||||
y1 0.0
|
y1 0.0
|
||||||
@ -70,7 +70,7 @@ z2 1.0
|
|||||||
# -----------------------
|
# -----------------------
|
||||||
# Shape 0 disable, 1 Rectangle/Square, 2 Circle
|
# Shape 0 disable, 1 Rectangle/Square, 2 Circle
|
||||||
|
|
||||||
shape 2
|
shape 1
|
||||||
xCenter 10.0
|
xCenter 10.0
|
||||||
yCenter 2.0
|
yCenter 2.0
|
||||||
zCenter 2.0
|
zCenter 2.0
|
||||||
|
328008
BasicSolver/3D-seq/canal.vtk
328008
BasicSolver/3D-seq/canal.vtk
File diff suppressed because it is too large
Load Diff
@ -100,8 +100,8 @@ int main(int argc, char** argv)
|
|||||||
double te = s.te;
|
double te = s.te;
|
||||||
double t = 0.0;
|
double t = 0.0;
|
||||||
|
|
||||||
printGrid(&s, s.seg);
|
// printGrid(&s, s.seg);
|
||||||
exit(0);
|
// exit(0);
|
||||||
|
|
||||||
timeStart = getTimeStamp();
|
timeStart = getTimeStamp();
|
||||||
|
|
||||||
@ -118,7 +118,7 @@ int main(int argc, char** argv)
|
|||||||
solver_generic[variant - 1](&s);
|
solver_generic[variant - 1](&s);
|
||||||
adaptUV(&s);
|
adaptUV(&s);
|
||||||
|
|
||||||
trace(&particletracer, s.u, s.v, s.w, t);
|
trace(&particletracer, s.u, s.v, s.w, s.seg, t);
|
||||||
|
|
||||||
t += s.dt;
|
t += s.dt;
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
#define U(i, j, k) u[(k) * (imax + 2) * (jmax + 2) + (j) * (imax + 2) + (i)]
|
#define U(i, j, k) u[(k) * (imax + 2) * (jmax + 2) + (j) * (imax + 2) + (i)]
|
||||||
#define V(i, j, k) v[(k) * (imax + 2) * (jmax + 2) + (j) * (imax + 2) + (i)]
|
#define V(i, j, k) v[(k) * (imax + 2) * (jmax + 2) + (j) * (imax + 2) + (i)]
|
||||||
#define W(i, j, k) w[(k) * (imax + 2) * (jmax + 2) + (j) * (imax + 2) + (i)]
|
#define W(i, j, k) w[(k) * (imax + 2) * (jmax + 2) + (j) * (imax + 2) + (i)]
|
||||||
|
#define S(i, j, k) seg[(k) * (imax + 2) * (jmax + 2) + (j) * (imax + 2) + (i)]
|
||||||
|
|
||||||
static int ts = 0;
|
static int ts = 0;
|
||||||
unsigned int seed = 32767;
|
unsigned int seed = 32767;
|
||||||
@ -47,7 +48,7 @@ void injectParticles(ParticleTracer* particletracer)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void advanceParticles(ParticleTracer* particletracer, double* restrict u, double* restrict v, double* restrict w, double time)
|
void advanceParticles(ParticleTracer* particletracer, double* restrict u, double* restrict v, double* restrict w, int* restrict seg, double time)
|
||||||
{
|
{
|
||||||
int imax = particletracer->imax;
|
int imax = particletracer->imax;
|
||||||
int jmax = particletracer->jmax;
|
int jmax = particletracer->jmax;
|
||||||
@ -167,6 +168,11 @@ void advanceParticles(ParticleTracer* particletracer, double* restrict u, double
|
|||||||
{
|
{
|
||||||
particletracer->particlePool[i].flag = false;
|
particletracer->particlePool[i].flag = false;
|
||||||
}
|
}
|
||||||
|
int i_new = new_x/dx, j_new = new_y/dy, k_new = new_z/dz;
|
||||||
|
if(S(i_new, j_new, k_new) != NONE)
|
||||||
|
{
|
||||||
|
particletracer->particlePool[i].flag = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -256,7 +262,7 @@ void printParticleTracerParameters(ParticleTracer* particletracer)
|
|||||||
printf("\tdt : %.2f, dx : %.2f, dy : %.2f, dz : %.2f\n", particletracer->dt, particletracer->dx, particletracer->dy, particletracer->dz);
|
printf("\tdt : %.2f, dx : %.2f, dy : %.2f, dz : %.2f\n", particletracer->dt, particletracer->dx, particletracer->dy, particletracer->dz);
|
||||||
}
|
}
|
||||||
|
|
||||||
void trace(ParticleTracer* particletracer, double* u, double* v, double* w, double time)
|
void trace(ParticleTracer* particletracer, double* u, double* v, double* w, int* seg, double time)
|
||||||
{
|
{
|
||||||
if (time >= particletracer->startTime)
|
if (time >= particletracer->startTime)
|
||||||
{
|
{
|
||||||
@ -272,7 +278,7 @@ void trace(ParticleTracer* particletracer, double* u, double* v, double* w, doub
|
|||||||
particletracer->lastWriteTime = time;
|
particletracer->lastWriteTime = time;
|
||||||
|
|
||||||
}
|
}
|
||||||
advanceParticles(particletracer, u, v, w, time);
|
advanceParticles(particletracer, u, v, w, seg, time);
|
||||||
compress(particletracer);
|
compress(particletracer);
|
||||||
particletracer->lastUpdateTime = time;
|
particletracer->lastUpdateTime = time;
|
||||||
}
|
}
|
||||||
|
@ -38,11 +38,11 @@ typedef struct {
|
|||||||
|
|
||||||
extern void initParticleTracer(ParticleTracer*, Parameter*);
|
extern void initParticleTracer(ParticleTracer*, Parameter*);
|
||||||
extern void injectParticles(ParticleTracer*);
|
extern void injectParticles(ParticleTracer*);
|
||||||
extern void advanceParticles(ParticleTracer*, double*, double*, double*, double);
|
extern void advanceParticles(ParticleTracer*, double*, double*, double*, int*,double);
|
||||||
extern void freeParticles(ParticleTracer*);
|
extern void freeParticles(ParticleTracer*);
|
||||||
extern void writeParticles(ParticleTracer*);
|
extern void writeParticles(ParticleTracer*);
|
||||||
extern void printParticleTracerParameters(ParticleTracer*);
|
extern void printParticleTracerParameters(ParticleTracer*);
|
||||||
extern void printParticles(ParticleTracer*);
|
extern void printParticles(ParticleTracer*);
|
||||||
extern void compress(ParticleTracer*);
|
extern void compress(ParticleTracer*);
|
||||||
extern void trace(ParticleTracer*, double*, double*, double*, double);
|
extern void trace(ParticleTracer*, double*, double*, double*, int*, double);
|
||||||
#endif
|
#endif
|
@ -1006,6 +1006,8 @@ void computeFG(Solver* s)
|
|||||||
double* f = s->f;
|
double* f = s->f;
|
||||||
double* g = s->g;
|
double* g = s->g;
|
||||||
double* h = s->h;
|
double* h = s->h;
|
||||||
|
int* seg = s->seg;
|
||||||
|
|
||||||
|
|
||||||
double gx = s->gx;
|
double gx = s->gx;
|
||||||
double gy = s->gy;
|
double gy = s->gy;
|
||||||
@ -1026,6 +1028,9 @@ void computeFG(Solver* s)
|
|||||||
for (int k = 1; k < kmax + 1; k++) {
|
for (int k = 1; k < kmax + 1; k++) {
|
||||||
for (int j = 1; j < jmax + 1; j++) {
|
for (int j = 1; j < jmax + 1; j++) {
|
||||||
for (int i = 1; i < imax + 1; i++) {
|
for (int i = 1; i < imax + 1; i++) {
|
||||||
|
|
||||||
|
if(S(i,j,k) == NONE)
|
||||||
|
{
|
||||||
du2dx = inverseDx * 0.25 *
|
du2dx = inverseDx * 0.25 *
|
||||||
((U(i, j, k) + U(i + 1, j, k)) *
|
((U(i, j, k) + U(i + 1, j, k)) *
|
||||||
(U(i, j, k) + U(i + 1, j, k)) -
|
(U(i, j, k) + U(i + 1, j, k)) -
|
||||||
@ -1151,6 +1156,117 @@ void computeFG(Solver* s)
|
|||||||
(W(i, j, k + 1) - 2.0 * W(i, j, k) + W(i, j, k - 1));
|
(W(i, j, k + 1) - 2.0 * W(i, j, k) + W(i, j, k - 1));
|
||||||
H(i, j, k) = W(i, j, k) + dt * (inverseRe * (dw2dx2 + dw2dy2 + dw2dz2) -
|
H(i, j, k) = W(i, j, k) + dt * (inverseRe * (dw2dx2 + dw2dy2 + dw2dz2) -
|
||||||
duwdx - dvwdy - dw2dz + gz);
|
duwdx - dvwdy - dw2dz + gz);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
switch (S(i, j, k)) {
|
||||||
|
case TOPFACE:
|
||||||
|
G(i, j, k) = V(i, j, k);
|
||||||
|
break;
|
||||||
|
case BOTTOMFACE:
|
||||||
|
G(i, j, k) = V(i, j, k);
|
||||||
|
break;
|
||||||
|
case LEFTFACE:
|
||||||
|
F(i, j, k) = U(i, j, k);
|
||||||
|
break;
|
||||||
|
case RIGHTFACE:
|
||||||
|
F(i, j, k) = U(i, j, k);
|
||||||
|
break;
|
||||||
|
case FRONTFACE:
|
||||||
|
H(i, j, k) = W(i, j, k);
|
||||||
|
break;
|
||||||
|
case BACKFACE:
|
||||||
|
H(i, j, k) = W(i, j, k);
|
||||||
|
break;
|
||||||
|
case FRONTLEFTLINE:
|
||||||
|
F(i, j, k) = 0.0;
|
||||||
|
H(i, j, k) = 0.0;
|
||||||
|
break;
|
||||||
|
case FRONTRIGHTLINE:
|
||||||
|
F(i, j, k) = 0.0;
|
||||||
|
H(i, j, k) = 0.0;
|
||||||
|
break;
|
||||||
|
case FRONTTOPLINE:
|
||||||
|
G(i, j, k) = 0.0;
|
||||||
|
H(i, j, k) = 0.0;
|
||||||
|
break;
|
||||||
|
case FRONTBOTTOMLINE:
|
||||||
|
G(i, j, k) = 0.0;
|
||||||
|
H(i, j, k) = 0.0;
|
||||||
|
break;
|
||||||
|
case MIDTOPLEFTLINE:
|
||||||
|
F(i, j, k) = 0.0;
|
||||||
|
G(i, j, k) = 0.0;
|
||||||
|
break;
|
||||||
|
case MIDTOPRIGHTLINE:
|
||||||
|
F(i, j, k) = U(i, j, k);
|
||||||
|
G(i, j, k) = V(i, j, k);
|
||||||
|
break;
|
||||||
|
case MIDBOTTOMLEFTLINE:
|
||||||
|
F(i, j, k) = 0.0;
|
||||||
|
G(i, j, k) = 0.0;
|
||||||
|
break;
|
||||||
|
case MIDBOTTOMRIGHTLINE:
|
||||||
|
F(i, j, k) = 0.0;
|
||||||
|
G(i, j, k) = 0.0;
|
||||||
|
break;
|
||||||
|
case BACKLEFTLINE:
|
||||||
|
F(i, j, k) = 0.0;
|
||||||
|
H(i, j, k) = 0.0;
|
||||||
|
break;
|
||||||
|
case BACKRIGHTLINE:
|
||||||
|
F(i, j, k) = 0.0;
|
||||||
|
H(i, j, k) = 0.0;
|
||||||
|
break;
|
||||||
|
case BACKTOPLINE:
|
||||||
|
G(i, j, k) = 0.0;
|
||||||
|
H(i, j, k) = 0.0;
|
||||||
|
break;
|
||||||
|
case BACKBOTTOMLINE:
|
||||||
|
G(i, j, k) = 0.0;
|
||||||
|
H(i, j, k) = 0.0;
|
||||||
|
break;
|
||||||
|
case FRONTTOPLEFTCORNER:
|
||||||
|
F(i, j, k) = 0.0;
|
||||||
|
G(i, j, k) = 0.0;
|
||||||
|
H(i, j, k) = 0.0;
|
||||||
|
break;
|
||||||
|
case FRONTTOPRIGHTCORNER:
|
||||||
|
F(i, j, k) = 0.0;
|
||||||
|
G(i, j, k) = 0.0;
|
||||||
|
H(i, j, k) = 0.0;
|
||||||
|
break;
|
||||||
|
case FRONTBOTTOMLEFTCORNER:
|
||||||
|
F(i, j, k) = 0.0;
|
||||||
|
G(i, j, k) = 0.0;
|
||||||
|
H(i, j, k) = 0.0;
|
||||||
|
break;
|
||||||
|
case FRONTBOTTOMRIGHTCORNER:
|
||||||
|
F(i, j, k) = 0.0;
|
||||||
|
G(i, j, k) = 0.0;
|
||||||
|
H(i, j, k) = 0.0;
|
||||||
|
break;
|
||||||
|
case BACKTOPLEFTCORNER:
|
||||||
|
F(i, j, k) = 0.0;
|
||||||
|
G(i, j, k) = 0.0;
|
||||||
|
H(i, j, k) = 0.0;
|
||||||
|
break;
|
||||||
|
case BACKTOPRIGHTCORNER:
|
||||||
|
F(i, j, k) = 0.0;
|
||||||
|
G(i, j, k) = 0.0;
|
||||||
|
H(i, j, k) = 0.0;
|
||||||
|
break;
|
||||||
|
case BACKBOTTOMLEFTCORNER:
|
||||||
|
F(i, j, k) = 0.0;
|
||||||
|
G(i, j, k) = 0.0;
|
||||||
|
H(i, j, k) = 0.0;
|
||||||
|
break;
|
||||||
|
case BACKBOTTOMRIGHTCORNER:
|
||||||
|
F(i, j, k) = 0.0;
|
||||||
|
G(i, j, k) = 0.0;
|
||||||
|
H(i, j, k) = 0.0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1215,8 +1331,8 @@ void adaptUV(Solver* s)
|
|||||||
void setObjectBoundaryCondition(Solver* s)
|
void setObjectBoundaryCondition(Solver* s)
|
||||||
{
|
{
|
||||||
int imax = s->grid.imax;
|
int imax = s->grid.imax;
|
||||||
int jmax = s->jmax;
|
int jmax = s->grid.jmax;
|
||||||
int kmax = s->kmax;
|
int kmax = s->grid.kmax;
|
||||||
double* u = s->u;
|
double* u = s->u;
|
||||||
double* v = s->v;
|
double* v = s->v;
|
||||||
double* w = s->w;
|
double* w = s->w;
|
||||||
@ -1226,152 +1342,136 @@ void setObjectBoundaryCondition(Solver* s)
|
|||||||
for (int i = 1; i < imax + 1; i++) {
|
for (int i = 1; i < imax + 1; i++) {
|
||||||
switch (S(i, j, k)) {
|
switch (S(i, j, k)) {
|
||||||
case TOPFACE:
|
case TOPFACE:
|
||||||
U(i, j, k) = -U(i, j + 1, k);
|
U(i, j, k) = -U(i, j+1, k);
|
||||||
U(i - 1, j, k) = -U(i - 1, j + 1, k);
|
|
||||||
V(i, j, k) = 0.0;
|
V(i, j, k) = 0.0;
|
||||||
W(i, j, k) = 0.0;
|
W(i, j, k) = -W(i, j+1, k);;
|
||||||
break;
|
break;
|
||||||
case BOTTOMFACE:
|
case BOTTOMFACE:
|
||||||
U(i, j, k) = -U(i, j - 1, k);
|
U(i, j, k) = -U(i, j-1, k);
|
||||||
U(i - 1, j, k) = -U(i - 1, j - 1, k);
|
|
||||||
V(i, j, k) = 0.0;
|
V(i, j, k) = 0.0;
|
||||||
W(i, j, k) = 0.0;
|
W(i, j, k) = -W(i, j-1, k);
|
||||||
break;
|
break;
|
||||||
case LEFTFACE:
|
case LEFTFACE:
|
||||||
U(i - 1, j, k) = 0.0;
|
U(i, j, k) = 0.0;
|
||||||
V(i, j, k) = -V(i - 1, j, k);
|
V(i, j, k) = -V(i-1, j, k);
|
||||||
V(i, j - 1, k) = -V(i - 1, j - 1, k);
|
W(i, j, k) = -W(i-1, j, k);
|
||||||
W(i, j, k) = 0.0;
|
|
||||||
break;
|
break;
|
||||||
case RIGHTFACE:
|
case RIGHTFACE:
|
||||||
U(i, j, k) = 0.0;
|
U(i, j, k) = 0.0;
|
||||||
V(i, j, k) = -V(i + 1, j, k);
|
V(i, j, k) = -V(i+1, j, k);
|
||||||
V(i, j - 1, k) = -V(i + 1, j - 1, k);
|
W(i, j, k) = -W(i+1, j, k);
|
||||||
W(i, j, k) = 0.0;
|
|
||||||
break;
|
break;
|
||||||
case FRONTFACE:
|
case FRONTFACE:
|
||||||
U(i - 1, j, k) = 0.0;
|
U(i, j, k) = -U(i, j, k-1);
|
||||||
V(i, j, k) = 0.0;
|
V(i, j, k) = -V(i, j, k-1);
|
||||||
V(i, j, k) = -V(i - 1, j, k);
|
W(i, j, k) = 0.0;
|
||||||
V(i, j - 1, k) = -V(i - 1, j - 1, k);
|
|
||||||
break;
|
break;
|
||||||
case BACKFACE:
|
case BACKFACE:
|
||||||
|
U(i, j, k) = -U(i, j, k+1);
|
||||||
|
V(i, j, k) = -V(i, j, k+1);
|
||||||
|
W(i, j, k) = 0.0;
|
||||||
|
break;
|
||||||
|
case FRONTLEFTLINE:
|
||||||
|
U(i, j, k) = 0.0;
|
||||||
|
V(i, j, k) = -V(i, j, k-1);
|
||||||
|
W(i, j, k) = -W(i-1, j, k);
|
||||||
|
break;
|
||||||
|
case FRONTRIGHTLINE:
|
||||||
|
U(i, j, k) = 0.0;
|
||||||
|
V(i, j, k) = -V(i, j, k-1);
|
||||||
|
W(i, j, k) = -W(i+1, j, k);
|
||||||
|
break;
|
||||||
|
case FRONTTOPLINE:
|
||||||
|
U(i, j, k) = -U(i, j, k-1);
|
||||||
|
V(i, j, k) = 0.0;
|
||||||
|
W(i, j, k) = -W(i, j+1, k);
|
||||||
|
break;
|
||||||
|
case FRONTBOTTOMLINE:
|
||||||
|
U(i, j, k) = -U(i, j, k-1);
|
||||||
|
V(i, j, k) = 0.0;
|
||||||
|
W(i, j, k) = -W(i, j-1, k);
|
||||||
|
break;
|
||||||
|
case MIDTOPLEFTLINE:
|
||||||
|
U(i, j, k) = -U(i, j+1, k);
|
||||||
|
V(i, j, k) = -V(i-1, j, k);
|
||||||
|
W(i, j, k) = 0.0;
|
||||||
|
break;
|
||||||
|
case MIDTOPRIGHTLINE:
|
||||||
U(i, j, k) = 0.0;
|
U(i, j, k) = 0.0;
|
||||||
V(i, j, k) = 0.0;
|
V(i, j, k) = 0.0;
|
||||||
V(i, j, k) = -V(i + 1, j, k);
|
U(i-1, j, k) = -U(i-1, j+1, k);
|
||||||
V(i, j - 1, k) = -V(i + 1, j - 1, k);
|
V(i, j-1, k) = -V(i+1, j-1, k);
|
||||||
|
W(i, j, k) = 0.0;
|
||||||
break;
|
break;
|
||||||
case TOPLEFT:
|
case MIDBOTTOMLEFTLINE:
|
||||||
U(i, j) = -U(i, j + 1);
|
U(i, j, k) = -U(i, j-1, k);
|
||||||
U(i - 1, j) = 0.0;
|
V(i, j, k) = -V(i-1, j, k);
|
||||||
V(i, j) = 0.0;
|
W(i, j, k) = 0.0;
|
||||||
V(i, j - 1) = -V(i - 1, j - 1);
|
|
||||||
break;
|
break;
|
||||||
case TOPRIGHT:
|
case MIDBOTTOMRIGHTLINE:
|
||||||
U(i, j) = 0.0;
|
U(i, j, k) = -U(i, j-1, k);
|
||||||
U(i - 1, j) = -U(i - 1, j + 1);
|
V(i, j, k) = -V(i+1, j, k);
|
||||||
V(i, j) = 0.0;
|
W(i, j, k) = 0.0;
|
||||||
V(i, j - 1) = -V(i + 1, j - 1);
|
|
||||||
break;
|
break;
|
||||||
case BOTTOMLEFT:
|
case BACKLEFTLINE:
|
||||||
U(i, j) = -U(i, j - 1);
|
U(i, j, k) = 0.0;
|
||||||
U(i - 1, j) = 0.0;
|
V(i, j, k) = -V(i, j, k+1);
|
||||||
V(i, j) = -V(i - 1, j);
|
W(i, j, k) = -W(i-1, j, k);
|
||||||
V(i, j - 1) = 0.0;
|
|
||||||
break;
|
break;
|
||||||
case BOTTOMRIGHT:
|
case BACKRIGHTLINE:
|
||||||
U(i, j) = 0.0;
|
U(i, j, k) = 0.0;
|
||||||
U(i - 1, j) = -U(i - 1, j - 1);
|
V(i, j, k) = -V(i, j, k+1);
|
||||||
V(i, j) = -V(i, j + 1);
|
W(i, j, k) = -W(i+1, j, k);
|
||||||
V(i, j - 1) = 0.0;
|
|
||||||
break;
|
break;
|
||||||
case TOP:
|
case BACKTOPLINE:
|
||||||
U(i, j) = -U(i, j + 1);
|
U(i, j, k) = -U(i, j, k+1);
|
||||||
U(i - 1, j) = -U(i - 1, j + 1);
|
V(i, j, k) = 0.0;
|
||||||
V(i, j) = 0.0;
|
W(i, j, k) = -W(i, j+1, k);
|
||||||
break;
|
break;
|
||||||
case BOTTOM:
|
case BACKBOTTOMLINE:
|
||||||
U(i, j) = -U(i, j - 1);
|
U(i, j, k) = -U(i, j, k+1);
|
||||||
U(i - 1, j) = -U(i - 1, j - 1);
|
V(i, j, k) = 0.0;
|
||||||
V(i, j) = 0.0;
|
W(i, j, k) = -W(i, j-1, k);
|
||||||
break;
|
break;
|
||||||
case LEFT:
|
case FRONTTOPLEFTCORNER:
|
||||||
U(i - 1, j) = 0.0;
|
U(i, j, k) = -U(i, j, k-1);
|
||||||
V(i, j) = -V(i - 1, j);
|
V(i, j, k) = -V(i-1, j, k);
|
||||||
V(i, j - 1) = -V(i - 1, j - 1);
|
W(i, j, k) = -W(i, j+1, k);
|
||||||
break;
|
break;
|
||||||
case RIGHT:
|
case FRONTTOPRIGHTCORNER:
|
||||||
U(i, j) = 0.0;
|
U(i, j, k) = -U(i, j, k-1);
|
||||||
V(i, j) = -V(i + 1, j);
|
V(i, j, k) = -V(i+1, j, k);
|
||||||
V(i, j - 1) = -V(i + 1, j - 1);
|
W(i, j, k) = -W(i, j+1, k);
|
||||||
break;
|
break;
|
||||||
case TOPLEFT:
|
case FRONTBOTTOMLEFTCORNER:
|
||||||
U(i, j) = -U(i, j + 1);
|
U(i, j, k) = -U(i, j, k-1);
|
||||||
U(i - 1, j) = 0.0;
|
V(i, j, k) = -V(i-1, j, k);
|
||||||
V(i, j) = 0.0;
|
W(i, j, k) = -W(i, j-1, k);
|
||||||
V(i, j - 1) = -V(i - 1, j - 1);
|
|
||||||
break;
|
break;
|
||||||
case TOPRIGHT:
|
case FRONTBOTTOMRIGHTCORNER:
|
||||||
U(i, j) = 0.0;
|
U(i, j, k) = -U(i, j, k-1);
|
||||||
U(i - 1, j) = -U(i - 1, j + 1);
|
V(i, j, k) = -V(i+1, j, k);
|
||||||
V(i, j) = 0.0;
|
W(i, j, k) = -W(i, j-1, k);
|
||||||
V(i, j - 1) = -V(i + 1, j - 1);
|
|
||||||
break;
|
break;
|
||||||
case BOTTOMLEFT:
|
case BACKTOPLEFTCORNER:
|
||||||
U(i, j) = -U(i, j - 1);
|
U(i, j, k) = -U(i, j, k+1);
|
||||||
U(i - 1, j) = 0.0;
|
V(i, j, k) = -V(i-1, j, k);
|
||||||
V(i, j) = -V(i - 1, j);
|
W(i, j, k) = -W(i, j+1, k);
|
||||||
V(i, j - 1) = 0.0;
|
|
||||||
break;
|
break;
|
||||||
case BOTTOMRIGHT:
|
case BACKTOPRIGHTCORNER:
|
||||||
U(i, j) = 0.0;
|
U(i, j, k) = -U(i, j, k+1);
|
||||||
U(i - 1, j) = -U(i - 1, j - 1);
|
V(i, j, k) = -V(i+1, j, k);
|
||||||
V(i, j) = -V(i, j + 1);
|
W(i, j, k) = -W(i, j+1, k);
|
||||||
V(i, j - 1) = 0.0;
|
|
||||||
break;
|
break;
|
||||||
case TOP:
|
case BACKBOTTOMLEFTCORNER:
|
||||||
U(i, j) = -U(i, j + 1);
|
U(i, j, k) = -U(i, j, k+1);
|
||||||
U(i - 1, j) = -U(i - 1, j + 1);
|
V(i, j, k) = -V(i-1, j, k);
|
||||||
V(i, j) = 0.0;
|
W(i, j, k) = -W(i, j-1, k);
|
||||||
break;
|
break;
|
||||||
case BOTTOM:
|
case BACKBOTTOMRIGHTCORNER:
|
||||||
U(i, j) = -U(i, j - 1);
|
U(i, j, k) = -U(i, j, k+1);
|
||||||
U(i - 1, j) = -U(i - 1, j - 1);
|
V(i, j, k) = -V(i+1, j, k);
|
||||||
V(i, j) = 0.0;
|
W(i, j, k) = -W(i, j-1, k);
|
||||||
break;
|
|
||||||
case LEFT:
|
|
||||||
U(i - 1, j) = 0.0;
|
|
||||||
V(i, j) = -V(i - 1, j);
|
|
||||||
V(i, j - 1) = -V(i - 1, j - 1);
|
|
||||||
break;
|
|
||||||
case RIGHT:
|
|
||||||
U(i, j) = 0.0;
|
|
||||||
V(i, j) = -V(i + 1, j);
|
|
||||||
V(i, j - 1) = -V(i + 1, j - 1);
|
|
||||||
break;
|
|
||||||
case TOPLEFT:
|
|
||||||
U(i, j) = -U(i, j + 1);
|
|
||||||
U(i - 1, j) = 0.0;
|
|
||||||
V(i, j) = 0.0;
|
|
||||||
V(i, j - 1) = -V(i - 1, j - 1);
|
|
||||||
break;
|
|
||||||
case TOPRIGHT:
|
|
||||||
U(i, j) = 0.0;
|
|
||||||
U(i - 1, j) = -U(i - 1, j + 1);
|
|
||||||
V(i, j) = 0.0;
|
|
||||||
V(i, j - 1) = -V(i + 1, j - 1);
|
|
||||||
break;
|
|
||||||
case BOTTOMLEFT:
|
|
||||||
U(i, j) = -U(i, j - 1);
|
|
||||||
U(i - 1, j) = 0.0;
|
|
||||||
V(i, j) = -V(i - 1, j);
|
|
||||||
V(i, j - 1) = 0.0;
|
|
||||||
break;
|
|
||||||
case BOTTOMRIGHT:
|
|
||||||
U(i, j) = 0.0;
|
|
||||||
U(i - 1, j) = -U(i - 1, j - 1);
|
|
||||||
V(i, j) = -V(i, j + 1);
|
|
||||||
V(i, j - 1) = 0.0;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user