From 7dfc7bb49063508d5e074d8615a84aceee76b003 Mon Sep 17 00:00:00 2001 From: Matt Hall <5151457+mattEhall@users.noreply.github.com> Date: Tue, 19 Sep 2023 12:30:09 -0600 Subject: [PATCH] Finishing touches on static-dynamic stiffness: - Cleaned up moorprops-default.yaml, removing extra EAs entry and cleaning up notes. - Cleaned up associated functions in helpers, line, and system to match and to just give a warning message when the users calls activateDynamicStiffness but EAd value isn't provided (only if display > 0). - Added documention of the new feature in the Usage page!! --- docs/usage.rst | 30 ++++++++++++++++++++++++++++++ moorpy/MoorProps_default.yaml | 22 +++++----------------- moorpy/helpers.py | 5 ++--- moorpy/line.py | 21 ++++++++++++--------- moorpy/system.py | 21 ++++++++------------- 5 files changed, 57 insertions(+), 42 deletions(-) diff --git a/docs/usage.rst b/docs/usage.rst index 339260f..ab05a2c 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -14,10 +14,40 @@ MoorPy Usage .. role:: stnd +Advanced Features +^^^^^^^^^^^^^^^^^ (A list of key functions to be added here) +Variable Rope Stiffness Behavior +-------------------------------- + +MoorPy supports separate static and dynamic stiffness coefficients, +to approximate the variable stiffness characterisics of synthetic +fiber ropes. For using this capability, the mooring line type +information must include a static stiffness value (EAs), and a +dynamic stiffness value (EAd). An additional factor on EAd that +scales with mean tension (EAd_Lm) can also be included. When using +a mooring line properties library (i.e., a yaml file), these values +should be specified by the EA_MBL, EAd_MBL, and EAd_MBL_Lm keywords, +respectively. See the (moorprops library section to be added) for +more information. + +Two System methods control switching between static and +dynamic stiffness properties: + +activateDynamicStiffness switches the mooring system model to dynamic +line stiffness values. It also adjusts the unstretched line lengths +to maintain the same tension at the current system state. If EAd has +not been set, it will not change anything (call it with display > 0 +to display a warning when this occurs). + +:func:`.system.activateDynamicStiffness` + +revertToStaticStiffness resets the mooring lines to use the static +stiffness values and return to their original unstretched lenths. + Additional Parameters in MoorPy ------------------------------- diff --git a/moorpy/MoorProps_default.yaml b/moorpy/MoorProps_default.yaml index 835e372..e78bf5b 100644 --- a/moorpy/MoorProps_default.yaml +++ b/moorpy/MoorProps_default.yaml @@ -17,22 +17,10 @@ # EA_d : # stiffness per diameter [N/m] # EA_d2 : # stiffness per diameter^2 [N/m^2] # EA_d3 : # stiffness per diameter^3 [N/m^3] -# EA_MBL or Kr # stiffness per MBL [N/N] -# EAs_MBL or Krs # quasi-static stiffness per MBL [N/N] -# EAd_MBL or Krd_alpha # dynamic stiffness per MBL [N/N] -# EAd_MBL_Lm or Krd_beta # dynamic stiffness per MBL per fraction of mean load (not %) [N/N] - - - -NEW: -# Krs or EAs_MBL : # quasi-static stiffness per MBL [N/N] -# Krd_alpha or EAd_MBL : # dynamic stiffness per MBL [N/N] -# Krd_beta or EAd_MBL_PML : # dynamic stiffness per MBL per % mean load [N/N] -# (% mean load will be input later in the modeling code) - - - -# +# EA_MBL : # (quasi-static) stiffness per MBL [N/N] (aka Kr, Krs) +# EAd_MBL : # dynamic stiffness per MBL [N/N] (aka Krd or Krd_alpha) +# EAd_MBL_Lm: # dynamic stiffness per MBL per fraction of mean load (not %) [N/N] (aka or Krd_beta) +# # dvol_dnom : # volume-equivalent diameter per nominal diameter [-] # # cost_0 : # cost offset [$/m] @@ -70,7 +58,7 @@ lineProps: MBL_d2 : 170.5e6 # minimum breaking load per diameter^2 [N/m^2] dvol_dnom : 0.86 # volume-equivalent diameter per nominal diameter [-] cost_MBL : 1.65e-05 # cost per MBL [$/m/N] - EAs_MBL : 14 # quasi-static stiffness per MBL [N/N] + EA_MBL : 14 # quasi-static stiffness per MBL [N/N] EAd_MBL : 14 # dynamic stiffness per MBL [N/N] EAd_MBL_Lm : 0.34 # dynamic stiffness per MBL per fraction of mean load (not %) [N/N] diff --git a/moorpy/helpers.py b/moorpy/helpers.py index 3674dc9..a44f1a6 100644 --- a/moorpy/helpers.py +++ b/moorpy/helpers.py @@ -688,8 +688,8 @@ def getLineProps(dnommm, material, lineProps=None, source=None, name="", rho=102 + mat['cost_mass']*mass + mat['cost_EA']*EA + mat['cost_MBL']*MBL) w = (mass - np.pi/4*d_vol**2 *rho)*g - # >>> expected inputs for viscoelastic approach <<< need to add some kind of mode switch to handle this throughout MoorPy <<<< - EAs = mat['EAs_MBL']*MBL # quasi-static stiffness: Krs x MBL [N] + # stiffness values for viscoelastic approach + EAs = mat['EA_MBL']*MBL # quasi-static stiffness: Krs x MBL [N] EAd = mat['EAd_MBL']*MBL # dynamic stiffness constant: Krd alpha term x MBL [N] EAd_Lm = mat['EAd_MBL_Lm'] # dynamic stiffness Lm slope: Krd beta term (to be multiplied by mean load) [-] @@ -761,7 +761,6 @@ def loadLineProps(source): output[mat]['EA_d2' ] = getFromDict(props, 'EA_d2' , default=0.0) output[mat]['EA_d3' ] = getFromDict(props, 'EA_d3' , default=0.0) output[mat]['EA_MBL' ] = getFromDict(props, 'EA_MBL' , default=0.0) - output[mat]['EAs_MBL' ] = getFromDict(props, 'EAs_MBL' , default=0.0) output[mat]['EAd_MBL' ] = getFromDict(props, 'EAd_MBL' , default=0.0) output[mat]['EAd_MBL_Lm']= getFromDict(props, 'EAd_MBL_Lm',default=0.0) diff --git a/moorpy/line.py b/moorpy/line.py index 72f2771..dd39145 100644 --- a/moorpy/line.py +++ b/moorpy/line.py @@ -1051,20 +1051,23 @@ def attachLine(self, lineID, endB): pass - def activateDynamicStiffness(self): + def activateDynamicStiffness(self, display=0): '''Switch mooring line model to dynamic line stiffness value, including potential unstretched line length adjustment. This only works when dynamic line properties are used.''' - # switch to dynamic stiffness value - EA_old = self.type['EAs'] - EA_new = self.type['EAd'] + self.type['EAd_Lm']*self.TA # this implements the sloped Krd = alpha + beta*Lm - self.EA = EA_new - - # adjust line length to maintain current tension (approximate) - self.L = self.L0 * (1 + self.TB/EA_old)/(1+self.TB/EA_new) - + if self.type['EAd'] > 0: + # switch to dynamic stiffness value + EA_old = self.type['EAs'] + EA_new = self.type['EAd'] + self.type['EAd_Lm']*self.TA # this implements the sloped Krd = alpha + beta*Lm + self.EA = EA_new + + # adjust line length to maintain current tension (approximate) + self.L = self.L0 * (1 + self.TB/EA_old)/(1+self.TB/EA_new) + else: + if display > 0: + print(f'Line {self.number} has zero dynamic stiffness coefficient so activateDynamicStiffness does nothing.') def revertToStaticStiffness(self): diff --git a/moorpy/system.py b/moorpy/system.py index 2d13380..b73af40 100644 --- a/moorpy/system.py +++ b/moorpy/system.py @@ -2906,29 +2906,24 @@ def checkTensions(self, N = None): return(ratios) - def activateDynamicStiffness(self): + def activateDynamicStiffness(self, display=0): '''Switch mooring system model to dynamic line stiffness - values, including potential unstretched line length - adjustment. This only works when dynamic line properties + values and adjust the unstretched line lengths to maintain the + same tensions. This only has an effect when dynamic line properties are used.''' for line in self.lineList: - line.activateDynamicStiffness() - - #initialize? + line.activateDynamicStiffness(display=display) def revertToStaticStiffness(self): - '''Switch mooring system model to dynamic line stiffness - values, including potential unstretched line length - adjustment. This only works when dynamic line properties - are used.''' + '''Revert mooring system model back to the static stiffness + values and the original unstretched lenths.''' for line in self.lineList: line.revertToStaticStiffness() - - #initialize? - + + def getDepthFromBathymetry(self, x, y): #BathymetryGrid, BathGrid_Xs, BathGrid_Ys, LineX, LineY, depth, nvec) ''' interpolates local seabed depth and normal vector