tadded cell_centered option to writeVTKall - 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 0548db26d1afead334b2d7be927411f8e6dfd0dc
(DIR) parent 69742e525258e5011fe35f4458f6388d4964509a
(HTM) Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
Date: Tue, 27 May 2014 08:38:17 +0200
added cell_centered option to writeVTKall
Diffstat:
M python/fluidshear.py | 6 +++---
M python/sphere.py | 10 ++++++----
2 files changed, 9 insertions(+), 7 deletions(-)
---
(DIR) diff --git a/python/fluidshear.py b/python/fluidshear.py
t@@ -6,10 +6,10 @@ sid = 'fluidshear'
## Initialization from loose packing to a gravitationally collapsed state
## without fluids
-sim = sphere.sim(sid + '-init', np = 2400, fluid = False)
+sim = sphere.sim(sid + '-init', np = 24000, fluid = False)
#sim.cleanup()
sim.radius[:] = 0.05
-sim.initRandomGridPos(gridnum = [12, 12, 9000])
+sim.initRandomGridPos(gridnum = [16, 16, 9000])
sim.initTemporal(total = 5.0, file_dt = 0.05)
sim.g[2] = -9.81
sim.run(dry=True)
t@@ -32,9 +32,9 @@ sim.visualize('walls')
sim.readlast()
sim.sid = sid + '-shear'
sim.shear()
-sim.fluid = True
sim.initFluid(mu = 17.87e-4, p = 1.0e5, hydrostatic = True)
sim.bc_bot[0] = 1 # Neumann BC
+sim.setDEMstepsPerCFDstep(100)
sim.initTemporal(total = 1.0, file_dt = 0.01)
sim.run(dry=True)
sim.run()
(DIR) diff --git a/python/sphere.py b/python/sphere.py
t@@ -1058,7 +1058,7 @@ class sim:
if fh is not None:
fh.close()
- def writeVTKall(self, verbose = True):
+ def writeVTKall(self, cell_centered = True, verbose = True):
'''
Writes a VTK file for each simulation output file with particle
information and the fluid grid to the ``../output/`` folder by default.
t@@ -1126,13 +1126,15 @@ class sim:
sb.writeVTK(verbose=False)
if (self.fluid == True):
if (i == 0):
- sb.writeFluidVTK(verbose=verbose)
+ sb.writeFluidVTK(verbose=verbose,
+ cell_centered=cell_centered)
elif (i == lastfile):
if (verbose == True):
print("\tto")
- sb.writeFluidVTK(verbose=verbose)
+ sb.writeFluidVTK(verbose=verbose,
+ cell_centered=cell_centered)
else:
- sb.writeFluidVTK(verbose=False)
+ sb.writeFluidVTK(verbose=False, cell_centered=cell_centered)
def writeVTK(self, folder = '../output/', verbose = True):
'''