Skip to content

Commit f3d6a96

Browse files
committed
update to dynamic_cable create_subsystem function
- dynamic_cable dd now has entries for connector costs - adjusted create_subsystem to skip 'section' items without 'length and try the 'buoyancy_sections' method if lengths is empty
1 parent 24ce4dd commit f3d6a96

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

famodel/cables/dynamic_cable.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ def createSubsystem(self, case=0, dd=None):
461461
# set design dictionary as self.dd if none given, same with connectorList
462462
if not dd:
463463
dd = self.dd
464-
464+
465465
# check that cableType property is up to date
466466
cableType = self.makeCableType(dd['cable_type'])
467467

@@ -481,9 +481,10 @@ def createSubsystem(self, case=0, dd=None):
481481

482482
if 'sections' in dd and dd['sections']: # this will be the case for marine growth or possibly other cases
483483
for i, sec in enumerate(dd['sections']):
484-
types.append(deepcopy(sec['type']))
485-
lengths.append(sec['length'])
486-
elif 'buoyancy_sections' in dd:
484+
if 'length' in sec:
485+
types.append(deepcopy(sec['type']))
486+
lengths.append(sec['length'])
487+
if 'buoyancy_sections' in dd and lengths == []:
487488
# Parse buoyancy sections to compute their properties and all lengths
488489
for i, bs in enumerate(dd['buoyancy_sections']):
489490
# check which end to start from ( need to flip locations of buoyancy modules if end A is at joint and end B is at platform)

0 commit comments

Comments
 (0)