-
Notifications
You must be signed in to change notification settings - Fork 2
/
DEM_materials.py
114 lines (102 loc) · 6.07 KB
/
DEM_materials.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
import taichi as ti
import numpy
import math
@ti.data_oriented
class DEMMaterial:
def __init__(self, max_material_num):
self.rho = ti.field(float, shape=(max_material_num,))
self.ForceLocalDamping = ti.field(float, shape=(max_material_num,))
self.TorqueLocalDamping = ti.field(float, shape=(max_material_num,))
self.NormalViscousDamping = ti.field(float, shape=(max_material_num,))
self.TangViscousDamping = ti.field(float, shape=(max_material_num,))
self.modulus = ti.field(float, shape=(max_material_num,))
self.possion = ti.field(float, shape=(max_material_num,))
self.kn = ti.field(float, shape=(max_material_num,))
self.ks = ti.field(float, shape=(max_material_num,))
self.Mu = ti.field(float, shape=(max_material_num,))
self.Rmu = ti.field(float, shape=(max_material_num,))
@ti.kernel
def ParticleLinearInit(self, matID: int, MatInfo: ti.template()):
print('Contact model: Linear contact Model')
print('Contact normal stiffness: = ', MatInfo[matID].Kn)
print('Contact tangential stiffness: = ', MatInfo[matID].Ks)
print('Friction coefficient = ', MatInfo[matID].Mu)
print('Local damping coefficient = ', MatInfo[matID].ForceLocalDamping)
print('Local damping coefficient = ', MatInfo[matID].TorqueLocalDamping)
print('Viscous damping coefficient = ', MatInfo[matID].NormalViscousDamping)
print('Local damping coefficient = ', MatInfo[matID].TangViscousDamping)
print('Particle density = ', MatInfo[matID].ParticleRho, '\n')
self.rho[matID] = MatInfo[matID].ParticleRho
self.ForceLocalDamping[matID] = MatInfo[matID].ForceLocalDamping
self.TorqueLocalDamping[matID] = MatInfo[matID].TorqueLocalDamping
self.NormalViscousDamping[matID] = MatInfo[matID].NormalViscousDamping
self.TangViscousDamping[matID] = MatInfo[matID].TangViscousDamping
self.kn[matID] = MatInfo[matID].Kn
self.ks[matID] = MatInfo[matID].Ks
self.Mu[matID] = MatInfo[matID].Mu
self.Rmu[matID] = MatInfo[matID].Rmu
@ti.kernel
def ParticleHertzInit(self, matID: int, MatInfo: ti.template()):
print('Contact model: Hertz contact Model')
print('Shear modulus: = ', MatInfo[matID].Modulus)
print('Possion ratio: = ', MatInfo[matID].possion)
print('Friction coefficient = ', MatInfo[matID].Mu)
print('Rolling friction coefficient = ', MatInfo[matID].Rmu)
print('Local damping coefficient = ', MatInfo[matID].ForceLocalDamping)
print('Local damping coefficient = ', MatInfo[matID].TorqueLocalDamping)
print('Viscous damping coefficient = ', MatInfo[matID].NormalViscousDamping)
print('Local damping coefficient = ', MatInfo[matID].TangViscousDamping)
print('Particle density = ', MatInfo[matID].ParticleRho, '\n')
self.rho[matID] = MatInfo[matID].ParticleRho
self.ForceLocalDamping[matID] = MatInfo[matID].ForceLocalDamping
self.TorqueLocalDamping[matID] = MatInfo[matID].TorqueLocalDamping
self.NormalViscousDamping[matID] = MatInfo[matID].NormalViscousDamping
self.TangViscousDamping[matID] = MatInfo[matID].TangViscousDamping
self.modulus[matID] = MatInfo[matID].Modulus
self.possion[matID] = MatInfo[matID].possion
self.Mu[matID] = MatInfo[matID].Mu
self.Rmu[matID] = MatInfo[matID].Rmu
@ti.kernel
def ParticleLinearRollingInit(self, matID: int, MatInfo: ti.template()):
print('Contact model: Linear contact Model')
print('Contact normal stiffness: = ', MatInfo[matID].Kn)
print('Contact tangential stiffness: = ', MatInfo[matID].Ks)
print('Friction coefficient = ', MatInfo[matID].Mu)
print('Local damping coefficient = ', MatInfo[matID].ForceLocalDamping)
print('Local damping coefficient = ', MatInfo[matID].TorqueLocalDamping)
print('Viscous damping coefficient = ', MatInfo[matID].NormalViscousDamping)
print('Local damping coefficient = ', MatInfo[matID].TangViscousDamping)
print('Particle density = ', MatInfo[matID].ParticleRho, '\n')
self.rho[matID] = MatInfo[matID].ParticleRho
self.ForceLocalDamping[matID] = MatInfo[matID].ForceLocalDamping
self.TorqueLocalDamping[matID] = MatInfo[matID].TorqueLocalDamping
self.NormalViscousDamping[matID] = MatInfo[matID].NormalViscousDamping
self.TangViscousDamping[matID] = MatInfo[matID].TangViscousDamping
self.modulus[matID] = MatInfo[matID].Modulus
self.possion[matID] = MatInfo[matID].possion
self.kn[matID] = MatInfo[matID].Kn
self.ks[matID] = MatInfo[matID].Ks
self.Mu[matID] = MatInfo[matID].Mu
self.Rmu[matID] = MatInfo[matID].Rmu
@ti.kernel
def ParticleBondInit(self, matID: int, MatInfo: ti.template()):
print('Contact model: Linear contact Model')
print('Contact normal stiffness: = ', MatInfo[matID].Kn)
print('Contact tangential stiffness: = ', MatInfo[matID].Ks)
print('Friction coefficient = ', MatInfo[matID].Mu)
print('Local damping coefficient = ', MatInfo[matID].ForceLocalDamping)
print('Local damping coefficient = ', MatInfo[matID].TorqueLocalDamping)
print('Viscous damping coefficient = ', MatInfo[matID].NormalViscousDamping)
print('Local damping coefficient = ', MatInfo[matID].TangViscousDamping)
print('Particle density = ', MatInfo[matID].ParticleRho, '\n')
self.rho[matID] = MatInfo[matID].ParticleRho
self.ForceLocalDamping[matID] = MatInfo[matID].ForceLocalDamping
self.TorqueLocalDamping[matID] = MatInfo[matID].TorqueLocalDamping
self.NormalViscousDamping[matID] = MatInfo[matID].NormalViscousDamping
self.TangViscousDamping[matID] = MatInfo[matID].TangViscousDamping
self.modulus[matID] = MatInfo[matID].Modulus
self.possion[matID] = MatInfo[matID].possion
self.kn[matID] = MatInfo[matID].Kn
self.ks[matID] = MatInfo[matID].Ks
self.Mu[matID] = MatInfo[matID].Mu
self.Rmu[matID] = MatInfo[matID].Rmu