tfixed particle zone thickness now determined from local particle radii - spher… | |
git clone git://src.adamsgaard.dk/sphere | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit bd456ae010d2426342427ff84fb19d5f2609525e | |
parent 5c7fadd5c84d9479eddc38558f8c88841ac0d6c3 | |
Author: Anders Damsgaard <[email protected]> | |
Date: Sat, 28 Sep 2013 09:25:26 +0200 | |
fixed particle zone thickness now determined from local particle radii | |
Diffstat: | |
M python/sphere.py | 18 ++++++++++++++---- | |
1 file changed, 14 insertions(+), 4 deletions(-) | |
--- | |
diff --git a/python/sphere.py b/python/sphere.py | |
t@@ -207,7 +207,8 @@ class Spherebin: | |
else: | |
return 1 | |
- def readbin(self, targetbin, verbose = True, bonds = True, devsmod = True,… | |
+ def readbin(self, targetbin, verbose = True, bonds = True, devsmod = True, | |
+ fluid = True, esysparticle = False): | |
'Reads a target SPHERE binary file' | |
fh = None | |
t@@ -262,6 +263,9 @@ class Spherebin: | |
self.angvel = numpy.fromfile(fh, dtype=numpy.float64, count=self.n… | |
self.torque = numpy.fromfile(fh, dtype=numpy.float64, count=self.n… | |
+ if (esysparticle == True): | |
+ return | |
+ | |
# Per-particle single-value parameters | |
self.es_dot = numpy.fromfile(fh, dtype=numpy.float64, count=self.… | |
self.es = numpy.fromfile(fh, dtype=numpy.float64, count=self.… | |
t@@ -1010,10 +1014,13 @@ class Spherebin: | |
# set the thickness of the horizons of fixed particles | |
#fixheight = 2*cellsize | |
- fixheight = cellsize | |
+ #fixheight = cellsize | |
# Fix horizontal velocity to 0.0 of lowermost particles | |
- I = numpy.nonzero(self.x[:,2] < (z_min + fixheight)) # Find indices of… | |
+ d_max_below = numpy.max(self.radius[numpy.nonzero(self.x[:,2] < | |
+ (z_max-z_min)*0.3)])*2.0 | |
+ #I = numpy.nonzero(self.x[:,2] < (z_min + fixheight)) | |
+ I = numpy.nonzero(self.x[:,2] < (z_min + d_max_below)) | |
self.fixvel[I] = 1 | |
self.angvel[I,0] = 0.0 | |
self.angvel[I,1] = 0.0 | |
t@@ -1022,7 +1029,10 @@ class Spherebin: | |
self.vel[I,1] = 0.0 # y-dim | |
# Fix horizontal velocity to specific value of uppermost particles | |
- I = numpy.nonzero(self.x[:,2] > (z_max - fixheight)) # Find indices of… | |
+ d_max_top = numpy.max(self.radius[numpy.nonzero(self.x[:,2] > | |
+ (z_max-z_min)*0.7)])*2.0 | |
+ #I = numpy.nonzero(self.x[:,2] > (z_max - fixheight)) | |
+ I = numpy.nonzero(self.x[:,2] > (z_max - d_max_top)) | |
self.fixvel[I] = 1 | |
self.angvel[I,0] = 0.0 | |
self.angvel[I,1] = 0.0 |