tnormal force >= 0 to avoid attractive forces - 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 acfb51a80f5db56f5fd790c3265c105a9f7a506b
 (DIR) parent 4bc599379dd9e96126e869a43c6f1fe54de039d5
 (HTM) Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
       Date:   Thu, 19 Jun 2014 09:59:57 +0200
       
       normal force >= 0 to avoid attractive forces
       
       Diffstat:
         M src/contactmodels.cuh               |       4 +++-
       
       1 file changed, 3 insertions(+), 1 deletion(-)
       ---
 (DIR) diff --git a/src/contactmodels.cuh b/src/contactmodels.cuh
       t@@ -206,7 +206,9 @@ __device__ void contactLinearViscous(Float3* F, Float3* T,
            //f_n = -devC_params.k_n * delta_ab * n_ab;
        
            // Normal force component: Elastic - viscous damping
       -    f_n = (-devC_params.k_n * delta_ab - devC_params.gamma_n * vel_n_ab) * n_ab;
       +    f_n = fmax(0.0,
       +               (-devC_params.k_n * delta_ab
       +                - devC_params.gamma_n * vel_n_ab) * n_ab);
        
            // Make sure the viscous damping doesn't exceed the elastic component,
            // i.e. the damping factor doesn't exceed the critical damping, 2*sqrt(m*k_n)