Skip to content

Commit a1e7308

Browse files
committed
Bug fix platform.setPosition(update_moorings=False)
- re-calculate and reset span when update_moorings=False for platform.setPosition to ensure it is unloaded properly - some small mooring README updates
1 parent f152ed2 commit a1e7308

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

famodel/mooring/README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ includes a design dictionary with the following details:
3838
- v : volume [kg/m^3]
3939
- CdA
4040

41-
The Mooring object contains subcomponent objects that represent each component of the full mooring line. Line segments are Section objects, while connectors between segments and at the ends of the lines are Connector objects. These segments alternate, and are listed in the subcomponents section of the design dictionary in order from end A to end B. If there are parallel sections, such as in the case of a bridle, the parallel sections are described with nested lists.
41+
The Mooring object contains subcomponent objects that represent each component of the full mooring line. Line segments (lengths of a mooring line with one material) are Section objects, while connectors between segments and at the ends of the lines are Connector objects. These components alternate, and are listed in the subcomponents section of the design dictionary in order from end A to end B. If there are parallel sections, such as in the case of a bridle, the parallel sections are described with nested lists.
4242

4343
## Mooring Properties
4444
- dd
@@ -60,15 +60,21 @@ The Mooring object contains subcomponent objects that represent each component o
6060
- rA : end A absolute coordinates
6161
- rB : end B absolute coordinates
6262
- heading : compass heading from B to A
63-
- ss : MoorPy subsystem representation of this Mooring, pristine
64-
- ss_mod : modified MoorPy subsystem of thie Mooring, could have marine growth etc
63+
- ss : MoorPy subsystem representation of this Mooring
6564
- span : 2D (x-y) distance from fairlead to anchor or fairlead to fairlead. If bridles, the distance is calculated from the midpoint of all bridle fairlead points
6665
- adjuster : custom function that can adjust mooring
6766
- shared : int for anchored line (0), shared line (1) or half of a shared line (2)
6867
- symmetric : boolean for if the mooring line is symmetric shared line
68+
- parallels : boolean for if there are any parallel sections (for example: bridles) in the mooring
69+
- i_con : indices of connectors in the subcomponents list property
70+
- i_sec : indices of sections in the subcomponents list property
6971
- rho : water density
7072
- g : acceleration due to gravity
7173
- envelopes : 2D motion envelopes, buffers, etc.
74+
- loads :
75+
- safety_factors : dictionary of safety factor values based on material MBL and line loads from loads dictionary
76+
- env_impact : dictionary quantifying environmental impact factors such as disturbedSeabedArea for total seabed disturbance area
77+
- applied_states : dictionary keeping track of which states have been applied to the mooring line model, such as marine growth (marine_growth), creep, and corrosion. These states are automatically updated when mooring.updateState, setCreep, setCorrosion, addMarineGrowth are called
7278
- reliability : dictionary of reliability information on the line
7379
- cost : dictionary of line costs
7480
- failure_probability : dictionary of failure probabilities

famodel/mooring/mooring.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def __init__(self, dd=None, subsystem=None, anchor=None,
8484

8585
# MoorPy subsystem that corresponds to the mooring line
8686
self.ss = subsystem
87-
self.ss_mod = None
87+
8888
# workaround for users who are making mooring objects based on pre-existing subsystems
8989
if self.ss and not self.dd:
9090
self.dd = {}

famodel/platform/platform.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,17 @@ def setPosition(self, r, heading=None, degrees=False,project=None, update_moorin
114114
# headings = [cab.subcomponents[0].headingA + pf_phis[0], cab.subcomponents[-1].headingB + pf_phis[1]]
115115

116116
# reposition the cable
117-
cab.reposition(project=project)
118-
117+
cab.reposition(project=project)
118+
119119
self.updateMooringPoints()
120+
121+
if not update_moorings:
122+
# update span in case it changed if pf location changes but anchor does not
123+
for i, att in enumerate(self.attachments):
124+
if isinstance(self.attachments[att]['obj'], Mooring):
125+
moor = self.attachments[att]['obj']
126+
moor.dd['span'] = np.linalg.norm(moor.rA[:2]-moor.rB[:2])
127+
moor.span=moor.dd['span']
120128

121129
def mooringSystem(self,rotateBool=0,mList=None,bodyInfo=None, project=None):
122130
'''

0 commit comments

Comments
 (0)