Skip to content

Commit dd22138

Browse files
author
Moreno
committed
Change anchor label from 'dandg' to 'drilled'
1 parent 38ba6b7 commit dd22138

File tree

4 files changed

+255
-257
lines changed

4 files changed

+255
-257
lines changed
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,14 @@
1717
# --- Create driven pile anchor ---
1818
anchor = Anchor(
1919
dd = {
20-
'type': 'dandg',
20+
'type': 'drilled',
2121
'design': {
2222
'L': 10.0, # Embedded length
2323
'D': 2.85, # Diameter
2424
'zlug': 1.0 # Padeye depth
2525
}
2626
},
27-
r = [0.0, 0.0, 0.0]
28-
)
27+
r = [0.0, 0.0, 0.0])
2928

3029
# Assign mooring loads
3130
anchor.loads = {

famodel/anchors/anchor.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def __init__(self, dd=None, ms=None, r=[0,0,0], aNum=None, id=None,
5555
print(f"[Anchor] No type provided. Defaulting to 'suction'.")
5656

5757
# raise errors/warnings if the anchor type is not what it needs to be
58-
anchor_type_options = ['suction', 'sepla', 'dea', 'depla', 'vla', 'plate', 'torpedo', 'helical', 'driven', 'dandg']
58+
anchor_type_options = ['suction', 'sepla', 'dea', 'depla', 'vla', 'plate', 'torpedo', 'helical', 'driven', 'drilled']
5959
if self.anchType not in anchor_type_options:
6060
raise ValueError(f"The anchor 'type' needs to explicitly be one of {anchor_type_options} (Case not sensitive)")
6161
# if self.anchType not in ['drag-embedment', 'gravity', 'suction', 'SEPLA', 'VLA', 'driven']:
@@ -466,7 +466,7 @@ def getCapacityAnchor(self, Hm, Vm, zlug, line_type=None, d=None, w=None, mass_u
466466
from .anchors_famodel.capacity_torpedo import getCapacityTorpedo
467467
from .anchors_famodel.capacity_helical import getCapacityHelical
468468
from .anchors_famodel.capacity_driven import getCapacityDriven
469-
from .anchors_famodel.capacity_dandg import getCapacityDandG
469+
from .anchors_famodel.capacity_drilled import getCapacityDrilled
470470

471471
capacity_dispatch = {
472472
'suction': getCapacitySuction,
@@ -478,7 +478,7 @@ def getCapacityAnchor(self, Hm, Vm, zlug, line_type=None, d=None, w=None, mass_u
478478
'torpedo': getCapacityTorpedo,
479479
'helical': getCapacityHelical,
480480
'driven': getCapacityDriven,
481-
'dandg': getCapacityDandG}
481+
'drilled': getCapacityDrilled}
482482

483483
if self.display > 0: print('[DEBUG] profile_name:', self.profile_name)
484484
if self.display > 0: print('[DEBUG] soil_profile passed as profile_map:')
@@ -608,7 +608,7 @@ def getCapacityAnchor(self, Hm, Vm, zlug, line_type=None, d=None, w=None, mass_u
608608
Ha=Ha, Va=Va,
609609
plot=plot, display=display)
610610

611-
elif anchType_clean == 'dandg':
611+
elif anchType_clean == 'drilled':
612612
self.capacity_format = 'component'
613613
L = self.dd['design']['L']
614614
D = self.dd['design']['D']
@@ -636,7 +636,7 @@ def getCapacityAnchor(self, Hm, Vm, zlug, line_type=None, d=None, w=None, mass_u
636636
if anchType_clean in ['suction', 'torpedo', 'plate', 'sepla', 'dea', 'depla', 'vla']:
637637
self.anchorCapacity['UC'] = results.get('Unity check', np.nan)
638638

639-
elif anchType_clean in ['helical', 'driven', 'dandg']:
639+
elif anchType_clean in ['helical', 'driven', 'drilled']:
640640
self.anchorCapacity['Unity check (horizontal)'] = results.get('Unity check (horizontal)', np.nan)
641641
self.anchorCapacity['Unity check (vertical)'] = results.get('Unity check (vertical)', np.nan)
642642

@@ -693,7 +693,7 @@ def update_zlug():
693693
ratio = self.dd['design'].get('zlug_ratio', self.dd['design']['zlug']/self.dd['design']['L'])
694694
self.dd['design']['zlug_ratio'] = ratio
695695
self.dd['design']['zlug'] = ratio*self.dd['design']['L']
696-
elif 'dandg' in anchType_clean:
696+
elif 'drilled' in anchType_clean:
697697
self.dd['design']['zlug'] = 0
698698

699699
def get_lambda():
@@ -702,7 +702,7 @@ def get_lambda():
702702
A_wing = (self.dd['design']['D1'] - self.dd['design']['D2']) * self.dd['design']['L1']
703703
A_shaft = self.dd['design']['D2'] * L
704704
D = (A_wing + A_shaft) / L
705-
elif np.any([name in anchType_clean for name in ['driven', 'dandg', 'helical', 'suction']]):
705+
elif np.any([name in anchType_clean for name in ['driven', 'drilled', 'helical', 'suction']]):
706706
L = self.dd['design']['L']
707707
D = self.dd['design']['D']
708708
elif np.any([name in anchType_clean for name in ['plate', 'sepla', 'dea', 'depla', 'vla']]):
@@ -812,7 +812,7 @@ def termination_condition():
812812
return 'continue'
813813
return 'continue'
814814

815-
def termination_condition_dandg():
815+
def termination_condition_drilled():
816816
UC_v = self.anchorCapacity['Va']/self.anchorCapacity['Vmax']
817817
disp_lat = abs(self.anchorCapacity.get('Lateral displacement', 0.0))
818818
disp_rot = abs(self.anchorCapacity.get('Rotational displacement', 0.0))
@@ -912,7 +912,7 @@ def is_valid(value):
912912

913913
if self.display > 0: print('[Warning] While-loop search reached bounds without meeting criteria.')
914914

915-
if 'dandg' in anchType_clean:
915+
if 'drilled' in anchType_clean:
916916
L0, D0 = geom if len(geom) == 2 else [5.0, 1.0]
917917
self.dd['design']['L'] = L0
918918
self.dd['design']['D'] = D0
@@ -949,7 +949,7 @@ def is_valid(value):
949949
iter_count += 1
950950
if not all(is_valid(v) for v in [UC_v, disp_lat, disp_rot]):
951951
continue
952-
if termination_condition_dandg():
952+
if termination_condition_drilled():
953953
print(f'\nTermination criteria met.')
954954
print('Design:', self.dd['design'])
955955
print('Capacity Results:', self.anchorCapacity)
@@ -969,15 +969,15 @@ def is_valid(value):
969969
disp_rot = abs(self.anchorCapacity.get('Rotational displacement', 0.0))
970970
if self.display > 0: print(f'[Iter {iter_count}] L={L:.2f}, D={D:.2f}, UC_v={UC_v:.3f}, lat={disp_lat:.3f} m, rot={disp_rot:.3f} deg')
971971
iter_count += 1
972-
status = termination_condition_dandg()
972+
status = termination_condition_drilled()
973973
if status == 'terminate':
974974
print(f'Termination criteria met.')
975975
print('Design:', self.dd['design'])
976976
print('Capacity Results:', self.anchorCapacity)
977977
return
978978
elif status == 'continue':
979979
continue
980-
status = termination_condition_dandg()
980+
status = termination_condition_drilled()
981981
if status == 'terminate':
982982
print(f'\nTermination criteria met.')
983983
print('Design:', self.dd['design'])
@@ -1339,7 +1339,7 @@ def getSafetyFactor(self):
13391339

13401340
anchType_clean = self.anchType.lower().replace(' ', '')
13411341

1342-
if anchType_clean in ['helical', 'driven', 'dandg']:
1342+
if anchType_clean in ['helical', 'driven', 'drilled']:
13431343
UC_v = self.anchorCapacity.get('Unity check (vertical)', None)
13441344
UC_h = self.anchorCapacity.get('Unity check (horizontal)', None)
13451345

@@ -1760,7 +1760,7 @@ def conFun_Suction(vars, geomKeys, input_loads, fix_zlug, LD_con, geomBounds, mi
17601760
# convalB = 1 - results['UC']
17611761
return(conval)
17621762

1763-
def conFun_DandG(vars, geomKeys, input_loads, fix_zlug, LD_con, geomBounds, minfs):
1763+
def conFun_Drilled(vars, geomKeys, input_loads, fix_zlug, LD_con, geomBounds, minfs):
17641764

17651765
newGeom = dict(zip(geomKeys, vars))
17661766
self.dd['design'].update(newGeom)
@@ -1879,9 +1879,9 @@ def conBounds(vars, geomKeys, input_loads, fix_zlug, LD_con, geomBounds, minfs):
18791879
{'type':'ineq','fun':conFunV,'args':(geomKeys, input_loads, fix_zlug, LD_con, geomBounds, minfs)},
18801880
{'type':'ineq','fun':conBounds,'args':(geomKeys, input_loads, fix_zlug, LD_con, geomBounds, minfs)}]
18811881

1882-
elif 'dandg' in anchType:
1882+
elif 'drilled' in anchType:
18831883
constraints = [{'type':'ineq','fun':conFun_LD,'args':(geomKeys, input_loads, fix_zlug, LD_con, geomBounds, minfs)},
1884-
{'type':'ineq','fun':conFun_DandG,'args':(geomKeys, input_loads, fix_zlug, LD_con, geomBounds, minfs)},
1884+
{'type':'ineq','fun':conFun_Drilled,'args':(geomKeys, input_loads, fix_zlug, LD_con, geomBounds, minfs)},
18851885
{'type':'ineq','fun':conFunH,'args':(geomKeys, input_loads, fix_zlug, LD_con, geomBounds, minfs)},
18861886
{'type':'ineq','fun':conFunV,'args':(geomKeys, input_loads, fix_zlug, LD_con, geomBounds, minfs)},
18871887
{'type':'ineq','fun':conBounds,'args':(geomKeys, input_loads, fix_zlug, LD_con, geomBounds, minfs)}]
@@ -1893,7 +1893,7 @@ def conBounds(vars, geomKeys, input_loads, fix_zlug, LD_con, geomBounds, minfs):
18931893
# Run the optimization to find sizing that satisfy UC close to 1
18941894
print('optimizing anchor size')
18951895

1896-
if 'suction' in anchType or 'dandg' in anchType:
1896+
if 'suction' in anchType or 'drilled' in anchType:
18971897
solution = minimize(objective, initial_guess, args=dict(geomKeys=geomKeys, input_loads=input_loads, fix_zlug=fix_zlug, LD_con=LD_con, geomBounds=geomBounds, minfs=minfs),
18981898
method="COBYLA", constraints=constraints, options={'rhobeg':0.1, 'catol':0.001})
18991899
else:
@@ -1926,7 +1926,7 @@ def conBounds(vars, geomKeys, input_loads, fix_zlug, LD_con, geomBounds, minfs):
19261926

19271927
print('new initial guess',initial_guess)
19281928
# re-run optimization
1929-
if 'suction' in anchType or 'dandg' in anchType:
1929+
if 'suction' in anchType or 'drilled' in anchType:
19301930
solution = minimize(objective, initial_guess, args=dict(geomKeys=geomKeys, input_loads=input_loads, fix_zlug=fix_zlug, LD_con=LD_con, geomBounds=geomBounds, minfs=minfs),
19311931
method="COBYLA", constraints=constraints, options={'rhobeg':0.1, 'catol':0.001})
19321932
else:

0 commit comments

Comments
 (0)