Exemple #1
0
    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()
Exemple #2
0
    def test_pile_tip_resistance(self):
        f = partial(
            bearing.compute_pile_tip_resistance,
            qc=self.gef.df.qc.values,
            depth=self.gef.df.depth.values,
            d_eq=1.13 * 0.25,
            alpha=0.7,
            beta=1,
            s=1,
            area=0.25**2,
            return_q_components=True,
        )

        rb, qc_1, qc_2, qc_3 = f(nap_to_depth(self.gef.zid, -3.5))

        self.assertAlmostEqual(rb, 0.2575636376096491)
        self.assertAlmostEqual(qc_1, 10.33309298245614)
        self.assertAlmostEqual(qc_2, 5.92369298245614)
        self.assertAlmostEqual(qc_3, 3.645944736842105)

        rb, qc_1, qc_2, qc_3 = f(nap_to_depth(self.gef.zid, -12))

        self.assertAlmostEqual(rb, 0.9375)
        self.assertAlmostEqual(qc_1, 27.906636363636366)
        self.assertAlmostEqual(qc_2, 21.714000000000002)
        self.assertAlmostEqual(qc_3, 21.2664298245614)
Exemple #3
0
def estimate_water_pressure(cpt, soil_properties=None):
    """
    Estimate water pressure. If u2 is in CPT measurements, it is returned.
    Otherwise it computes a water pressure by assuming a rising pressure over depth.

    Parameters
    ----------
    cpt : pygef.ParseCPT
    soil_properties : pd.DataFrame
        Merged soil properties w/ pygef.ParseCPT.

    Returns
    -------
    u2 : np.array[float]
        Water pressure over depth.

    """
    if soil_properties is None:
        soil_properties = cpt.df

    if "u2" in cpt.df.columns:
        u2 = soil_properties.u2.values
    elif cpt.groundwater_level is not None:
        water_depth = nap_to_depth(cpt.zid, cpt.groundwater_level)
        u2 = (soil_properties.depth - water_depth) * WATER_PRESSURE
        u2[u2 < 0] = 0
    else:
        u2 = soil_properties.depth * WATER_PRESSURE
    return u2
Exemple #4
0
def estimate_water_pressure(cpt, soil_properties=None):
    """
    Estimate water pressure. If u is in CPT measurements, it is returned.
    Otherwise it computes a water pressure by assuming a rising pressure over depth.

    Parameters
    ----------
    cpt : pygef.ParseCPT
    soil_properties : pd.DataFrame
        Merged soil properties w/ pygef.ParseCPT.

    Returns
    -------
    u : np.array[float]
        Water pressure over depth.

    """
    if soil_properties is None:
        soil_properties = cpt.df

    if "u" in cpt.df.columns:
        u = soil_properties.u.values
    elif cpt.groundwater_level is not None:
        water_depth = nap_to_depth(cpt.zid, cpt.groundwater_level)
        u = (soil_properties.depth - water_depth) * WATER_PRESSURE
        u[u < 0] = 0
    else:
        u = soil_properties.depth * WATER_PRESSURE
        warnings.warn(
            "Water level not available in CPT. anaPile set the water level implicitly"
        )
    return u
Exemple #5
0
    def test_find_last_sand_layer(self):
        df = soil.join_cpt_with_classification(self.gef, self.layer_table)
        ptl = nap_to_depth(self.gef.zid, -13.5)
        idx_ptl = np.argmin(np.abs(self.gef.df.depth.values - ptl))

        self.assertTrue(
            soil.find_last_negative_friction_tipping_point(
                df.depth.values[:idx_ptl], df.soil_code[:idx_ptl]),
            3.848,
        )
Exemple #6
0
 def _set_ptl(self, pile_tip_level):
     """
     Set pile tip level property.
     Parameters
     ----------
     pile_tip_level : float
         Depth value wrt NAP.
     Returns
     -------
     None
     """
     self.pile_tip_level = nap_to_depth(self.cpt.zid, pile_tip_level)
     # find the index of the pile tip
     self._idx_ptl = np.argmin(
         np.abs(self.cpt.df.depth.values - self.pile_tip_level))
Exemple #7
0
    def test_negative_friction(self):
        layer_table = pd.read_csv("files/d_foundation_layer_table.csv")
        self.gef.groundwater_level = 1
        df = soil.join_cpt_with_classification(self.gef, layer_table)

        tipping_point = nap_to_depth(self.gef.zid, -2.1)
        idx_tp = np.argmin(np.abs(self.gef.df.depth.values - tipping_point))
        s = slice(0, idx_tp - 1)

        if SHOW_PLOTS:
            # show chamfer line
            fig = self.gef.plot(show=False)
            fig.axes[0].plot(df.qc.values[s], df.depth.values[s], color="red")
            fig.axes[0].hlines(tipping_point, 0, df.qc.values[s].max())
            plt.show()

        f = bearing.negative_friction(df.depth.values[s],
                                      df.grain_pressure.values[s], 0.25 * 4,
                                      df.phi.values[s])
        deviation = abs(1 - 19.355 / (f.sum() * 1000))
        self.assertTrue(deviation < 1e-2)
Exemple #8
0
from anapile.geo import soil
import pandas as pd
import numpy as np

# read cpt and layers
gef = ParseGEF("../tests/files/example.gef")
layer_table = pd.read_csv("../tests/files/layer_table.csv")

# we know the groundwater level is 1 m NAP
gef.groundwater_level = 1

# backfill cpt values with soil parameters
df = soil.join_cpt_with_classification(gef, layer_table)

# pile tip level -13.5 m
ptl = nap_to_depth(gef.zid, -13.5)
pile_width = 0.25
circum = pile_width * 4

# find the index of the pile tip
idx_ptl = np.argmin(np.abs(gef.df.depth.values - ptl))
ptl_slice = slice(0, idx_ptl)

# assume the tipping point is on top of the sand layers.
tipping_point = soil.find_last_negative_friction_tipping_point(
    df.depth.values[ptl_slice], df.soil_code[ptl_slice])

idx_tp = np.argmin(np.abs(df.depth.values - tipping_point))
negative_friction_slice = slice(0, idx_tp)

negative_friction = (bearing.negative_friction(