Skip to content

Commit fab3388

Browse files
committed
Squashed commit of the following:
commit 0c3ef44 Author: Matt Hall <5151457+mattEhall@users.noreply.github.com> Date: Wed Jul 23 11:41:24 2025 -0600 Removing HAMS BEM files and what causes them: - removing examples 03 BEM folder created by RAFT runs. - changing RAFT YAML PotMods from True to False to avoid issue in future. commit 7828a9f Author: Moreno <fmoreno@nrel.gov> Date: Fri Jul 18 09:50:56 2025 -0600 Depreciated function trapz needs to be reused due to uncompatibility with CI tests commit 33edd4b Author: Moreno <fmoreno@nrel.gov> Date: Fri Jul 18 09:40:11 2025 -0600 support_soils linked connected commit 0941863 Author: Moreno <fmoreno@nrel.gov> Date: Fri Jul 18 09:36:12 2025 -0600 Depreciated function trapz needs to be reused due to uncompatibility with CI tests commit b4dea97 Author: Moreno <fmoreno@nrel.gov> Date: Thu Jul 17 16:16:45 2025 -0600 Change order of the CI tests: pytest + example_driver.py commit 30b2ca5 Author: Moreno <fmoreno@nrel.gov> Date: Thu Jul 17 15:37:25 2025 -0600 Changes on the yaml file to include new soil structure commit 4e0866e Author: Moreno <fmoreno@nrel.gov> Date: Thu Jul 17 11:42:37 2025 -0600 Removed anchor tension limit exception commit 7de4650 Author: Moreno <fmoreno@nrel.gov> Date: Wed Jul 16 11:26:31 2025 -0600 Update FAModel_anchors: new anchor scripts, updated RAFT BEM inputs, suction pile improvements commit 0d75993 Author: Moreno <fmoreno@nrel.gov> Date: Tue Jul 8 13:05:36 2025 -0600 Remove outdated 04_Anchors examples after migrating to 05_Anchors commit b8dbd3f Merge: 4383c4c 831d651 Author: Moreno <fmoreno@nrel.gov> Date: Tue Jul 8 13:04:43 2025 -0600 Merge upstream changes; keep local anchor.py, store upstream version as backup commit 4383c4c Author: Moreno <fmoreno@nrel.gov> Date: Tue Jul 8 12:16:53 2025 -0600 WIP: Local development progress before merging upstream FAModel commit 834999b Author: Moreno <fmoreno@nrel.gov> Date: Mon Jun 23 11:15:04 2025 -0600 Merge upstream/main into FAModel_anchors with local enhancements, including update to capacity_suction.py commit f149d96 Merge: 6030d1c 12ce2a3 Author: Moreno <fmoreno@nrel.gov> Date: Mon Jun 23 11:09:12 2025 -0600 Merge remote-tracking branch 'upstream/main' into sync/upstream-2025-06-23 commit 6030d1c Author: Moreno <fmoreno@nrel.gov> Date: Mon Jun 23 10:59:03 2025 -0600 WIP: custom changes before upstream sync commit 883b024 Author: Moreno <fmoreno@nrel.gov> Date: Wed Jun 18 16:30:20 2025 -0600 Major refactor of anchor module: removed legacy map files, added new anchor types and updated capacities commit 66e4bc0 Author: Moreno <fmoreno@nrel.gov> Date: Fri Jun 13 16:00:51 2025 -0600 feat: update anchor capacity scripts and add suction example notebook
1 parent 831d651 commit fab3388

File tree

116 files changed

+14104
-10438
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+14104
-10438
lines changed

.github/workflows/CI_FAModel.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,16 @@ jobs:
4949
- name: Overwrite MoorPy
5050
run: |
5151
pip install git+https://github.com/NREL/MoorPy@dev
52-
53-
- name: Example run
54-
run: |
55-
cd examples
56-
python example_driver.py false
57-
52+
5853
- name: Test run
5954
run: |
6055
cd tests
6156
pytest .
6257
58+
# - name: Example run
59+
# run: |
60+
# cd examples
61+
# python example_driver.py false
62+
63+
64+

examples/01_Visualization/05_visual_lease_boundaries.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import matplotlib.pyplot as plt
1212

1313
# define name of ontology input file
14-
input_file = '06_visual_lease_boundaries.yaml'
14+
input_file = '05_visual_lease_boundaries.yaml'
1515

1616
# initialize Project class with input file, we don't need RAFT for this so mark False
1717
project = Project(file=input_file,raft=False)

examples/01_Visualization/07_3D-visual_platform.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import matplotlib.pyplot as plt
1010

1111
# define name of ontology input file
12-
input_file = '07_3D-visual_platform.yaml'
12+
input_file = 'examples/01_Visualization/07_3D-visual_platform.yaml'
1313

1414
# initialize Project class with input file, we don't need RAFT for this so mark False
1515
project = Project(file=input_file,raft=True)

examples/01_Visualization/07_3D-visual_platform.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ platform:
3939
rB : [ 0, 0, 15] # [m] and B coordinates
4040
shape : circ # [-] circular or rectangular
4141
gamma : 0.0 # [deg] twist angle about the member's z-axis
42-
potMod : True # [bool] Whether to model the member with potential flow (BEM model) plus viscous drag or purely strip theory
42+
potMod : False # [bool] Whether to model the member with potential flow (BEM model) plus viscous drag or purely strip theory
4343
# --- outer shell including hydro---
4444
stations : [0, 1] # [-] location of stations along axis. Will be normalized such that start value maps to rA and end value to rB
4545
d : 10.0 # [m] diameters if circular or side lengths if rectangular (can be pairs)
@@ -62,7 +62,7 @@ platform:
6262
heading : [ 60, 180, 300] # [deg] heading rotation of column about z axis (for repeated members)
6363
shape : circ # [-] circular or rectangular
6464
gamma : 0.0 # [deg] twist angle about the member's z-axis
65-
potMod : True # [bool] Whether to model the member with potential flow (BEM model) plus viscous drag or purely strip theory
65+
potMod : False # [bool] Whether to model the member with potential flow (BEM model) plus viscous drag or purely strip theory
6666
# --- outer shell including hydro---
6767
stations : [0, 35] # [-] location of stations along axis. Will be normalized such that start value maps to rA and end value to rB
6868
d : 12.5 # [m] diameters if circular or side lengths if rectangular (can be pairs)

examples/01_Visualization/08_3D-visual_turbine.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,7 +1090,7 @@ platform:
10901090
rB : [ 0, 0, 15] # [m] and B coordinates
10911091
shape : circ # [-] circular or rectangular
10921092
gamma : 0.0 # [deg] twist angle about the member's z-axis
1093-
potMod : True # [bool] Whether to model the member with potential flow (BEM model) plus viscous drag or purely strip theory
1093+
potMod : False # [bool] Whether to model the member with potential flow (BEM model) plus viscous drag or purely strip theory
10941094
# --- outer shell including hydro---
10951095
stations : [0, 1] # [-] location of stations along axis. Will be normalized such that start value maps to rA and end value to rB
10961096
d : 10.0 # [m] diameters if circular or side lengths if rectangular (can be pairs)
@@ -1113,7 +1113,7 @@ platform:
11131113
heading : [ 60, 180, 300] # [deg] heading rotation of column about z axis (for repeated members)
11141114
shape : circ # [-] circular or rectangular
11151115
gamma : 0.0 # [deg] twist angle about the member's z-axis
1116-
potMod : True # [bool] Whether to model the member with potential flow (BEM model) plus viscous drag or purely strip theory
1116+
potMod : False # [bool] Whether to model the member with potential flow (BEM model) plus viscous drag or purely strip theory
11171117
# --- outer shell including hydro---
11181118
stations : [0, 35] # [-] location of stations along axis. Will be normalized such that start value maps to rA and end value to rB
11191119
d : 12.5 # [m] diameters if circular or side lengths if rectangular (can be pairs)

examples/03_Frequency_Domain_Analysis_RAFT/01_platform.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ platform:
2727
rB : [ 0, 0, 15] # [m] and B coordinates
2828
shape : circ # [-] circular or rectangular
2929
gamma : 0.0 # [deg] twist angle about the member's z-axis
30-
potMod : True # [bool] Whether to model the member with potential flow (BEM model) plus viscous drag or purely strip theory
30+
potMod : False # [bool] Whether to model the member with potential flow (BEM model) plus viscous drag or purely strip theory
3131
# --- outer shell including hydro---
3232
stations : [0, 1] # [-] location of stations along axis. Will be normalized such that start value maps to rA and end value to rB
3333
d : 10.0 # [m] diameters if circular or side lengths if rectangular (can be pairs)
@@ -50,7 +50,7 @@ platform:
5050
heading : [ 60, 180, 300] # [deg] heading rotation of column about z axis (for repeated members)
5151
shape : circ # [-] circular or rectangular
5252
gamma : 0.0 # [deg] twist angle about the member's z-axis
53-
potMod : True # [bool] Whether to model the member with potential flow (BEM model) plus viscous drag or purely strip theory
53+
potMod : False # [bool] Whether to model the member with potential flow (BEM model) plus viscous drag or purely strip theory
5454
# --- outer shell including hydro---
5555
stations : [0, 35] # [-] location of stations along axis. Will be normalized such that start value maps to rA and end value to rB
5656
d : 12.5 # [m] diameters if circular or side lengths if rectangular (can be pairs)

examples/03_Frequency_Domain_Analysis_RAFT/02_FOWT.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,7 +1082,7 @@ platform:
10821082
rB : [ 0, 0, 15] # [m] and B coordinates
10831083
shape : circ # [-] circular or rectangular
10841084
gamma : 0.0 # [deg] twist angle about the member's z-axis
1085-
potMod : True # [bool] Whether to model the member with potential flow (BEM model) plus viscous drag or purely strip theory
1085+
potMod : False # [bool] Whether to model the member with potential flow (BEM model) plus viscous drag or purely strip theory
10861086
# --- outer shell including hydro---
10871087
stations : [0, 1] # [-] location of stations along axis. Will be normalized such that start value maps to rA and end value to rB
10881088
d : 10.0 # [m] diameters if circular or side lengths if rectangular (can be pairs)
@@ -1105,7 +1105,7 @@ platform:
11051105
heading : [ 60, 180, 300] # [deg] heading rotation of column about z axis (for repeated members)
11061106
shape : circ # [-] circular or rectangular
11071107
gamma : 0.0 # [deg] twist angle about the member's z-axis
1108-
potMod : True # [bool] Whether to model the member with potential flow (BEM model) plus viscous drag or purely strip theory
1108+
potMod : False # [bool] Whether to model the member with potential flow (BEM model) plus viscous drag or purely strip theory
11091109
# --- outer shell including hydro---
11101110
stations : [0, 35] # [-] location of stations along axis. Will be normalized such that start value maps to rA and end value to rB
11111111
d : 12.5 # [m] diameters if circular or side lengths if rectangular (can be pairs)
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
2+
from famodel.anchors.anchor import Anchor
3+
4+
# --- Define soil profile ---
5+
profile_map = [
6+
{
7+
'name': 'CPT_D1',
8+
'x': 0.0, 'y': 0.0,
9+
'layers': [
10+
{'top': 1.5, 'bottom': 5.0, 'soil_type': 'rock', 'UCS_top': 6.0, 'UCS_bot': 8.0, 'Em_top': 175, 'Em_bot': 290},
11+
{'top': 5.0, 'bottom': 9.0, 'soil_type': 'rock', 'UCS_top': 8.0, 'UCS_bot': 10.7, 'Em_top': 277, 'Em_bot': 297},
12+
{'top': 9.0, 'bottom': 30.0, 'soil_type': 'rock', 'UCS_top': 8.0, 'UCS_bot': 10.5, 'Em_top': 280, 'Em_bot': 305}
13+
]
14+
}
15+
]
16+
17+
# --- Create driven pile anchor ---
18+
anchor = Anchor(
19+
dd = {
20+
'type': 'dandg',
21+
'design': {
22+
'L': 10.0, # Embedded length
23+
'D': 2.85, # Diameter
24+
'zlug': 1.0 # Padeye depth
25+
}
26+
},
27+
r = [0.0, 0.0, 0.0]
28+
)
29+
30+
# Assign mooring loads
31+
anchor.loads = {
32+
'Hm': 5.0e6,
33+
'Vm': 2.5e5
34+
}
35+
anchor.line_type = 'chain'
36+
anchor.d = 0.16
37+
anchor.w = 5000.0
38+
39+
# Assign local soil
40+
anchor.setSoilProfile(profile_map)
41+
42+
# --- Step 1: Capacity ---
43+
anchor.getCapacityAnchor(
44+
Hm = anchor.loads['Hm'],
45+
Vm = anchor.loads['Vm'],
46+
zlug = anchor.dd['design']['zlug'],
47+
line_type = anchor.line_type,
48+
d = anchor.d,
49+
w = anchor.w,
50+
plot = True)
51+
52+
print('\nCapacity Results:')
53+
for key, val in anchor.anchorCapacity.items():
54+
print(f'{key}: {val:.2f}')
55+
56+
# --- Step 2: Optimize Anchor Geometry ---
57+
anchor.getSizeAnchor(
58+
geom = [anchor.dd['design']['L'], anchor.dd['design']['D']],
59+
geomKeys = ['L', 'D'],
60+
geomBounds = [(2.0, 70.0), (0.25, 3.0)],
61+
loads = None,
62+
lambdap_con = [4, 50],
63+
zlug_fix = True,
64+
safety_factor = {'SF_horizontal': 1, 'SF_vertical': 1},
65+
plot = True)
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
2+
from famodel.anchors.anchor import Anchor
3+
4+
# --- Define soil profile ---
5+
profile_map = [
6+
{
7+
'name': 'CPT_D1',
8+
'x': 0.0, 'y': 0.0,
9+
'layers': [
10+
{'top': 1.5, 'bottom': 6.0, 'soil_type': 'rock', 'UCS_top': 5.0, 'UCS_bot': 5.0, 'Em_top': 7, 'Em_bot': 7},
11+
{'top': 6.0, 'bottom': 15.0, 'soil_type': 'rock', 'UCS_top': 6.0, 'UCS_bot': 6.7, 'Em_top': 7, 'Em_bot': 7},
12+
{'top': 15.0, 'bottom': 35.0, 'soil_type': 'rock', 'UCS_top': 10.0, 'UCS_bot': 10.5, 'Em_top': 7, 'Em_bot': 7}
13+
]
14+
}
15+
]
16+
17+
# --- Create driven pile anchor ---
18+
anchor = Anchor(
19+
dd = {
20+
'type': 'driven',
21+
'design': {
22+
'L': 15.0, # Embedded length
23+
'D': 1.85, # Diameter
24+
'zlug': 1.5 # Padeye depth
25+
}
26+
},
27+
r = [0.0, 0.0, 0.0]
28+
)
29+
30+
# Assign mooring loads
31+
anchor.loads = {
32+
'Hm': 2.5e6,
33+
'Vm': 2.5e5}
34+
35+
anchor.line_type = 'chain'
36+
anchor.d = 0.16
37+
anchor.w = 5000.0
38+
39+
# Assign local soil
40+
anchor.setSoilProfile(profile_map)
41+
42+
# --- Step 1: Capacity ---
43+
anchor.getCapacityAnchor(
44+
Hm = anchor.loads['Hm'],
45+
Vm = anchor.loads['Vm'],
46+
zlug = anchor.dd['design']['zlug'],
47+
line_type = anchor.line_type,
48+
d = anchor.d,
49+
w = anchor.w,
50+
plot = True)
51+
52+
print('\nCapacity Results:')
53+
for key, val in anchor.anchorCapacity.items():
54+
print(f'{key}: {val:.2f}')
55+
56+
# --- Step 2: Optimize Anchor Geometry ---
57+
anchor.getSizeAnchor(
58+
geom = [anchor.dd['design']['L'], anchor.dd['design']['D']],
59+
geomKeys = ['L', 'D'],
60+
geomBounds = [(2.0, 70.0), (0.25, 3.0)],
61+
loads = None,
62+
lambdap_con = [4, 50],
63+
zlug_fix = True,
64+
safety_factor = {'SF_horizontal': 1, 'SF_vertical': 1},
65+
plot = True)
Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11

2-
from anchor_map import Anchor
2+
from famodel.anchors.anchor import Anchor
33

44
# --- Define soil profile ---
55
profile_map = [
66
{
77
'name': 'CPT_D1',
88
'x': 0.0, 'y': 0.0,
99
'layers': [
10-
{'top': 1.0, 'bottom': 6.0, 'soil_type': 'clay', 'gamma_top': 9.0, 'gamma_bot': 10.0, 'Su_top': 45, 'Su_bot': 60},
11-
{'top': 6.0, 'bottom': 15.0, 'soil_type': 'clay', 'gamma_top': 10.0, 'gamma_bot': 10.0, 'Su_top': 60, 'Su_bot': 80},
12-
{'top': 15.0, 'bottom': 35.0, 'soil_type': 'clay', 'gamma_top': 10.0, 'gamma_bot': 10.5, 'Su_top': 80, 'Su_bot': 100}
10+
{'top': 1.5, 'bottom': 6.0, 'soil_type': 'clay', 'gamma_top': 9.0, 'gamma_bot': 10.0, 'Su_top': 25, 'Su_bot': 200},
11+
{'top': 6.0, 'bottom': 15.0, 'soil_type': 'sand', 'gamma_top': 10.0, 'gamma_bot': 10.0, 'phi_top': 28, 'phi_bot': 32, 'Dr_top': 80, 'Dr_bot': 85},
12+
{'top': 15.0, 'bottom': 35.0, 'soil_type': 'clay', 'gamma_top': 10.0, 'gamma_bot': 10.5, 'Su_top': 100, 'Su_bot': 100}
1313
]
1414
}
1515
]
@@ -20,18 +20,18 @@
2020
'type': 'driven',
2121
'design': {
2222
'L': 25.0, # Embedded length
23-
'D': 2.0, # Diameter
24-
'zlug': 10.0 # Padeye depth
23+
'D': 4.25, # Diameter
24+
'zlug': 3.0 # Padeye depth
2525
}
2626
},
2727
r = [0.0, 0.0, 0.0]
2828
)
2929

3030
# Assign mooring loads
3131
anchor.loads = {
32-
'Hm': 4.0e6,
33-
'Vm': 2.5e6
34-
}
32+
'Hm': 2.0e6,
33+
'Vm': 2.5e5}
34+
3535
anchor.line_type = 'chain'
3636
anchor.d = 0.16
3737
anchor.w = 5000.0
@@ -47,8 +47,7 @@
4747
line_type = anchor.line_type,
4848
d = anchor.d,
4949
w = anchor.w,
50-
plot = True
51-
)
50+
plot = True)
5251

5352
print('\nLug Forces Computed:')
5453
print(f'Ha = {Ha:.2f} N')
@@ -62,9 +61,19 @@
6261
line_type = anchor.line_type,
6362
d = anchor.d,
6463
w = anchor.w,
65-
plot = True
66-
)
64+
plot = True)
6765

6866
print('\nCapacity Results:')
69-
for key, val in anchor.capacity_results.items():
67+
for key, val in anchor.anchorCapacity.items():
7068
print(f'{key}: {val:.2f}')
69+
70+
# --- Step 3: Optimize Anchor Geometry ---
71+
anchor.getSizeAnchor(
72+
geom = [anchor.dd['design']['L'], anchor.dd['design']['D']],
73+
geomKeys = ['L', 'D'],
74+
geomBounds = [(2.0, 70.0), (0.25, 3.0)],
75+
loads = None,
76+
lambdap_con = [4, 50],
77+
zlug_fix = True,
78+
safety_factor = {'SF_horizontal': 1, 'SF_vertical': 1},
79+
plot = True)

0 commit comments

Comments
 (0)