Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions .github/workflows/CI_FAModel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,16 @@ jobs:
- name: Overwrite MoorPy
run: |
pip install git+https://github.com/NREL/MoorPy@dev

- name: Example run
run: |
cd examples
python example_driver.py false


- name: Test run
run: |
cd tests
pytest .

# - name: Example run
# run: |
# cd examples
# python example_driver.py false



2 changes: 1 addition & 1 deletion examples/01_Visualization/05_visual_lease_boundaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import matplotlib.pyplot as plt

# define name of ontology input file
input_file = '06_visual_lease_boundaries.yaml'
input_file = '05_visual_lease_boundaries.yaml'

# initialize Project class with input file, we don't need RAFT for this so mark False
project = Project(file=input_file,raft=False)
Expand Down
2 changes: 1 addition & 1 deletion examples/01_Visualization/07_3D-visual_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import matplotlib.pyplot as plt

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

# initialize Project class with input file, we don't need RAFT for this so mark False
project = Project(file=input_file,raft=True)
Expand Down
4 changes: 2 additions & 2 deletions examples/01_Visualization/07_3D-visual_platform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ platform:
rB : [ 0, 0, 15] # [m] and B coordinates
shape : circ # [-] circular or rectangular
gamma : 0.0 # [deg] twist angle about the member's z-axis
potMod : True # [bool] Whether to model the member with potential flow (BEM model) plus viscous drag or purely strip theory
potMod : False # [bool] Whether to model the member with potential flow (BEM model) plus viscous drag or purely strip theory
# --- outer shell including hydro---
stations : [0, 1] # [-] location of stations along axis. Will be normalized such that start value maps to rA and end value to rB
d : 10.0 # [m] diameters if circular or side lengths if rectangular (can be pairs)
Expand All @@ -62,7 +62,7 @@ platform:
heading : [ 60, 180, 300] # [deg] heading rotation of column about z axis (for repeated members)
shape : circ # [-] circular or rectangular
gamma : 0.0 # [deg] twist angle about the member's z-axis
potMod : True # [bool] Whether to model the member with potential flow (BEM model) plus viscous drag or purely strip theory
potMod : False # [bool] Whether to model the member with potential flow (BEM model) plus viscous drag or purely strip theory
# --- outer shell including hydro---
stations : [0, 35] # [-] location of stations along axis. Will be normalized such that start value maps to rA and end value to rB
d : 12.5 # [m] diameters if circular or side lengths if rectangular (can be pairs)
Expand Down
4 changes: 2 additions & 2 deletions examples/01_Visualization/08_3D-visual_turbine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1090,7 +1090,7 @@ platform:
rB : [ 0, 0, 15] # [m] and B coordinates
shape : circ # [-] circular or rectangular
gamma : 0.0 # [deg] twist angle about the member's z-axis
potMod : True # [bool] Whether to model the member with potential flow (BEM model) plus viscous drag or purely strip theory
potMod : False # [bool] Whether to model the member with potential flow (BEM model) plus viscous drag or purely strip theory
# --- outer shell including hydro---
stations : [0, 1] # [-] location of stations along axis. Will be normalized such that start value maps to rA and end value to rB
d : 10.0 # [m] diameters if circular or side lengths if rectangular (can be pairs)
Expand All @@ -1113,7 +1113,7 @@ platform:
heading : [ 60, 180, 300] # [deg] heading rotation of column about z axis (for repeated members)
shape : circ # [-] circular or rectangular
gamma : 0.0 # [deg] twist angle about the member's z-axis
potMod : True # [bool] Whether to model the member with potential flow (BEM model) plus viscous drag or purely strip theory
potMod : False # [bool] Whether to model the member with potential flow (BEM model) plus viscous drag or purely strip theory
# --- outer shell including hydro---
stations : [0, 35] # [-] location of stations along axis. Will be normalized such that start value maps to rA and end value to rB
d : 12.5 # [m] diameters if circular or side lengths if rectangular (can be pairs)
Expand Down
4 changes: 2 additions & 2 deletions examples/03_Frequency_Domain_Analysis_RAFT/01_platform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ platform:
rB : [ 0, 0, 15] # [m] and B coordinates
shape : circ # [-] circular or rectangular
gamma : 0.0 # [deg] twist angle about the member's z-axis
potMod : True # [bool] Whether to model the member with potential flow (BEM model) plus viscous drag or purely strip theory
potMod : False # [bool] Whether to model the member with potential flow (BEM model) plus viscous drag or purely strip theory
# --- outer shell including hydro---
stations : [0, 1] # [-] location of stations along axis. Will be normalized such that start value maps to rA and end value to rB
d : 10.0 # [m] diameters if circular or side lengths if rectangular (can be pairs)
Expand All @@ -50,7 +50,7 @@ platform:
heading : [ 60, 180, 300] # [deg] heading rotation of column about z axis (for repeated members)
shape : circ # [-] circular or rectangular
gamma : 0.0 # [deg] twist angle about the member's z-axis
potMod : True # [bool] Whether to model the member with potential flow (BEM model) plus viscous drag or purely strip theory
potMod : False # [bool] Whether to model the member with potential flow (BEM model) plus viscous drag or purely strip theory
# --- outer shell including hydro---
stations : [0, 35] # [-] location of stations along axis. Will be normalized such that start value maps to rA and end value to rB
d : 12.5 # [m] diameters if circular or side lengths if rectangular (can be pairs)
Expand Down
4 changes: 2 additions & 2 deletions examples/03_Frequency_Domain_Analysis_RAFT/02_FOWT.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1082,7 +1082,7 @@ platform:
rB : [ 0, 0, 15] # [m] and B coordinates
shape : circ # [-] circular or rectangular
gamma : 0.0 # [deg] twist angle about the member's z-axis
potMod : True # [bool] Whether to model the member with potential flow (BEM model) plus viscous drag or purely strip theory
potMod : False # [bool] Whether to model the member with potential flow (BEM model) plus viscous drag or purely strip theory
# --- outer shell including hydro---
stations : [0, 1] # [-] location of stations along axis. Will be normalized such that start value maps to rA and end value to rB
d : 10.0 # [m] diameters if circular or side lengths if rectangular (can be pairs)
Expand All @@ -1105,7 +1105,7 @@ platform:
heading : [ 60, 180, 300] # [deg] heading rotation of column about z axis (for repeated members)
shape : circ # [-] circular or rectangular
gamma : 0.0 # [deg] twist angle about the member's z-axis
potMod : True # [bool] Whether to model the member with potential flow (BEM model) plus viscous drag or purely strip theory
potMod : False # [bool] Whether to model the member with potential flow (BEM model) plus viscous drag or purely strip theory
# --- outer shell including hydro---
stations : [0, 35] # [-] location of stations along axis. Will be normalized such that start value maps to rA and end value to rB
d : 12.5 # [m] diameters if circular or side lengths if rectangular (can be pairs)
Expand Down
65 changes: 65 additions & 0 deletions examples/05_Anchors/anchor_dandg.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@

from famodel.anchors.anchor import Anchor

# --- Define soil profile ---
profile_map = [
{
'name': 'CPT_D1',
'x': 0.0, 'y': 0.0,
'layers': [
{'top': 1.5, 'bottom': 5.0, 'soil_type': 'rock', 'UCS_top': 6.0, 'UCS_bot': 8.0, 'Em_top': 175, 'Em_bot': 290},
{'top': 5.0, 'bottom': 9.0, 'soil_type': 'rock', 'UCS_top': 8.0, 'UCS_bot': 10.7, 'Em_top': 277, 'Em_bot': 297},
{'top': 9.0, 'bottom': 30.0, 'soil_type': 'rock', 'UCS_top': 8.0, 'UCS_bot': 10.5, 'Em_top': 280, 'Em_bot': 305}
]
}
]

# --- Create driven pile anchor ---
anchor = Anchor(
dd = {
'type': 'dandg',
'design': {
'L': 10.0, # Embedded length
'D': 2.85, # Diameter
'zlug': 1.0 # Padeye depth
}
},
r = [0.0, 0.0, 0.0]
)

# Assign mooring loads
anchor.loads = {
'Hm': 5.0e6,
'Vm': 2.5e5
}
anchor.line_type = 'chain'
anchor.d = 0.16
anchor.w = 5000.0

# Assign local soil
anchor.setSoilProfile(profile_map)

# --- Step 1: Capacity ---
anchor.getCapacityAnchor(
Hm = anchor.loads['Hm'],
Vm = anchor.loads['Vm'],
zlug = anchor.dd['design']['zlug'],
line_type = anchor.line_type,
d = anchor.d,
w = anchor.w,
plot = True)

print('\nCapacity Results:')
for key, val in anchor.anchorCapacity.items():
print(f'{key}: {val:.2f}')

# --- Step 2: Optimize Anchor Geometry ---
anchor.getSizeAnchor(
geom = [anchor.dd['design']['L'], anchor.dd['design']['D']],
geomKeys = ['L', 'D'],
geomBounds = [(2.0, 70.0), (0.25, 3.0)],
loads = None,
lambdap_con = [4, 50],
zlug_fix = True,
safety_factor = {'SF_horizontal': 1, 'SF_vertical': 1},
plot = True)
65 changes: 65 additions & 0 deletions examples/05_Anchors/anchor_driven_rock.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@

from famodel.anchors.anchor import Anchor

# --- Define soil profile ---
profile_map = [
{
'name': 'CPT_D1',
'x': 0.0, 'y': 0.0,
'layers': [
{'top': 1.5, 'bottom': 6.0, 'soil_type': 'rock', 'UCS_top': 5.0, 'UCS_bot': 5.0, 'Em_top': 7, 'Em_bot': 7},
{'top': 6.0, 'bottom': 15.0, 'soil_type': 'rock', 'UCS_top': 6.0, 'UCS_bot': 6.7, 'Em_top': 7, 'Em_bot': 7},
{'top': 15.0, 'bottom': 35.0, 'soil_type': 'rock', 'UCS_top': 10.0, 'UCS_bot': 10.5, 'Em_top': 7, 'Em_bot': 7}
]
}
]

# --- Create driven pile anchor ---
anchor = Anchor(
dd = {
'type': 'driven',
'design': {
'L': 15.0, # Embedded length
'D': 1.85, # Diameter
'zlug': 1.5 # Padeye depth
}
},
r = [0.0, 0.0, 0.0]
)

# Assign mooring loads
anchor.loads = {
'Hm': 2.5e6,
'Vm': 2.5e5}

anchor.line_type = 'chain'
anchor.d = 0.16
anchor.w = 5000.0

# Assign local soil
anchor.setSoilProfile(profile_map)

# --- Step 1: Capacity ---
anchor.getCapacityAnchor(
Hm = anchor.loads['Hm'],
Vm = anchor.loads['Vm'],
zlug = anchor.dd['design']['zlug'],
line_type = anchor.line_type,
d = anchor.d,
w = anchor.w,
plot = True)

print('\nCapacity Results:')
for key, val in anchor.anchorCapacity.items():
print(f'{key}: {val:.2f}')

# --- Step 2: Optimize Anchor Geometry ---
anchor.getSizeAnchor(
geom = [anchor.dd['design']['L'], anchor.dd['design']['D']],
geomKeys = ['L', 'D'],
geomBounds = [(2.0, 70.0), (0.25, 3.0)],
loads = None,
lambdap_con = [4, 50],
zlug_fix = True,
safety_factor = {'SF_horizontal': 1, 'SF_vertical': 1},
plot = True)
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@

from anchor_map import Anchor
from famodel.anchors.anchor import Anchor

# --- Define soil profile ---
profile_map = [
{
'name': 'CPT_D1',
'x': 0.0, 'y': 0.0,
'layers': [
{'top': 1.0, 'bottom': 6.0, 'soil_type': 'clay', 'gamma_top': 9.0, 'gamma_bot': 10.0, 'Su_top': 45, 'Su_bot': 60},
{'top': 6.0, 'bottom': 15.0, 'soil_type': 'clay', 'gamma_top': 10.0, 'gamma_bot': 10.0, 'Su_top': 60, 'Su_bot': 80},
{'top': 15.0, 'bottom': 35.0, 'soil_type': 'clay', 'gamma_top': 10.0, 'gamma_bot': 10.5, 'Su_top': 80, 'Su_bot': 100}
{'top': 1.5, 'bottom': 6.0, 'soil_type': 'clay', 'gamma_top': 9.0, 'gamma_bot': 10.0, 'Su_top': 25, 'Su_bot': 200},
{'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},
{'top': 15.0, 'bottom': 35.0, 'soil_type': 'clay', 'gamma_top': 10.0, 'gamma_bot': 10.5, 'Su_top': 100, 'Su_bot': 100}
]
}
]
Expand All @@ -20,18 +20,18 @@
'type': 'driven',
'design': {
'L': 25.0, # Embedded length
'D': 2.0, # Diameter
'zlug': 10.0 # Padeye depth
'D': 4.25, # Diameter
'zlug': 3.0 # Padeye depth
}
},
r = [0.0, 0.0, 0.0]
)

# Assign mooring loads
anchor.loads = {
'Hm': 4.0e6,
'Vm': 2.5e6
}
'Hm': 2.0e6,
'Vm': 2.5e5}

anchor.line_type = 'chain'
anchor.d = 0.16
anchor.w = 5000.0
Expand All @@ -47,8 +47,7 @@
line_type = anchor.line_type,
d = anchor.d,
w = anchor.w,
plot = True
)
plot = True)

print('\nLug Forces Computed:')
print(f'Ha = {Ha:.2f} N')
Expand All @@ -62,9 +61,19 @@
line_type = anchor.line_type,
d = anchor.d,
w = anchor.w,
plot = True
)
plot = True)

print('\nCapacity Results:')
for key, val in anchor.capacity_results.items():
for key, val in anchor.anchorCapacity.items():
print(f'{key}: {val:.2f}')

# --- Step 3: Optimize Anchor Geometry ---
anchor.getSizeAnchor(
geom = [anchor.dd['design']['L'], anchor.dd['design']['D']],
geomKeys = ['L', 'D'],
geomBounds = [(2.0, 70.0), (0.25, 3.0)],
loads = None,
lambdap_con = [4, 50],
zlug_fix = True,
safety_factor = {'SF_horizontal': 1, 'SF_vertical': 1},
plot = True)
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@

from anchor_map import Anchor
from famodel.anchors.anchor import Anchor

# --- Soil profile for helical pile in clay ---
profile_map = [
{
'name': 'CPT_H1',
'x': 0.0, 'y': 0.0,
'layers': [
{'top': 1.0, 'bottom': 3.0, 'soil_type': 'clay', 'gamma_top': 8.0, 'gamma_bot': 9.0, 'Su_top': 60, 'Su_bot': 50},
{'top': 3.0, 'bottom': 7.0, 'soil_type': 'clay', 'gamma_top': 15.0, 'gamma_bot': 25.0, 'Su_top': 100, 'Su_bot': 150},
{'top': 7.0, 'bottom': 15.0, 'soil_type': 'clay', 'gamma_top': 25.0, 'gamma_bot': 50.0, 'Su_top': 200, 'Su_bot': 400}
{'top': 1.0, 'bottom': 3.0, 'soil_type': 'clay', 'gamma_top': 8.0, 'gamma_bot': 9.0, 'Su_top': 60, 'Su_bot': 50},
{'top': 3.0, 'bottom': 7.0, 'soil_type': 'clay', 'gamma_top': 15.0, 'gamma_bot': 25.0, 'Su_top': 100, 'Su_bot': 150},
{'top': 7.0, 'bottom': 25.0, 'soil_type': 'clay', 'gamma_top': 25.0, 'gamma_bot': 50.0, 'Su_top': 200, 'Su_bot': 400}
]
}
]
Expand All @@ -31,8 +31,8 @@
# --- Assign mooring loads and properties ---
anchor.loads = {
'Hm': 80e4,
'Vm': 50e3
}
'Vm': 50e5}

anchor.line_type = 'chain'
anchor.d = 0.16
anchor.w = 5000.0
Expand Down Expand Up @@ -63,9 +63,21 @@
line_type = anchor.line_type,
d = anchor.d,
w = anchor.w,
plot = True
plot = False
)

print('\nCapacity Results:')
for key, val in anchor.capacity_results.items():
for key, val in anchor.anchorCapacity.items():
print(f'{key}: {val:.2f}')

# --- Step 3: Optimize Anchor Geometry ---
anchor.getSizeAnchor(
geom = [anchor.dd['design']['L'], anchor.dd['design']['D']],
geomKeys = ['L', 'D'],
geomBounds = [(6.0, 25.0), (0.5, 2.0)],
loads = None,
lambdap_con = [6, 15],
zlug_fix = True,
safety_factor = {'SF_horizontal': 1, 'SF_vertical': 1},
plot = False
)
Loading
Loading