|
| 1 | + |
| 2 | +import pytest |
| 3 | +from openpile.construct import Pile, SoilProfile, Layer, Model |
| 4 | +from openpile.soilmodels import API_sand |
| 5 | +from openpile.analyze import winkler |
| 6 | +from openpile.utils.multipliers import durkhop |
| 7 | + |
| 8 | +import math as m |
| 9 | + |
| 10 | +@pytest.fixture |
| 11 | +def create_pile(): |
| 12 | + return Pile.create_tubular( |
| 13 | + name="<pile name>", top_elevation=0, bottom_elevation=-40, diameter=7, wt=0.050 |
| 14 | + ) |
| 15 | + |
| 16 | + |
| 17 | +@pytest.fixture |
| 18 | +def create_cyclic_soilprofile(): |
| 19 | + # Create a 40m deep offshore Soil Profile with a 15m water column |
| 20 | + sp = SoilProfile( |
| 21 | + name="Offshore Soil Profile", |
| 22 | + top_elevation=0, |
| 23 | + water_line=15, |
| 24 | + layers=[ |
| 25 | + Layer( |
| 26 | + name="medium dense sand", |
| 27 | + top=0, |
| 28 | + bottom=-40, |
| 29 | + weight=18, |
| 30 | + lateral_model=API_sand(phi=33, kind="cyclic"), |
| 31 | + ), |
| 32 | + ], |
| 33 | + ) |
| 34 | + return sp |
| 35 | + |
| 36 | + |
| 37 | +@pytest.fixture |
| 38 | +def create_static_soilprofile(): |
| 39 | + # Create a 40m deep offshore Soil Profile with a 15m water column |
| 40 | + sp = SoilProfile( |
| 41 | + name="Offshore Soil Profile", |
| 42 | + top_elevation=0, |
| 43 | + water_line=15, |
| 44 | + layers=[ |
| 45 | + Layer( |
| 46 | + name="medium dense sand", |
| 47 | + top=0, |
| 48 | + bottom=-40, |
| 49 | + weight=18, |
| 50 | + lateral_model=API_sand(phi=33, kind="static"), |
| 51 | + ), |
| 52 | + ], |
| 53 | + ) |
| 54 | + return sp |
| 55 | + |
| 56 | + |
| 57 | +@pytest.fixture |
| 58 | +def create_duhrkop_soilprofile(): |
| 59 | + # Create a 40m deep offshore Soil Profile with a 15m water column |
| 60 | + sp = SoilProfile( |
| 61 | + name="Offshore Soil Profile", |
| 62 | + top_elevation=0, |
| 63 | + water_line=15, |
| 64 | + layers=[ |
| 65 | + Layer( |
| 66 | + name="medium dense sand", |
| 67 | + top=0, |
| 68 | + bottom=-40, |
| 69 | + weight=18, |
| 70 | + lateral_model=API_sand(phi=33, kind="cyclic",p_multiplier=durkhop(D=7,ra=0.3)), |
| 71 | + ), |
| 72 | + ], |
| 73 | + ) |
| 74 | + return sp |
| 75 | + |
| 76 | + |
| 77 | +def test_APIcylic_equals_durkhop_ra_03(create_pile, create_cyclic_soilprofile,create_duhrkop_soilprofile): |
| 78 | + |
| 79 | + # Create Model 1 |
| 80 | + M1 = Model(name="<model name>", pile=create_pile, soil=create_cyclic_soilprofile) |
| 81 | + # Apply bottom fixity along x-axis |
| 82 | + M1.set_support(elevation=-40, Tx=True) |
| 83 | + # Apply axial and lateral loads |
| 84 | + M1.set_pointload(elevation=0, Mz=-300e3, Py=30e3) |
| 85 | + R1 = winkler(M1) |
| 86 | + |
| 87 | + # Create Model 2 |
| 88 | + M2 = Model(name="<model name>", pile=create_pile, soil=create_duhrkop_soilprofile) |
| 89 | + # Apply bottom fixity along x-axis |
| 90 | + M2.set_support(elevation=-40, Tx=True) |
| 91 | + # Apply axial and lateral loads |
| 92 | + M2.set_pointload(elevation=0, Mz=-300e3, Py=30e3) |
| 93 | + R2 = winkler(M2) |
| 94 | + |
| 95 | + assert m.isclose(R1.details()['Max. deflection [m]'], R2.details()['Max. deflection [m]'], rel_tol=0.01) |
0 commit comments