def test_positive_friction(self): chamfered_qc = bearing.chamfer_positive_friction( self.gef.df.qc.values, self.gef.df.depth.values) # pile tip level ptl = nap_to_depth(self.gef.zid, -13.5) tipping_point = nap_to_depth(self.gef.zid, -2.1) idx_ptl = np.argmin(np.abs(self.gef.df.depth.values - ptl)) idx_tp = np.argmin(np.abs(self.gef.df.depth.values - tipping_point)) s = slice(idx_tp, idx_ptl) f = bearing.positive_friction(self.gef.df.depth.values[s], chamfered_qc[s], 0.25 * 4, 0.01) # d-foundation result is 1375, we have 1371. Small difference due to chamfering method. We chamfer better ;) deviation = abs(1 - 1375 / (f.sum() * 1000)) self.assertTrue(deviation < 1e-2) self.assertEqual(f.sum(), 1.3710468170000003) if SHOW_PLOTS: # show chamfer line fig = self.gef.plot(show=False) fig.axes[0].plot(chamfered_qc[s], self.gef.df.depth[s], color="red") fig.axes[0].hlines(ptl, 0, chamfered_qc.max()) fig.axes[0].hlines(tipping_point, 0, chamfered_qc.max()) plt.show()
def positive_friction( self, positive_friction_range=None, agg=True, conservative=False ): """ Determine shaft friction Rs. Parameters ---------- positive_friction_range : np.array[float] Length == 2. Start and end depth of positive friction. agg : bool Influences return type. True: aggregates the friction values in total friction. False: Return friction values per cpt layer. conservative : bool Returns ------- out : Union[float, np.array[float]] unit [MPa] See agg parameter """ if positive_friction_range: self.positive_friction_slice = det_slice( positive_friction_range, self.merged_soil_properties.depth.values ) self.chamfered_qc = bearing.chamfer_positive_friction( self.merged_soil_properties.qc.values, self.cpt.df.depth.values )[self.positive_friction_slice] positive_friction = bearing.positive_friction( depth=self.merged_soil_properties.depth.values[ self.positive_friction_slice ], chamfered_qc=self.chamfered_qc, circum=self.circum, alpha_s=self.alpha_s, ) self.rs = positive_friction.sum() if agg: return self.rs return positive_friction
negative_friction = (bearing.negative_friction( depth=df.depth.values[negative_friction_slice], grain_pressure=df.grain_pressure.values[negative_friction_slice], circum=circum, phi=df.phi[negative_friction_slice], gamma_m=1, )).sum() * 1000 positive_friction_slice = slice(idx_tp, idx_ptl) chamfered_qc = bearing.chamfer_positive_friction( df.qc.values, gef.df.depth.values)[positive_friction_slice] rs = (bearing.positive_friction( depth=df.depth.values[positive_friction_slice], chamfered_qc=chamfered_qc, circum=circum, alpha_s=0.01, )).sum() * 1000 rb = (bearing.compute_pile_tip_resistance( ptl=ptl, qc=df.qc.values, depth=df.depth.values, d_eq=1.13 * pile_width, alpha=0.7, beta=1, s=1, area=pile_width**2, )) * 1000 print(rb, rs, negative_friction)