tdisable rotation with fixvel=-10 - 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 9c3b2327798617bfd18112c2cf55ad3ceb26fa11
(DIR) parent 5d9005209101adcd80126e5eac5d0d974ebb47aa
(HTM) Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Thu, 14 Apr 2022 16:02:32 +0200
disable rotation with fixvel=-10
Diffstat:
M python/sphere.py | 7 ++++++-
M src/integration.cuh | 6 +++++-
2 files changed, 11 insertions(+), 2 deletions(-)
---
(DIR) diff --git a/python/sphere.py b/python/sphere.py
t@@ -120,7 +120,12 @@ class sim:
# The linear velocities [m/s]
self.vel = numpy.zeros((self.np, self.nd), dtype=numpy.float64)
- # Fix the particle horizontal velocities? 0: No, 1: Yes
+ # Fix the particle kinematics?
+ # 0: No (DEFAULT, don't fix linear or angular acceleration)
+ # 1: Yes (fix horizontal movement, allow vertical movement, disable rotation)
+ # 10: Yes (fix horizontal movement, allow vertical movement, disable rotation)
+ # -1: Yes (fix all linear and rotational movement)
+ # -10: Yes (fix all rotational movement)
self.fixvel = numpy.zeros(self.np, dtype=numpy.float64)
# The linear force vectors [N]
(DIR) diff --git a/src/integration.cuh b/src/integration.cuh
t@@ -150,7 +150,7 @@ __global__ void integrate(
angacc.z = 0.0;
}
- if (vel.w < -0.0001) {
+ if (vel.w < -0.0001 && vel.w > -10.0) {
acc.x = 0.0;
acc.y = 0.0;
acc.z = 0.0;
t@@ -159,6 +159,10 @@ __global__ void integrate(
angacc = MAKE_FLOAT4(0.0, 0.0, 0.0, 0.0);
}
+ if (vel.w <= -10.0) {
+ angacc = MAKE_FLOAT4(0.0, 0.0, 0.0, 0.0);
+ }
+
#ifdef EULER
// Forward Euler
// Truncation error O(dt^2) for positions and velocities