Skip to content

Issue connecting lines with rods - moordyn-C v2.7.1 #402

Description

@amais29

Hello,
I am trying to reproduce the dynamic cable case shown in article "Implementation and Verification of Cable Bending Stiffness in MoorDyn" (IOWTC2020, M. Hall et al.), section "dynamic cable scenario". The connection between lines and rods, to connect heavy and buoyant cable lengths, generates error. I am defining the model from a MoorDyn V2 input file.

The problem is on the creation of line end connections, during file load.
Actually, line "self.lineList.append( Line(self, num, lUnstr, lineType, nSegs=nSegs, attachments = [int(entries[2]), int(entries[3])]) )" in 'system.py>load' does not appear to be able to deal with non-numeric entries as for 'AttachA' and 'AttachB' fields. But to connect the B-end of my line '2' with the A-end of my rod '1', I need to write 'R1A' in line 2 'AttachB' field, as far as I know. I looked around a bit, and could not figure out a way to go round the problem easily.

The 'Lines' part of my input file looks like :

---------------------- LINES -----------------------------------------------
ID   LineType   AttachA   AttachB   UnstrLen   NumSegs   LineOutputs
(#)  (name)     (#)       (#)       (m)        (-)       (-)
1    lineOffset 1         2         27.45      55        pvt
2    Cable      2         R1A       34.3       70        pvt

Below is the error traceback :

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[2], line 2
      1 import moorpy as mp
----> 2 ms = mp.System(file='filename.txt', Fortran=False)
      4 ms.initialize()
      5 ms.solveEquilibrium()

File (***)\anaconda3\envs\moor\Lib\site-packages\moorpy\system.py:124, in System.__init__(self, file, dirname, rootname, depth, rho, g, qs, Fortran, lineProps, pointProps, **kwargs)
    122 # read in data from an input file if a filename was provided
    123 if len(file) > 0:
--> 124     self.load(file)
    125     # check if bathymetry, if so sink anchors as needed
    126     if 'bathymetry' in kwargs:

File (***)\anaconda3\envs\moor\Lib\site-packages\moorpy\system.py:895, in System.load(self, filename, clear)
    893 
    894 #lineList.append( Line(dirName, num, lUnstr, dia, nSegs) )
--> 895 self.lineList.append( Line(self, num, lUnstr, lineType, nSegs=nSegs, attachments = [int(entries[2]), int(entries[3])]) )
    897 # attach end A
    898 numA = int("".join(filter(str.isdigit, entries[2])))  # get number from the attachA string

ValueError: invalid literal for int() with base 10: 'R1A'

Am I doing something wrong ?

Antoine

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions