tbetter approximate the actual steady-state pressure distribution when theres a dynamic top wall - 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 23718477440c1df19d0f2da9b54e78177cac7c19
 (DIR) parent a9b29db26630b8d195836748f6e4440f02195224
 (HTM) Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
       Date:   Thu, 25 Sep 2014 10:52:41 +0200
       
       better approximate the actual steady-state pressure distribution when theres a dynamic top wall
       
       Diffstat:
         M python/sphere.py                    |      23 +++++++++++++++++++----
       
       1 file changed, 19 insertions(+), 4 deletions(-)
       ---
 (DIR) diff --git a/python/sphere.py b/python/sphere.py
       t@@ -2646,11 +2646,26 @@ class sim:
                        dtype=numpy.float64) * p
        
                if (hydrostatic == True):
       +
                    dz = self.L[2]/self.num[2]
       -            for iz in range(self.num[2]-1):
       -                z = dz*iz + 0.5*dz
       -                depth = self.L[2] - z
       -                self.p_f[:,:,iz] = p + (depth-dz) * rho * -self.g[2]
       +            # Zero pressure gradient from grid top to top wall, linear pressure
       +            # distribution from top wall to grid bottom
       +            if (self.nw == 1):
       +                wall0_iz = int(self.w_x[0]/(self.L[2]/self.num[2]))
       +                self.p_f[:,:,wall0_iz:] = p
       +
       +                for iz in numpy.arange(wall0_iz - 1):
       +                    z = dz*iz + 0.5*dz
       +                    depth = self.w_x[0] - z
       +                    self.p_f[:,:,iz] = p + (depth-dz) * rho * -self.g[2]
       +
       +            # Linear pressure distribution from grid top to grid bottom
       +            else:
       +                for iz in numpy.arange(self.num[2] - 1):
       +                    z = dz*iz + 0.5*dz
       +                    depth = self.L[2] - z
       +                    self.p_f[:,:,iz] = p + (depth-dz) * rho * -self.g[2]
       +
        
                self.v_f = numpy.zeros((self.num[0], self.num[1], self.num[2], self.nd),
                        dtype=numpy.float64)