Skip to content

Commit 3ca5f29

Browse files
committed
Updated addCorrosion to store corroded MBL in mooring.dd
- Also added in a commented out line in project.plot2d TODO later for bounds on the bathymetry colors and not always default to the min/max of the bathymetry file
1 parent 831d651 commit 3ca5f29

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

famodel/mooring/mooring.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -895,10 +895,11 @@ def addCorrosion(self,corrosion_mm=10):
895895
896896
'''
897897
for i,sec in enumerate(self.dd['sections']):
898-
if sec['material']=='chain':
899-
MBL_cor = sec['MBL']*( (sec['d_nom']-(corrosion_mm/1000))/sec['d_nom'] )**2 # corroded MBL
898+
if sec['type']['material']=='chain':
899+
MBL_cor = sec['type']['MBL']*( (sec['type']['d_nom']-(corrosion_mm/1000))/sec['type']['d_nom'] )**2 # corroded MBL
900900
else:
901-
MBL_cor = sec['MBL']
901+
MBL_cor = sec['type']['MBL']
902+
sec['type']['MBL'] = MBL_cor
902903

903904

904905
def getEnvelope(self,ang_spacing=45,SFs=True):

famodel/project.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1983,6 +1983,8 @@ def plot2d(self, ax=None, plot_seabed=True,plot_bathymetry=True, plot_boundary=T
19831983
X, Y = np.meshgrid(self.grid_x, self.grid_y)
19841984

19851985
contourf = ax.contourf(X, Y, self.grid_depth, num_levels, cmap='Blues', vmin=np.min(self.grid_depth), vmax=np.max(self.grid_depth))
1986+
#contourf = ax.contourf(X, Y, self.grid_depth, num_levels, cmap='Blues', vmin=500, vmax=1300)
1987+
# >>>> TODO: Update the above to add optional inputs for bounds (vmin/vmax) on contour plot colors for bathymetry <<<<
19861988

19871989
if not bare: # Add colorbar with label
19881990
cbar = plt.colorbar(contourf, ax=ax, fraction=0.04, label='Water Depth (m)')

0 commit comments

Comments
 (0)