You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-- yaml specification option for lineProps, where the yaml name will be read in and applied when developing mooring properties (when calling moorpy.helpers.loadLineProps)
- property saved as lineProps
-- marine growth description altered to conform to general table format (now a list of dicts, -{'thickness':x,'lowerRange':y,'upperRange':z,'density':w})
-- marine growth on buoys moved to its own project property, marine_growth_buoys, same setup as before (list of thicknesses corresponding to different buoyancy sections irrespective of depth)
-- bug fix in unload for fairleads stuff
-- bug fix helpers.compareDicts to fix issue with recursion
-- bug fix in platform.setPosition to reset mooring end point attached to fairleads even if set_moorings is False
List of cutoff depths the changePoints should be located at
647
648
648
649
'''
649
-
defgetMG(mgDict):
650
+
defgetMG(mgDict, buoy_mg):
650
651
# create a reference subsystem if it doesn't already exist
651
652
ifnotself.ss:
652
653
self.createSubsystem(pristine=1)
@@ -699,31 +700,31 @@ def getMG(mgDict):
699
700
high=ssLine.rB
700
701
flip=0
701
702
702
-
th=mgDict['th']# set location for ease of coding
703
+
th=mgDict# set location for ease of coding
703
704
# look up what thickness this line section starts at (if lowest point is not on the sea floor, first segment will have a thickness other than the sea floor thickness)
704
705
rAth=0# exit while loop when we find thickness at low
705
706
count1=0# counter
706
707
whilerAth==0: # and count1 < len(th):
707
708
ifflip:
708
-
ifhigh[2] <=th[count1][2]:
709
-
LThick.append(th[count1][0])
709
+
ifhigh[2] <=th[count1]['upperRange']:
710
+
LThick.append(th[count1]['thickness'])
710
711
rAth=1# exit while loop
711
712
else:
712
-
iflow[2] <=th[count1][2]:
713
-
LThick.append(th[count1][0])
713
+
iflow[2] <=th[count1]['upperRange']:
714
+
LThick.append(th[count1]['thickness'])
714
715
rAth=1# exit while loop
715
716
count1=count1+1# iterate counter
716
717
717
718
# determine if this line section will be split
718
719
forjinrange(0,len(th)): # go through all changeDepths
719
720
ifflip:
720
-
rs=2
721
+
rs='upperRange'
721
722
else:
722
-
rs=1
723
+
rs='lowerRange'
723
724
ifth[j][rs]>low[2] andth[j][rs]<high[2]:
724
725
# line section will be split - add line type, mg thickness, and material to list
725
726
LTypes.append(ssLine.type['name'])
726
-
slthick.append(th[j][0])
727
+
slthick.append(th[j]['thickness'])
727
728
# Mats.append(ssLine.type['material'])
728
729
# add an empty connector object to list for split location
729
730
sCount+=1
@@ -771,12 +772,12 @@ def getMG(mgDict):
771
772
772
773
else:
773
774
# this is a buoy section, add the prescribed buoy marine growth thickness
774
-
ifisinstance(mgDict['buoy_th'],list):
775
+
ifisinstance(buoy_mg,list):
775
776
# add the buoy thickness for this specific buoyancy section
776
-
LThick.append(mgDict['buoy_th'][buoyCount])
777
+
LThick.append(buoy_mg[buoyCount])
777
778
else:
778
779
# add the single buoy thickness
779
-
LThick.append(mgDict['buoy_th'])
780
+
LThick.append(buoy_mg)
780
781
781
782
ifslthick: # add the length of the top line (from last split to upper end of section) if there was a split in the line
782
783
slength.append(float(ssLine.L-ln_raw[-1]))
@@ -811,17 +812,13 @@ def getMG(mgDict):
811
812
mu_mg=np.zeros((len(LTypes)))
812
813
rho_mg=np.ones((len(LTypes)))*1325
813
814
# adjust rho value if alternative provided
814
-
if'rho'inmgDict:
815
-
ifnottype(mgDict['rho']) islist:
816
-
# just one density given for all marine growth on the line
817
-
rho_mg=rho_mg*mgDict['rho']/1325
818
-
else: # density given for each thickness of marine growth
819
-
foriinrange(0,len(rho_mg)):
820
-
# look up what thickness number this rho is related to
821
-
forjinrange(0,len(LThick)):
822
-
thind=np.where(th[:][0]==LThick[j])
823
-
# assign rho_mg based on the rho_mg of the thickness
824
-
rho_mg[i] =mgDict['rho'][thind]
815
+
if'density'inmgDict[0]:
816
+
foriinrange(0,len(mgDict)):
817
+
# look up what thickness number this rho is related to
# look up what thickness this line section starts at (if lowest point is not on the sea floor, first segment will have a thickness other than the sea floor thickness)
972
967
rAth=0# exit while loop when we find thickness at low
973
968
count1=0# counter
974
969
whilerAth==0andcount1<=len(th):
975
970
ifflip:
976
-
ifhigh[2] <=th[count1][2]:
977
-
LThick.append(th[count1][0])
971
+
ifhigh[2] <=th[count1]['upperRange']:
972
+
LThick.append(th[count1]['thickness'])
978
973
rAth=1# exit while loop
979
974
else:
980
-
iflow[2] <=th[count1][2]:
981
-
LThick.append(th[count1][0])
975
+
iflow[2] <=th[count1]['upperRange']:
976
+
LThick.append(th[count1]['thickness'])
982
977
rAth=1# exit while loop
983
978
count1=count1+1# iterate counter
984
979
985
980
# determine if this line section will be split
986
981
forjinrange(0,len(th)): # go through all changeDepths
987
982
ifflip:
988
-
rs=2
983
+
rs='upperRange'
989
984
else:
990
-
rs=1
985
+
rs='lowerRange'
991
986
ifth[j][rs]>low[2] andth[j][rs]<high[2]:
992
987
# line section will be split - add line type, mg thickness, and material to list
993
988
LTypes.append(ssLine.type['name'])
994
-
slthick.append(th[j][0])
989
+
slthick.append(th[j]['thickness'])
995
990
Mats.append(ssLine.type['material'])
996
991
# add an empty connector object to list for split location
0 commit comments