Hi,
I would like to use MoorPy to get the mooring stiffness matrix for a floating platform. I have put the mooring system into MoorPy and it initializes well:
I then go to linearize the system using the following python code:
print('===== Beginning Linearization =====')
# Initialize stiffness matrix
K = np.zeros((6, 6), dtype=np.float64)
# Set displacements
DOFchange = np.array([6,6,6,0.2,0.2,0.2])
# Force threshold for linearization
Fmin = 1 # N or Nm
# Loop over DOF and get stiffness matrix
for DOF in range(0,6):
print(f"----- Perturbing DOF {DOF+1} -----")
# Positive displaced position
newPos1 = np.array([0, 0, 0, 0, 0, 0], dtype=np.float64)
newPos1[DOF] = DOFchange[DOF]
# print(newPos1)
# Negative displaced position
newPos2 = np.array([0, 0, 0, 0, 0, 0], dtype=np.float64)
newPos2[DOF] = -DOFchange[DOF]
# print(newPos2)
# Set positive position
ms.bodyList[0].setPosition(newPos1)
# Get forces
ms.solveEquilibrium()
fpos = ms.bodyList[0].getForces()
fpos[np.absolute(fpos) < Fmin] = 0
# Set negative position
ms.bodyList[0].setPosition(newPos2)
# Get forces
ms.solveEquilibrium()
fneg = ms.bodyList[0].getForces()
fneg[np.absolute(fneg) < Fmin] = 0
# Compute stiffness
df = fpos - fneg
dd = newPos2[DOF] - newPos1[DOF]
print("dF: [" + " ".join(f"{x:.2e}" for x in df) + "]")
Kcol = np.divide(df,dd)
print("Kcol: [" + " ".join(f"{x:.2e}" for x in df) + "]")
# print(Kcol)
# Append column onto stiffness matrix
K[:, DOF] = Kcol
It seems to do OK, but no matter what I do, I cannot get a symmetric mooring stiffness matrix. I am implementing a catenary mooring system for a spar platform from this paper with the following parameters:
The mooring stiffness matrix I get is this:
A couple of notes on my mind:
-
Some of these values seem quite small, and in the python code I include some logic to get rid of REALLY small values (less than 1N), but my intuition is that this should be symmetric for the mooring system. Is this possibly a limitation in MoorPy, or maybe there is a better approach I could take?
-
The coordinate system is rotated from the typical OpenFAST, no? So in MoorPy, +x is into the wind, +z is up? I am planning to use this stiffness matrix in BModes to get floating modes and frequencies of a turbine, but I suspect I need to negate these terms to match BModes and OpenFAST sign convention.
Best,
Ian