geolysis 0.9.0__py3-none-any.whl → 0.10.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. geolysis/__init__.py +3 -3
  2. geolysis/bearing_capacity/abc/__init__.py +21 -0
  3. geolysis/bearing_capacity/abc/_cohl/__init__.py +109 -0
  4. geolysis/bearing_capacity/abc/{cohl → _cohl}/_core.py +19 -8
  5. geolysis/bearing_capacity/abc/_cohl/bowles_abc.py +103 -0
  6. geolysis/bearing_capacity/abc/_cohl/meyerhof_abc.py +100 -0
  7. geolysis/bearing_capacity/abc/_cohl/terzaghi_abc.py +143 -0
  8. geolysis/bearing_capacity/ubc/__init__.py +107 -128
  9. geolysis/bearing_capacity/ubc/_core.py +65 -52
  10. geolysis/bearing_capacity/ubc/_hansen_ubc.py +271 -0
  11. geolysis/bearing_capacity/ubc/_terzaghi_ubc.py +178 -0
  12. geolysis/bearing_capacity/ubc/_vesic_ubc.py +253 -0
  13. geolysis/foundation.py +146 -136
  14. geolysis/soil_classifier.py +379 -283
  15. geolysis/spt.py +323 -257
  16. geolysis/{utils/__init__.py → utils.py} +44 -33
  17. geolysis-0.10.0.dist-info/METADATA +181 -0
  18. geolysis-0.10.0.dist-info/RECORD +22 -0
  19. {geolysis-0.9.0.dist-info → geolysis-0.10.0.dist-info}/WHEEL +1 -1
  20. geolysis/bearing_capacity/abc/cohl/__init__.py +0 -137
  21. geolysis/bearing_capacity/abc/cohl/bowles_abc.py +0 -96
  22. geolysis/bearing_capacity/abc/cohl/meyerhof_abc.py +0 -96
  23. geolysis/bearing_capacity/abc/cohl/terzaghi_abc.py +0 -131
  24. geolysis/bearing_capacity/ubc/hansen_ubc.py +0 -287
  25. geolysis/bearing_capacity/ubc/terzaghi_ubc.py +0 -246
  26. geolysis/bearing_capacity/ubc/vesic_ubc.py +0 -293
  27. geolysis/utils/exceptions.py +0 -65
  28. geolysis/utils/validators.py +0 -119
  29. geolysis-0.9.0.dist-info/METADATA +0 -206
  30. geolysis-0.9.0.dist-info/RECORD +0 -24
  31. {geolysis-0.9.0.dist-info → geolysis-0.10.0.dist-info}/licenses/LICENSE.txt +0 -0
  32. {geolysis-0.9.0.dist-info → geolysis-0.10.0.dist-info}/top_level.txt +0 -0
geolysis/__init__.py CHANGED
@@ -1,5 +1,5 @@
1
- from . import foundation, soil_classifier, spt
1
+ from . import bearing_capacity, foundation, soil_classifier, spt
2
2
 
3
- __version__ = "0.9.0"
3
+ __version__ = "0.10.0"
4
4
 
5
- __all__ = ["foundation", "soil_classifier", "spt"]
5
+ __all__ = ["foundation", "soil_classifier", "spt", "bearing_capacity"]
@@ -0,0 +1,21 @@
1
+ from ._cohl import (
2
+ ABCType,
3
+ create_abc_4_cohesionless_soils,
4
+ BowlesABC4PadFoundation,
5
+ BowlesABC4MatFoundation,
6
+ MeyerhofABC4MatFoundation,
7
+ MeyerhofABC4PadFoundation,
8
+ TerzaghiABC4MatFoundation,
9
+ TerzaghiABC4PadFoundation,
10
+ )
11
+
12
+ __all__ = [
13
+ "create_abc_4_cohesionless_soils",
14
+ "ABCType",
15
+ "BowlesABC4PadFoundation",
16
+ "BowlesABC4MatFoundation",
17
+ "MeyerhofABC4PadFoundation",
18
+ "MeyerhofABC4MatFoundation",
19
+ "TerzaghiABC4PadFoundation",
20
+ "TerzaghiABC4MatFoundation",
21
+ ]
@@ -0,0 +1,109 @@
1
+ import enum
2
+ from typing import Optional, Annotated
3
+
4
+ from func_validator import MustBeMemberOf, validate_func_args
5
+
6
+ from geolysis.foundation import FoundationType, Shape, create_foundation
7
+ from geolysis.utils import AbstractStrEnum, inf
8
+ from ._core import AllowableBearingCapacity
9
+ from .bowles_abc import BowlesABC4MatFoundation, BowlesABC4PadFoundation
10
+ from .meyerhof_abc import MeyerhofABC4MatFoundation, MeyerhofABC4PadFoundation
11
+ from .terzaghi_abc import TerzaghiABC4MatFoundation, TerzaghiABC4PadFoundation
12
+
13
+
14
+ class ABCType(AbstractStrEnum):
15
+ """Enumeration of allowable bearing capacity calculation methods.
16
+
17
+ Each member represents a different method for determining
18
+ the allowable bearing capacity of soil.
19
+ """
20
+
21
+ BOWLES = enum.auto()
22
+ """Bowles's method for calculating allowable bearing capacity"""
23
+
24
+ MEYERHOF = enum.auto()
25
+ """Meyerhof's method for calculating allowable bearing capacity"""
26
+
27
+ TERZAGHI = enum.auto()
28
+ """Terzaghi's method for calculating allowable bearing capacity"""
29
+
30
+
31
+ @validate_func_args
32
+ def create_abc_4_cohesionless_soils(
33
+ corrected_spt_n_value: float,
34
+ tol_settlement: float,
35
+ depth: float,
36
+ width: float,
37
+ length: Optional[float] = None,
38
+ eccentricity: float = 0.0,
39
+ ground_water_level: float = inf,
40
+ shape: Shape | str = "square",
41
+ foundation_type: Annotated[
42
+ FoundationType | str, MustBeMemberOf(FoundationType)
43
+ ] = "pad",
44
+ abc_type: Annotated[ABCType | str, MustBeMemberOf(ABCType)] = "bowles",
45
+ ) -> AllowableBearingCapacity:
46
+ r"""A factory function that encapsulate the creation of allowable
47
+ bearing capacities.
48
+
49
+ :param corrected_spt_n_value: The corrected SPT N-value.
50
+ :param tol_settlement: Tolerable settlement of foundation (mm).
51
+ :param depth: Depth of foundation (m).
52
+ :param width: Width of foundation footing (m).
53
+ :param length: Length of foundation footing (m).
54
+ :param eccentricity: The deviation of the foundation load from the
55
+ center of gravity of the foundation footing (m).
56
+ :param ground_water_level: Depth of water below ground level (m).
57
+ :param shape: Shape of foundation footing
58
+ :param foundation_type: Type of foundation.
59
+ :param abc_type: Type of allowable bearing capacity calculation to
60
+ apply.
61
+
62
+ :raises ValidationError: Raised if `abc_type` or `foundation_type`
63
+ is not supported.
64
+ :raises ValidationError: Raised if an invalid footing `shape` is
65
+ provided.
66
+ :raises ValueError: Raised when `length` is not provided for a
67
+ rectangular footing.
68
+ """
69
+ abc_type = ABCType(abc_type)
70
+ foundation_type = FoundationType(foundation_type)
71
+
72
+ # exception from create_foundation will automaatically propagate
73
+ # no need to catch and handle it.
74
+ fnd_size = create_foundation(
75
+ depth=depth,
76
+ width=width,
77
+ length=length,
78
+ eccentricity=eccentricity,
79
+ ground_water_level=ground_water_level,
80
+ foundation_type=foundation_type,
81
+ shape=shape,
82
+ )
83
+
84
+ abc_class = _get_allowable_bearing_capacity(abc_type,
85
+ fnd_size.foundation_type)
86
+ return abc_class(
87
+ corrected_spt_n_value=corrected_spt_n_value,
88
+ tol_settlement=tol_settlement,
89
+ foundation_size=fnd_size,
90
+ )
91
+
92
+
93
+ def _get_allowable_bearing_capacity(abc_type: ABCType,
94
+ foundation_type: FoundationType):
95
+ abc_classes = {
96
+ ABCType.BOWLES: {
97
+ FoundationType.PAD: BowlesABC4PadFoundation,
98
+ FoundationType.MAT: BowlesABC4MatFoundation,
99
+ },
100
+ ABCType.MEYERHOF: {
101
+ FoundationType.PAD: MeyerhofABC4PadFoundation,
102
+ FoundationType.MAT: MeyerhofABC4MatFoundation,
103
+ },
104
+ ABCType.TERZAGHI: {
105
+ FoundationType.PAD: TerzaghiABC4PadFoundation,
106
+ FoundationType.MAT: TerzaghiABC4MatFoundation,
107
+ },
108
+ }
109
+ return abc_classes[abc_type][foundation_type]
@@ -1,16 +1,25 @@
1
1
  from abc import ABC, abstractmethod
2
+ from typing import Annotated
3
+
4
+ from func_validator import (
5
+ validate_func_args,
6
+ MustBeNonNegative,
7
+ MustBeLessThanOrEqual,
8
+ )
2
9
 
3
10
  from geolysis.foundation import Foundation
4
- from geolysis.utils import validators
5
11
 
6
12
 
7
13
  class AllowableBearingCapacity(ABC):
8
14
  #: Maximum tolerable foundation settlement (mm).
9
15
  MAX_TOL_SETTLEMENT = 25.4
10
16
 
11
- def __init__(self, corrected_spt_n_value: float,
12
- tol_settlement: float,
13
- foundation_size: Foundation) -> None:
17
+ def __init__(
18
+ self,
19
+ corrected_spt_n_value: float,
20
+ tol_settlement: float,
21
+ foundation_size: Foundation,
22
+ ) -> None:
14
23
  self.corrected_spt_n_value = corrected_spt_n_value
15
24
  self.tol_settlement = tol_settlement
16
25
  self.foundation_size = foundation_size
@@ -21,8 +30,8 @@ class AllowableBearingCapacity(ABC):
21
30
  return self._corrected_spt_n_value
22
31
 
23
32
  @corrected_spt_n_value.setter
24
- @validators.ge(0.0)
25
- def corrected_spt_n_value(self, val: float) -> None:
33
+ @validate_func_args
34
+ def corrected_spt_n_value(self, val: Annotated[float, MustBeNonNegative]):
26
35
  self._corrected_spt_n_value = val
27
36
 
28
37
  @property
@@ -31,8 +40,10 @@ class AllowableBearingCapacity(ABC):
31
40
  return self._tol_settlement
32
41
 
33
42
  @tol_settlement.setter
34
- @validators.le(25.4)
35
- def tol_settlement(self, tol_settlement: float) -> None:
43
+ @validate_func_args
44
+ def tol_settlement(
45
+ self, tol_settlement: Annotated[float, MustBeLessThanOrEqual(25.4)]
46
+ ):
36
47
  self._tol_settlement = tol_settlement
37
48
 
38
49
  def _sr(self) -> float:
@@ -0,0 +1,103 @@
1
+ from geolysis.foundation import Foundation
2
+ from geolysis.utils import round_
3
+
4
+ from ._core import AllowableBearingCapacity
5
+
6
+
7
+ class BowlesABC4PadFoundation(AllowableBearingCapacity):
8
+ r"""Allowable bearing capacity for pad foundation on cohesionless
9
+ soils according to `Bowles (1997)`.
10
+
11
+ $$
12
+ q_a(kPa) = 19.16(N_1)_{55} f_d\left(\dfrac{S}{25.4}\right),
13
+ \ B \ \le \ 1.2m
14
+ $$
15
+
16
+ $$
17
+ q_a(kPa) = 11.98(N_1)_{55}\left(\dfrac{3.28B + 1}{3.28B} \right)^2
18
+ f_d \left(\dfrac{S}{25.4}\right), \ B \ \gt 1.2m
19
+ $$
20
+
21
+ $$
22
+ f_d = 1 + 0.33 \cdot \frac{D_f}{B} \le 1.33
23
+ $$
24
+
25
+ - $q_a$ (kPa): Allowable bearing capacity
26
+ - $N$: Corrected SPT N-value
27
+ - $f_d$: Depth factor
28
+ - $S$ (mm): Tolerable settlement
29
+ - $B$ (m): Width of foundation footing
30
+ - $D_f$ (m): Depth of foundation footing
31
+ - $D_w$ (m): Depth of water below ground level
32
+
33
+ """
34
+
35
+ def __init__(
36
+ self,
37
+ corrected_spt_n_value: float,
38
+ tol_settlement: float,
39
+ foundation_size: Foundation,
40
+ ) -> None:
41
+ """
42
+ :param corrected_spt_n_value: Statistical average of corrected
43
+ SPT N-value (55% energy with
44
+ overburden pressure correction)
45
+ within the foundation influence
46
+ zone i.e `0.5B` to `2B`.
47
+ :param tol_settlement: Tolerable settlement of foundation (mm).
48
+ :param foundation_size: Size of the foundation.
49
+ """
50
+ super().__init__(
51
+ corrected_spt_n_value=corrected_spt_n_value,
52
+ tol_settlement=tol_settlement,
53
+ foundation_size=foundation_size,
54
+ )
55
+
56
+ @round_(ndigits=2)
57
+ def bearing_capacity(self) -> float:
58
+ """
59
+ Calculate the allowable bearing capacity of the pad foundation.
60
+ """
61
+ n_corr = self.corrected_spt_n_value
62
+ width = self.foundation_size.width
63
+
64
+ if width <= 1.2:
65
+ return 19.16 * n_corr * self._fd() * self._sr()
66
+
67
+ return (
68
+ 11.98
69
+ * n_corr
70
+ * ((3.28 * width + 1) / (3.28 * width)) ** 2
71
+ * self._fd()
72
+ * self._sr()
73
+ )
74
+
75
+
76
+ class BowlesABC4MatFoundation(BowlesABC4PadFoundation):
77
+ r"""Allowable bearing capacity for mat foundation on cohesionless
78
+ soils according to `Bowles (1997)`.
79
+
80
+ $$
81
+ q_a(kPa) = 11.98(N_1)_{55}f_d\left(\dfrac{S}{25.4}\right)
82
+ $$
83
+
84
+ $$
85
+ f_d = 1 + 0.33 \cdot \frac{D_f}{B} \le 1.33
86
+ $$
87
+
88
+ - $q_a$ (kPa): Allowable bearing capacity
89
+ - $N$: Corrected SPT N-value
90
+ - $f_d$: Depth factor
91
+ - $S$ (mm): Tolerable settlement
92
+ - $B$ (m): Width of foundation footing
93
+ - $D_f$ (m): Depth of foundation footing
94
+ - $D_w$ (m): Depth of water below ground level
95
+ """
96
+
97
+ @round_(ndigits=2)
98
+ def bearing_capacity(self) -> float:
99
+ """
100
+ Calculate the allowable bearing capacity of the mat foundation.
101
+ """
102
+ n_corr = self.corrected_spt_n_value
103
+ return 11.98 * n_corr * self._fd() * self._sr()
@@ -0,0 +1,100 @@
1
+ from geolysis.foundation import Foundation
2
+ from geolysis.utils import round_
3
+
4
+ from ._core import AllowableBearingCapacity
5
+
6
+
7
+ class MeyerhofABC4PadFoundation(AllowableBearingCapacity):
8
+ r"""Allowable bearing capacity for pad foundation on cohesionless
9
+ soils according to `Meyerhof (1956)`.
10
+
11
+ $$
12
+ q_a(kPa) = 12N f_d\left(\dfrac{S}{25.4}\right), \ B \ \le 1.2m
13
+ $$
14
+
15
+ $$
16
+ q_a(kPa) = 8N\left(\dfrac{3.28B + 1}{3.28B} \right)^2 f_d\left(
17
+ \dfrac{S}{25.4}\right), \ B \ \gt 1.2m
18
+ $$
19
+
20
+ $$
21
+ f_d = 1 + 0.33 \cdot \frac{D_f}{B} \le 1.33
22
+ $$
23
+
24
+ - $q_a$ (kPa): Allowable bearing capacity
25
+ - $N$: Corrected SPT N-value
26
+ - $f_d$: Depth factor
27
+ - $S$ (mm): Tolerable settlement
28
+ - $B$ (m): Width of foundation footing
29
+ - $D_f$ (m): Depth of foundation footing
30
+ - $D_w$ (m): Depth of water below ground level
31
+
32
+ """
33
+
34
+ def __init__(
35
+ self,
36
+ corrected_spt_n_value: float,
37
+ tol_settlement: float,
38
+ foundation_size: Foundation,
39
+ ):
40
+ """
41
+ :param corrected_spt_n_value: Average uncorrected SPT N-value
42
+ (60% energy with dilatancy (water)
43
+ correction if applicable) within
44
+ the foundation influence zone i.e.
45
+ $D_f$ to $D_f + 2B$.
46
+ :param tol_settlement: Tolerable settlement of foundation (mm).
47
+ :param foundation_size: Size of the foundation.
48
+ """
49
+ super().__init__(
50
+ corrected_spt_n_value=corrected_spt_n_value,
51
+ tol_settlement=tol_settlement,
52
+ foundation_size=foundation_size,
53
+ )
54
+
55
+ @round_(ndigits=2)
56
+ def bearing_capacity(self):
57
+ """
58
+ Calculates the allowable bearing capacity of the pad foundation.
59
+ """
60
+ n_corr = self.corrected_spt_n_value
61
+ width = self.foundation_size.width
62
+
63
+ if width <= 1.2:
64
+ return 12 * n_corr * self._fd() * self._sr()
65
+
66
+ return (
67
+ 8
68
+ * n_corr
69
+ * ((3.28 * width + 1) / (3.28 * width)) ** 2
70
+ * self._fd()
71
+ * self._sr()
72
+ )
73
+
74
+
75
+ class MeyerhofABC4MatFoundation(MeyerhofABC4PadFoundation):
76
+ r"""Allowable bearing capacity for mat foundation on cohesionless
77
+ soils according to `Meyerhof (1956)`.
78
+
79
+ $$
80
+ q_a(kPa) = 8 N f_d\left(\dfrac{S}{25.4}\right)
81
+ $$
82
+
83
+ $$
84
+ f_d = 1 + 0.33 \cdot \frac{D_f}{B} \le 1.33
85
+ $$
86
+
87
+ - $q_a$ (kPa): Allowable bearing capacity
88
+ - $N$: Corrected SPT N-value
89
+ - $f_d$: Depth factor
90
+ - $S$ (mm): Tolerable settlement
91
+ - $B$ (m): Width of foundation footing
92
+ - $D_f$ (m): Depth of foundation footing
93
+ - $D_w$ (m): Depth of water below ground level
94
+ """
95
+
96
+ @round_(ndigits=2)
97
+ def bearing_capacity(self):
98
+ """Calculate the allowable bearing capacity of the mat foundation."""
99
+ n_corr = self.corrected_spt_n_value
100
+ return 8 * n_corr * self._fd() * self._sr()
@@ -0,0 +1,143 @@
1
+ from geolysis.foundation import Foundation
2
+ from geolysis.utils import round_
3
+
4
+ from ._core import AllowableBearingCapacity
5
+
6
+
7
+ class TerzaghiABC4PadFoundation(AllowableBearingCapacity):
8
+ r"""Allowable bearing capacity for pad foundation on cohesionless
9
+ soils according to `Terzaghi & Peck (1948)`.
10
+
11
+ $$
12
+ q_a(kPa) = 12N \dfrac{1}{c_w f_d}\left(\dfrac{S}{25.4}\right),
13
+ \ B \ \le 1.2m
14
+ $$
15
+
16
+ $$
17
+ q_a(kPa) = 8N\left(\dfrac{3.28B + 1}{3.28B} \right)^2\dfrac{1}
18
+ {c_w f_d}\left(\dfrac{S}{25.4}\right), \ B \ \gt 1.2m
19
+ $$
20
+
21
+ $$
22
+ f_d = 1 + 0.25 \cdot \frac{D_f}{B} \le 1.25
23
+ $$
24
+
25
+ $$
26
+ c_w = 2 - \frac{D_w}{2B} \le 2, D_w \gt D_f
27
+ $$
28
+
29
+ $$
30
+ c_w = 2 - \frac{D_f}{2B} \le 2, D_w \le D_f
31
+ $$
32
+
33
+ - $q_a$ (kPa): Allowable bearing capacity
34
+ - $N$: Corrected SPT N-value
35
+ - $f_d$: Depth factor
36
+ - $c_w$: Water correction factor
37
+ - $S$ (mm): Tolerable settlement
38
+ - $B$ (m): Width of foundation footing
39
+ - $D_f$ (m): Depth of foundation footing
40
+ - $D_w$ (m): Depth of water below ground level
41
+
42
+ """
43
+
44
+ def __init__(
45
+ self,
46
+ corrected_spt_n_value: float,
47
+ tol_settlement: float,
48
+ foundation_size: Foundation,
49
+ ) -> None:
50
+ """
51
+ :param corrected_spt_n_value: Lowest (or average) uncorrected
52
+ SPT N-value (60% energy) within
53
+ the foundation influence zone i.e.
54
+ $D_f$ to $D_f + 2B$
55
+ :param tol_settlement: Tolerable settlement of foundation (mm).
56
+ :param foundation_size: Size of the foundation.
57
+ """
58
+ super().__init__(
59
+ corrected_spt_n_value=corrected_spt_n_value,
60
+ tol_settlement=tol_settlement,
61
+ foundation_size=foundation_size,
62
+ )
63
+
64
+ def _fd(self) -> float:
65
+ """Calculate the depth factor."""
66
+ depth = self.foundation_size.depth
67
+ width = self.foundation_size.width
68
+
69
+ return min(1.0 + 0.25 * depth / width, 1.25)
70
+
71
+ def _cw(self):
72
+ """Calculate the water correction factor."""
73
+ depth = self.foundation_size.depth
74
+ width = self.foundation_size.width
75
+ water_level = self.foundation_size.ground_water_level
76
+
77
+ if water_level is None:
78
+ return 2.0
79
+
80
+ if water_level <= depth:
81
+ cw = 2.0 - depth / (2.0 * width)
82
+ else:
83
+ cw = 2.0 - water_level / (2.0 * width)
84
+
85
+ return min(cw, 2.0)
86
+
87
+ @round_(ndigits=2)
88
+ def bearing_capacity(self):
89
+ """
90
+ Calculates the allowable bearing capacity of the pad foundation.
91
+ """
92
+ n_corr = self.corrected_spt_n_value
93
+ width = self.foundation_size.width
94
+
95
+ if width <= 1.2:
96
+ return 12 * n_corr * (1 / (self._cw() * self._fd())) * self._sr()
97
+
98
+ return (
99
+ 8
100
+ * n_corr
101
+ * ((3.28 * width + 1) / (3.28 * width)) ** 2
102
+ * (1 / (self._cw() * self._fd()))
103
+ * self._sr()
104
+ )
105
+
106
+
107
+ class TerzaghiABC4MatFoundation(TerzaghiABC4PadFoundation):
108
+ r"""Allowable bearing capacity for mat foundation on cohesionless
109
+ soils according to `Terzaghi & Peck (1948)`.
110
+
111
+ $$
112
+ q_a(kPa) = 8N\dfrac{1}{c_w f_d}\left(\dfrac{S}{25.4}\right)
113
+ $$
114
+
115
+ $$
116
+ f_d = 1 + 0.25 \cdot \frac{D_f}{B} \le 1.25
117
+ $$
118
+
119
+ $$
120
+ c_w = 2 - \frac{D_w}{2B} \le 2, D_w \gt D_f
121
+ $$
122
+
123
+ $$
124
+ c_w = 2 - \frac{D_f}{2B} \le 2, D_w \le D_f
125
+ $$
126
+
127
+ - $q_a$ (kPa): Allowable bearing capacity
128
+ - $N$: Corrected SPT N-value
129
+ - $f_d$: Depth factor
130
+ - $c_w$: Water correction factor
131
+ - $S$ (mm): Tolerable settlement
132
+ - $B$ (m): Width of foundation footing
133
+ - $D_f$ (m): Depth of foundation footing
134
+ - $D_w$ (m): Depth of water below ground level
135
+ """
136
+
137
+ @round_(ndigits=2)
138
+ def bearing_capacity(self):
139
+ """
140
+ Calculates the allowable bearing capacity of the mat foundation.
141
+ """
142
+ n_corr = self.corrected_spt_n_value
143
+ return 8 * n_corr * (1 / (self._cw() * self._fd())) * self._sr()