tc_grad_p fixes, do not specify device, add c=0.1 neumann test - 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 9357c48d3785467f339198e783c0094e575e9b28
 (DIR) parent 4c2467acf0646b9a49314578eba3b28a7fdc9dff
 (HTM) Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
       Date:   Sun, 12 Oct 2014 16:35:37 +0200
       
       c_grad_p fixes, do not specify device, add c=0.1 neumann test
       
       Diffstat:
         M src/navierstokes.cuh                |      12 ++++++------
         M tests/CMakeLists.txt                |       3 +++
         M tests/fluid_particle_interaction.py |      14 +++++++-------
       
       3 files changed, 16 insertions(+), 13 deletions(-)
       ---
 (DIR) diff --git a/src/navierstokes.cuh b/src/navierstokes.cuh
       t@@ -2282,11 +2282,11 @@ __global__ void findPredNSvelocities(
            const Float*  __restrict__ dev_ns_div_tau_y,       // in
            const Float*  __restrict__ dev_ns_div_tau_z,       // in
            const Float3* __restrict__ dev_ns_div_phi_vi_v,    // in
       -    const int     bc_bot,                 // in
       -    const int     bc_top,                 // in
       -    const Float   beta,                   // in
       +    const int     bc_bot,                              // in
       +    const int     bc_top,                              // in
       +    const Float   beta,                                // in
            const Float3* __restrict__ dev_ns_F_pf,            // in
       -    const unsigned int ndem,              // in
       +    const unsigned int ndem,                           // in
            const Float   __restrict__ c_grad_p,               // in
            Float* __restrict__ dev_ns_v_p_x,           // out
            Float* __restrict__ dev_ns_v_p_y,           // out
       t@@ -2976,12 +2976,12 @@ __global__ void updateNSvelocity(
                const Float3 grad_epsilon = MAKE_FLOAT3(
                    (epsilon_c - epsilon_xn)/dx,
                    (epsilon_c - epsilon_yn)/dy,
       -            (epsilon_c - epsilon_zn)/dz) * c_grad_p;
       +            (epsilon_c - epsilon_zn)/dz);
        
                // Find new velocity
        #ifdef SET_1
                //Float3 v = v_p - ndem*devC_dt/(devC_params.rho_f*phi)*grad_epsilon;
       -        Float3 v = v_p - ndem*devC_dt/devC_params.rho_f*grad_epsilon;
       +        Float3 v = v_p - ndem*devC_dt*c_grad_p/devC_params.rho_f*grad_epsilon;
        #endif
        #ifdef SET_2
                Float3 v = v_p - ndem*devC_dt/devC_params.rho_f*grad_epsilon;
 (DIR) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
       t@@ -27,5 +27,8 @@ add_test(cfd_tests ${PYTHON_EXECUTABLE}
        add_test(cfd_tests_neumann ${PYTHON_EXECUTABLE} 
            ${CMAKE_CURRENT_BINARY_DIR}/cfd_tests_neumann.py)
        
       +add_test(cfd_tests_neumann-c=0.1 ${PYTHON_EXECUTABLE} 
       +    ${CMAKE_CURRENT_BINARY_DIR}/cfd_tests_neumann-c=0.1.py)
       +
        add_test(fluid_particle_interaction ${PYTHON_EXECUTABLE} 
            ${CMAKE_CURRENT_BINARY_DIR}/fluid_particle_interaction.py)
 (DIR) diff --git a/tests/fluid_particle_interaction.py b/tests/fluid_particle_interaction.py
       t@@ -19,7 +19,7 @@ sim.p_f[:,:,-1] = 1.0
        sim.addParticle([0.5, 0.5, 0.5], 0.05)
        sim.initTemporal(total=0.01, file_dt=0.001)
        
       -sim.run(device=1, verbose=False)
       +sim.run(verbose=False)
        #sim.run(dry=True)
        #sim.run(cudamemcheck=True)
        #sim.writeVTKall()
       t@@ -43,7 +43,7 @@ sim.addParticle([0.5, 0.5, 0.25], 0.05)
        
        sim.initTemporal(total=0.0001, file_dt=0.00001)
        
       -sim.run(device=1, verbose=False)
       +sim.run(verbose=False)
        #sim.writeVTKall()
        
        sim.readlast()
       t@@ -53,7 +53,7 @@ test(sim.vel[1,0] > 0.0, 'Particle 1 velocity:')
        test(sim.vel[2,0] > 0.0, 'Particle 2 velocity:')
        
        
       -'''
       +#'''
        print('# Test 3: Test pressure gradient force, c = 0.1')
        sim.p_f[:,:,0]  = 10.0
        sim.p_f[:,:,-1] = 1.0
       t@@ -61,7 +61,7 @@ sim.addParticle([0.5, 0.5, 0.5], 0.05)
        sim.initTemporal(total=0.01, file_dt=0.001)
        sim.c_grad_p[0] = 0.1
        
       -sim.run(device=1, verbose=False)
       +sim.run(verbose=False)
        #sim.run(dry=True)
        #sim.run(cudamemcheck=True)
        #sim.writeVTKall()
       t@@ -86,7 +86,7 @@ sim.addParticle([0.5, 0.5, 0.25], 0.05)
        
        sim.initTemporal(total=0.0001, file_dt=0.00001)
        
       -sim.run(device=1, verbose=False)
       +sim.run(verbose=False)
        #sim.writeVTKall()
        
        sim.readlast()
       t@@ -94,6 +94,6 @@ test((sim.v_f[:,:,:,0] > 0.0).all(), 'Fluid velocity:')
        test(sim.vel[0,0] > 0.0, 'Particle 0 velocity:')
        test(sim.vel[1,0] > 0.0, 'Particle 1 velocity:')
        test(sim.vel[2,0] > 0.0, 'Particle 2 velocity:')
       -'''
       +#'''
        
       -#sim.cleanup()
       +sim.cleanup()