Introduction
Introduction Statistics Contact Development Disclaimer Help
tadd separate functions for viscous dissipation - sphere - GPU-based 3D discret…
git clone git://src.adamsgaard.dk/sphere
Log
Files
Refs
LICENSE
---
commit c62854c9bfc6be53c2155553666379bbdada700c
parent a1bd00c040694d453ddfdc6742b1050d14ac2215
Author: Anders Damsgaard <[email protected]>
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(-)
---
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.
You are viewing proxied material from mx1.adamsgaard.dk. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.