Introduction
Introduction Statistics Contact Development Disclaimer Help
tfix bounce-back BC issues during streaming - lbm-d3q19 - 3D lattice-Boltzmann …
git clone git://src.adamsgaard.dk/lbm-d3q19
Log
Files
Refs
LICENSE
---
commit fc71734e79e62bc8bb6d94c90a2dc9f8e28b892d
parent cf5511226d5583fc4d83435119d9f0f5c1915c52
Author: Anders Damsgaard Christensen <[email protected]>
Date: Thu, 20 Oct 2016 14:55:21 -0700
fix bounce-back BC issues during streaming
Diffstat:
M Makefile | 4 +++-
M lbm.c | 11 ++++++-----
2 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/Makefile b/Makefile
t@@ -2,13 +2,15 @@ CFLAGS=-g -Wall -pg -O2 -fopenmp
LDLIBS=-lm
BIN=lbm
+.PHONY: default plots data profile clean
+
default: plots
plots: data
# Plotting data
@cd out && for f in *.txt; do gnuplot -e "matrixfile='$$f'" plotmatrix…
-data: clean $(BIN)
+data: $(BIN)
# Running program
@./$(BIN)
diff --git a/lbm.c b/lbm.c
t@@ -369,16 +369,16 @@ void stream(Float* f, Float* f_new)
f_new[idxi( x, y, z, 5)]
= fmax(0.0, f[idxi(x, y, z, 6)]);
-
+
// Edge 7 (+x,+y): Bounce back
if (x < nx-1 && y < ny-1)
f_new[idxi(x+1,y+1, z, 7)]
= fmax(0.0, f[idxi(x, y, z, 7)]);
else if (x < nx-1)
- f_new[idxi(x+1, y, z, 9)]
+ f_new[idxi(x+1, y, z, 10)]
= fmax(0.0, f[idxi(x, y, z, 7)]);
else if (y < ny-1)
- f_new[idxi( x,y+1, z, 10)]
+ f_new[idxi( x,y+1, z, 9)]
= fmax(0.0, f[idxi(x, y, z, 7)]);
else
f_new[idxi( x, y, z, 8)]
t@@ -417,10 +417,10 @@ void stream(Float* f, Float* f_new)
f_new[idxi(x+1,y-1, z, 10)]
= fmax(0.0, f[idxi(x, y, z, 10)]);
else if (x < nx-1)
- f_new[idxi(x+1, y, z, 8)]
+ f_new[idxi(x+1, y, z, 7)]
= fmax(0.0, f[idxi(x, y, z, 10)]);
else if (y > 0)
- f_new[idxi( x,y-1, z, 7)]
+ f_new[idxi( x,y-1, z, 8)]
= fmax(0.0, f[idxi(x, y, z, 10)]);
else
f_new[idxi( x, y, z, 9)]
t@@ -537,6 +537,7 @@ void stream(Float* f, Float* f_new)
else
f_new[idxi( x, y, z, 17)]
= fmax(0.0, f[idxi(x, y, z, 18)]);
+
}
}
}
You are viewing proxied material from mx1.adamsgaard.dk. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.