File tree Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -31,10 +31,24 @@ def __init__(
31
31
pass
32
32
33
33
def evaluateMassFlowRate (self ):
34
- pass
34
+ massFlowRate = 0
35
+
36
+ for tank in self .tanks :
37
+ massFlowRate += tank .get ("tank" ).netMassFlowRate
38
+
39
+ return massFlowRate
35
40
36
41
def evaluateCenterOfMass (self ):
37
- pass
42
+ totalMass = 0
43
+ massBalance = 0
44
+
45
+ for tankElement in self .tanks :
46
+ tank = tankElement .get ("tank" )
47
+ tankPosition = tankElement .get ("position" )
48
+ totalMass += tank .mass
49
+ massBalance += tank .mass * (tankPosition + tank .centerOfMass )
50
+
51
+ return massBalance / totalMass
38
52
39
53
def evaluateInertiaTensor (self ):
40
54
pass
@@ -176,7 +190,7 @@ def centerOfMass(self, t):
176
190
+ self .cylinder .filled_centroid * cylinderMass
177
191
+ self .upperCap .filled_centroid * upperCapMass
178
192
) / (bottomCapMass + cylinderMass + upperCapMass )
179
-
193
+
180
194
return centerOfMass
181
195
182
196
def inertiaTensor (self , t ):
@@ -205,7 +219,7 @@ def inertiaTensor(self, t):
205
219
206
220
# fluids considered inviscid so no shear resistance from torques in z axis
207
221
self .inertiaZ = 0
208
-
222
+
209
223
return self .inertiaI , self .inertiaZ
210
224
211
225
You can’t perform that action at this time.
0 commit comments