tSet all fluid parameters in initFluid - 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 46da6614cd60cb329d7e0551e117db6fa605f2a0
 (DIR) parent 5e502c54037b1909100ab6f31da4f783bf7455f3
 (HTM) Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
       Date:   Wed, 26 Mar 2014 16:06:56 +0100
       
       Set all fluid parameters in initFluid
       
       Diffstat:
         M python/sphere.py                    |      23 +++++++++++++++++++++--
       
       1 file changed, 21 insertions(+), 2 deletions(-)
       ---
 (DIR) diff --git a/python/sphere.py b/python/sphere.py
       t@@ -2267,7 +2267,7 @@ class sim:
                self.time_file_dt[0] = file_dt
                self.time_step_count[0] = 0
        
       -    def initFluid(self, mu = 8.9e-4):
       +    def initFluid(self, mu = 8.9e-4, rho = 1.0e3):
                '''
                Initialize the fluid arrays and the fluid viscosity. The default value
                of ``mu`` equals the dynamic viscosity of water at 25 degrees Celcius.
       t@@ -2275,8 +2275,12 @@ class sim:
                
                :param mu: The fluid dynamic viscosity [kg/(m*s)]
                :type mu: float
       +        :param rho: The fluid density [kg/(m^3)]
       +        :type rho: float
                '''
       -        self.mu = numpy.asarray(mu)
       +        self.mu = numpy.ones(1, dtype=numpy.float64) * mu
       +        self.rho_f = numpy.ones(1, dtype=numpy.float64) * rho
       +
                self.p_f = numpy.ones((self.num[0], self.num[1], self.num[2]),
                        dtype=numpy.float64)
                self.v_f = numpy.zeros((self.num[0], self.num[1], self.num[2], self.nd),
       t@@ -2286,6 +2290,21 @@ class sim:
                self.dphi = numpy.zeros((self.num[0], self.num[1], self.num[2]),
                        dtype=numpy.float64)
        
       +        self.p_mod_A = numpy.zeros(1, dtype=numpy.float64)  # Amplitude [Pa]
       +        self.p_mod_f = numpy.zeros(1, dtype=numpy.float64)  # Frequency [Hz]
       +        self.p_mod_phi = numpy.zeros(1, dtype=numpy.float64) # Shift [rad]
       +
       +        self.bc_bot = numpy.zeros(1, dtype=numpy.int32)
       +        self.bc_top = numpy.zeros(1, dtype=numpy.int32)
       +        self.free_slip_bot = numpy.ones(1, dtype=numpy.int32)
       +        self.free_slip_top = numpy.ones(1, dtype=numpy.int32)
       +
       +        self.gamma = numpy.array(0.0)
       +        self.theta = numpy.array(1.0)
       +        self.beta = numpy.array(0.0)
       +        self.tolerance = numpy.array(1.0e-8)
       +        self.maxiter = numpy.array(1e4)
       +
            def defaultParams(self,
                    mu_s = 0.4,
                    mu_d = 0.4,