tNeumann tests pass - sphere - GPU-based 3D discrete element method algorithm with optional fluid coupling
(HTM) git clone git://src.adamsgaard.dk/sphere
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) LICENSE
---
(DIR) commit ddb69d1d3af5f0452a6a5d96f229513acb4320d2
(DIR) parent 3cba4eeb49ac21221e20a93f576466bb220f6c2c
(HTM) Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
Date: Sat, 28 Jun 2014 15:06:48 +0200
Neumann tests pass
Diffstat:
M tests/cfd_tests_neumann.py | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
---
(DIR) diff --git a/tests/cfd_tests_neumann.py b/tests/cfd_tests_neumann.py
t@@ -10,7 +10,6 @@ print('### CFD tests - Dirichlet/Neumann BCs ###')
print('''# Neumann bottom, Dirichlet top BC.
# No gravity, no pressure gradients => no flow''')
-'''
orig = sphere.sim("neumann", fluid = True)
cleanup(orig)
orig.defaultParams(mu_s = 0.4, mu_d = 0.4)
t@@ -22,7 +21,7 @@ py = sphere.sim(sid = orig.sid, fluid = True)
orig.bc_bot[0] = 1 # No-flow BC at bottom (Neumann)
#orig.run(dry=True)
orig.run(verbose=False)
-orig.writeVTKall()
+#orig.writeVTKall()
py.readlast(verbose = False)
ones = numpy.ones((orig.num))
py.readlast(verbose = False)
t@@ -38,7 +37,6 @@ else:
print(numpy.mean(py.v_f))
print(numpy.max(py.v_f))
raise Exception("Failed")
-'''
print('''# Neumann bottom, Dirichlet top BC.
# Gravity, pressure gradients => transient flow''')
t@@ -46,16 +44,19 @@ orig = sphere.sim("neumann", fluid = True)
orig.defaultParams(mu_s = 0.4, mu_d = 0.4)
orig.defineWorldBoundaries([0.4, 0.4, 1], dx = 0.1)
orig.initFluid(mu = 8.9e-4)
-orig.initTemporal(total = 0.5, file_dt = 0.05, dt = 1.0e-4)
+orig.initTemporal(total = 0.05, file_dt = 0.005, dt = 1.0e-4)
py = sphere.sim(sid = orig.sid, fluid = True)
orig.g[2] = -10.0
orig.bc_bot[0] = 1 # No-flow BC at bottom (Neumann)
#orig.run(dry=True)
orig.run(verbose=False)
-orig.writeVTKall()
+#orig.writeVTKall()
py.readlast(verbose = False)
+#ideal_grad_p_z = numpy.linspace(
+# orig.p_f[0,0,0] + orig.L[2]*orig.rho_f*numpy.abs(orig.g[2]),
+# orig.p_f[0,0,-1], orig.num[2])
ideal_grad_p_z = numpy.linspace(
- orig.p_f[0,0,0] + orig.L[2]*orig.rho_f*numpy.abs(orig.g[2]),
+ orig.p_f[0,0,0] + (orig.L[2]-orig.L[2]/orig.num[2])*orig.rho_f*numpy.abs(orig.g[2]),
orig.p_f[0,0,-1], orig.num[2])
compareNumpyArraysClose(ideal_grad_p_z, py.p_f[0,0,:],
"Pressure gradient:\t", tolerance=1.0e2)