tset2, cfd_tests.py passes - sphere - GPU-based 3D discrete element method algo… | |
git clone git://src.adamsgaard.dk/sphere | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit 2b64c71fd50ab41816d321bf665d7ba0b2e0475e | |
parent c4537045c16f9addc88c92d6acd3185033395d6e | |
Author: Anders Damsgaard <[email protected]> | |
Date: Tue, 17 Jun 2014 13:29:52 +0200 | |
set2, cfd_tests.py passes | |
Diffstat: | |
M src/debug.h | 4 ++-- | |
M tests/cfd_tests.py | 5 ++--- | |
M tests/cfd_tests_neumann.py | 2 ++ | |
3 files changed, 6 insertions(+), 5 deletions(-) | |
--- | |
diff --git a/src/debug.h b/src/debug.h | |
t@@ -51,7 +51,7 @@ const int conv_log_interval = 4; | |
// simulation of particulate systems: Theoretical developments". | |
// SET_2 corresponds approximately to Model A in Zhu et al. 2007. | |
// Choose exactly one. | |
-#define SET_1 | |
-//#define SET_2 | |
+//#define SET_1 | |
+#define SET_2 | |
#endif | |
diff --git a/tests/cfd_tests.py b/tests/cfd_tests.py | |
t@@ -28,14 +28,12 @@ py = sphere.sim(sid = orig.sid, fluid = True) | |
ones = numpy.ones((orig.num)) | |
py.readlast(verbose = False) | |
-#py.writeVTKall() | |
compareNumpyArrays(ones, py.p_f, "Conservation of pressure:") | |
# Convergence rate (1/2) | |
it = numpy.loadtxt("../output/" + orig.sid + "-conv.log") | |
compare(it[:,1].sum(), 0.0, "Convergence rate (1/2):\t") | |
- | |
# Add pressure gradient | |
# This test passes with BETA=0.0 and tolerance=1.0e-9 | |
orig.p_f[:,:,-1] = 1.1 | |
t@@ -43,7 +41,7 @@ orig.run(verbose=False) | |
#orig.run(verbose=True) | |
py.readlast(verbose = False) | |
ideal_grad_p_z = numpy.linspace(orig.p_f[0,0,0], orig.p_f[0,0,-1], orig.num[2]) | |
-#py.writeVTKall() | |
+orig.writeVTKall() | |
compareNumpyArraysClose(numpy.zeros((1,orig.num[2])),\ | |
ideal_grad_p_z - py.p_f[0,0,:],\ | |
"Pressure gradient:\t", tolerance=1.0e-1) | |
t@@ -63,6 +61,7 @@ if ((it[0:6,1] < 1000).all() and (it[6:,1] < 20).all()): | |
print("Convergence rate (2/2):\t" + passed()) | |
else: | |
print("Convergence rate (2/2):\t" + failed()) | |
+ | |
''' | |
# Long test | |
# This test passes with BETA=0.0 and tolerance=1.0e-9 | |
diff --git a/tests/cfd_tests_neumann.py b/tests/cfd_tests_neumann.py | |
t@@ -34,6 +34,7 @@ else: | |
print("Flow field:\t\t" + failed()) | |
raise Exception("Failed") | |
+""" | |
print('''# Neumann bottom, Dirichlet top BC. | |
# Gravity, pressure gradients => transient flow''') | |
orig = sphere.sim("neumann", fluid = True) | |
t@@ -62,3 +63,4 @@ else: | |
raise Exception("Failed") | |
#orig.cleanup() | |
+""" |