Skip to content

Commit 68a2536

Browse files
committed
minor updates
1 parent b769dd1 commit 68a2536

13 files changed

+329
-89
lines changed

CHANGELOG.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
77
and this project adheres to [Semantic Versioning](http://semver.org/),
88
and [PEP 440](https://www.python.org/dev/peps/pep-0440/).
99

10-
## [0.5.1] - 2023-XX-XX (Note released yet)
10+
## [0.5.1] - 2023-10-23
1111

1212
### Added
13-
- added property to `Pile` object: `openpile.construct.Pile.tip_area`
13+
- added properties to `Pile` object:
14+
- `openpile.construct.Pile.tip_area` and
15+
- `openpile.construct.Pile.tip_footprint`
1416
- added soil springs:
1517
- `openpile.utils.py_curves.custom_pisa_sand` and `openpile.utils.py_curves.custom_pisa_clay`
1618
- `openpile.utils.mt_curves.custom_pisa_sand` and `openpile.utils.mt_curves.custom_pisa_clay`

docs/source/gettingstarted.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,4 @@ Via the Anaconda distribution
6767
First model in OpenPile
6868
^^^^^^^^^^^^^^^^^^^^^^^
6969

70-
Please refer to the :ref:`usage` section where examples can help you get started.
70+
Please refer to the :ref:`usage` section where examples can help you get started.

docs/source/usage.rst

+17-17
Original file line numberDiff line numberDiff line change
@@ -66,33 +66,33 @@ axial or lateral loading.
6666
# Check young's modulus (value in kPa)
6767
print(pile.E)
6868
250000000.0
69-
# Override second moment of area across whole pile [in meters^4]
70-
pile.I = 1.11
69+
# Override second moment of area across first section [in meters^4]
70+
pile.set_I(value=1.11, section=1)
7171
# Check updated second moment of area
7272
print(pile)
73-
Elevation [m] Diameter [m] Wall thickness [m] Area [m2] I [m4]
74-
0 0.0 7.5 0.07 1.633942 1.11
75-
1 -10.0 7.5 0.07 1.633942 1.11
76-
2 -10.0 7.5 0.08 1.864849 1.11
77-
3 -40.0 7.5 0.08 1.864849 1.11
73+
Elevation [m] Diameter [m] Wall thickness [m] Area [m2] I [m4]
74+
0 0.0 7.5 0.07 1.633942 1.110000
75+
1 -10.0 7.5 0.07 1.633942 1.110000
76+
2 -10.0 7.5 0.08 1.864849 12.835479
77+
3 -40.0 7.5 0.08 1.864849 12.835479
7878
# Override pile's width or pile's diameter [in meters]
7979
pile.width = 2.22
8080
# Check updated width or diameter
8181
print(pile)
82-
Elevation [m] Diameter [m] Wall thickness [m] Area [m2] I [m4]
83-
0 0.0 2.22 0.07 1.633942 1.11
84-
1 -10.0 2.22 0.07 1.633942 1.11
85-
2 -10.0 2.22 0.08 1.864849 1.11
86-
3 -40.0 2.22 0.08 1.864849 1.11
82+
Elevation [m] Diameter [m] Wall thickness [m] Area [m2] I [m4]
83+
0 0.0 2.22 0.07 1.633942 1.110000
84+
1 -10.0 2.22 0.07 1.633942 1.110000
85+
2 -10.0 2.22 0.08 1.864849 12.835479
86+
3 -40.0 2.22 0.08 1.864849 12.835479
8787
# Override pile's area [in meters^2]
8888
pile.area = 1.0
8989
# Check updated width or diameter
9090
print(pile)
91-
Elevation [m] Diameter [m] Wall thickness [m] Area [m2] I [m4]
92-
0 0.0 2.22 0.07 1.0 1.11
93-
1 -10.0 2.22 0.07 1.0 1.11
94-
2 -10.0 2.22 0.08 1.0 1.11
95-
3 -40.0 2.22 0.08 1.0 1.11
91+
Elevation [m] Diameter [m] Wall thickness [m] Area [m2] I [m4]
92+
0 0.0 2.22 0.07 1.0 1.110000
93+
1 -10.0 2.22 0.07 1.0 1.110000
94+
2 -10.0 2.22 0.08 1.0 12.835479
95+
3 -40.0 2.22 0.08 1.0 12.835479
9696
9797
9898

samples/run_usage.ipynb

+34-4
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,37 @@
1010
},
1111
{
1212
"cell_type": "code",
13-
"execution_count": null,
13+
"execution_count": 3,
1414
"metadata": {},
15-
"outputs": [],
15+
"outputs": [
16+
{
17+
"name": "stdout",
18+
"output_type": "stream",
19+
"text": [
20+
" Elevation [m] Diameter [m] Wall thickness [m] Area [m2] I [m4]\n",
21+
"0 0.0 7.5 0.07 1.633942 11.276204\n",
22+
"1 -10.0 7.5 0.07 1.633942 11.276204\n",
23+
"2 -10.0 7.5 0.08 1.864849 12.835479\n",
24+
"3 -40.0 7.5 0.08 1.864849 12.835479\n",
25+
"250000000.0\n",
26+
" Elevation [m] Diameter [m] Wall thickness [m] Area [m2] I [m4]\n",
27+
"0 0.0 7.5 0.07 1.633942 1.110000\n",
28+
"1 -10.0 7.5 0.07 1.633942 1.110000\n",
29+
"2 -10.0 7.5 0.08 1.864849 12.835479\n",
30+
"3 -40.0 7.5 0.08 1.864849 12.835479\n",
31+
" Elevation [m] Diameter [m] Wall thickness [m] Area [m2] I [m4]\n",
32+
"0 0.0 2.22 0.07 1.633942 1.110000\n",
33+
"1 -10.0 2.22 0.07 1.633942 1.110000\n",
34+
"2 -10.0 2.22 0.08 1.864849 12.835479\n",
35+
"3 -40.0 2.22 0.08 1.864849 12.835479\n",
36+
" Elevation [m] Diameter [m] Wall thickness [m] Area [m2] I [m4]\n",
37+
"0 0.0 2.22 0.07 1.0 1.110000\n",
38+
"1 -10.0 2.22 0.07 1.0 1.110000\n",
39+
"2 -10.0 2.22 0.08 1.0 12.835479\n",
40+
"3 -40.0 2.22 0.08 1.0 12.835479\n"
41+
]
42+
}
43+
],
1644
"source": [
1745
"from openpile.construct import Pile\n",
1846
"\n",
@@ -42,7 +70,9 @@
4270
"# Check updated width or diameter\n",
4371
"print(pile)\n",
4472
"# Override pile's area [in meters^2]\n",
45-
"pile.area = 1.0\n"
73+
"pile.area = 1.0\n",
74+
"# Check updated width or diameter\n",
75+
"print(pile)\n"
4676
]
4777
},
4878
{
@@ -151,7 +181,7 @@
151181
"metadata": {},
152182
"outputs": [],
153183
"source": [
154-
"Result.details()"
184+
"Result.details()\n"
155185
]
156186
},
157187
{

samples/usage3.ipynb

+15-56
Large diffs are not rendered by default.

setup.cfg

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ name = openpile
33
author = Guillaume Melin
44
author_email = guillaume.melin@icloud.com
55
license = GPLv3
6-
license_file = LICENSE.txt
6+
license_files = LICENSE.txt
77
description = Library for geotechnical pile calculations.
88
url = https://github.com/TchilDill/openpile
9-
keywords = Offshore Wind, PILE, Geotechnics, monopile, pin-piles, Geotechnical, calculations, PISA, winkler
9+
keywords = PILE, Geotechnics, monopile, Geotechnical, calculations, PISA, winkler
1010
classifiers =
1111
License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
1212
License :: OSI Approved :: GNU General Public License v3 (GPLv3)

src/openpile/analyze.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ def winkler(model, max_iter: int = 100):
498498
Rg = F_ext + F_int
499499

500500
# check if converged
501-
if np.linalg.norm(Rg[~supports]) < nr_tol:
501+
if np.linalg.norm(Rg[~supports]) < nr_tol and iter_no > 1:
502502
# do not accept convergence without iteration (without a second call to solve equations)
503503
print(f"Converged at iteration no. {iter_no}")
504504
break

src/openpile/core/kernel.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ def elem_p_delta_stiffness_matrix(model, u):
530530

531531
else:
532532
raise ValueError(
533-
"Model.element.type only accepts 'EB' type (for Euler-Bernoulli) of 'T' type (for Timoshenko)"
533+
"Model.element.type only accepts 'EulerBernoulli' or 'Timoshenko'"
534534
)
535535

536536
k = (
@@ -547,7 +547,7 @@ def elem_p_delta_stiffness_matrix(model, u):
547547
* -P
548548
)
549549

550-
return np.maximum(0,k)
550+
return k
551551

552552

553553
@njit(parallel=True, cache=True)
@@ -607,6 +607,8 @@ def build_stiffness_matrix(model, u=None, kind=None):
607607
k = elem_mechanical_stiffness_matrix(model)
608608
k += elem_p_delta_stiffness_matrix(model, u)
609609

610+
#k = np.maximum(0,k)
611+
610612
# add soil contribution
611613
if model.soil is not None:
612614
# gives warning if soil is given without displacements or type of stiffness
@@ -623,7 +625,7 @@ def build_stiffness_matrix(model, u=None, kind=None):
623625
)
624626
k += elem_mt_stiffness_matrix(model, u, kind)
625627

626-
K = jit_build(k, ndim_global, n_elem, node_per_element, ndof_per_node)
628+
K = jit_build( k , ndim_global, n_elem, node_per_element, ndof_per_node)
627629

628630
# add base springs contribution
629631
if model.soil is not None:

src/openpile/soilmodels.py

+1
Original file line numberDiff line numberDiff line change
@@ -1418,3 +1418,4 @@ def Mb_spring_fct(
14181418

14191419
return y, Mb
14201420

1421+

src/openpile/utils/multipliers.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def durkhop(D: float, ra: float = 0.3) -> object:
1515
1616
The default behaviour, i.e. when the parameter `ra` = 0.3 is that the API sand cyclic curves are unchanged
1717
with a equivalent number of cycles equal to 100.
18-
When the parameter `ra` is equal to 1.0, the cyclic curves are returned back to monotonic curves.
18+
When the parameter `ra` is equal to 1.0, the cyclic curves are approach the static curves.
1919
In between 0.3 and 1.0, the multipliers may be thought as cyclic curves with a lower number of equivalent cycles.
2020
2121
Parameters
@@ -84,9 +84,13 @@ def durkhop_normalized(D: float, ra: float = 0.3) -> object:
8484
The function input is the depth and the function output is the multiplier applied
8585
for the spring at the said depth.
8686
87+
Example
88+
-------
89+
90+
8791
See also
8892
--------
89-
`durkhop`
93+
`openpile.utils.multipliers.durkhop`
9094
"""
9195

9296
func = lambda x: 0.9 / max(0.9, ra * (3 - 1.143 * x / D) + 0.343 * x / D)

test/test_multipliers.py

+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
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

Comments
 (0)