tadd separate functions for viscous dissipation - 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 c62854c9bfc6be53c2155553666379bbdada700c
(DIR) parent a1bd00c040694d453ddfdc6742b1050d14ac2215
(HTM) Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
Date: Fri, 20 Jun 2014 11:46:18 +0200
add separate functions for viscous dissipation
Diffstat:
M python/sphere.py | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/python/sphere.py b/python/sphere.py
t@@ -2671,6 +2671,7 @@ class sim:
:param idx: Particle index
:type idx: int
:returns: The volume of the particle [m^3]
+ :return type: float
'''
return V_sphere(self.radius[idx])
t@@ -2681,6 +2682,7 @@ class sim:
:param idx: Particle index
:type idx: int
:returns: The mass of the particle [kg]
+ :return type: float
'''
return self.rho[0]*self.volume(idx)
t@@ -2691,6 +2693,7 @@ class sim:
:param idx: Particle index
:type idx: int
:returns: The kinetic energy of the particle [J]
+ :return type: float
'''
return 0.5*self.mass(idx) \
*numpy.sqrt(numpy.dot(self.vel[idx,:], self.vel[idx,:]))**2
t@@ -2706,6 +2709,31 @@ class sim:
esum += self.kineticEnergy(i)
return esum
+ def viscousNormalEnergy(self, idx):
+ '''
+ Returns the viscous absorbed energy for a particle in the
+ normal component of its contacts.
+
+ :param idx: Particle index
+ :type idx: int
+ :returns: The normal viscous energy of the particle [J]
+ :return type: float
+ '''
+ return self.ev[idx]
+
+ def totalViscousNormalEnergy(self):
+ '''
+ Returns the total viscous absorbed energy for all particles
+ (normal component).
+
+ :returns: The normal viscous energy of all particles [J]
+
+ '''
+ esum = 0.0
+ for i in range(self.np):
+ esum += self.viscousNormalEnergy(i)
+ return esum
+
def energy(self, method):
'''
Calculates the sum of the energy components of all particles.