Skip to content

MoorDyn: Feature/syrope for polyester#3324

Open
zhilongwei wants to merge 13 commits intoOpenFAST:devfrom
zhilongwei:feature/syrope-for-polyester
Open

MoorDyn: Feature/syrope for polyester#3324
zhilongwei wants to merge 13 commits intoOpenFAST:devfrom
zhilongwei:feature/syrope-for-polyester

Conversation

@zhilongwei
Copy link
Copy Markdown

Feature or improvement description

This pull request implements the Syrope model for polyester mooring ropes to MoorDyn-F.

The same implementation has already been completed and approved in MoorDyn-C. See PR #369.

This implementation captures:

  • nonlinear, path-dependent, and loading-rate-dependent tension-strain behavior of polyester ropes,
  • the dependence of dynamic stiffness on mean tension in both wave-frequency and low-frequency regimes,
  • quasi-static response based on working curves.

Impacted areas of the software

  • MoorDyn-F

Additional supporting information

Generative AI usage

Test results

  • Three tests failed (see LastTest.log):
    • 27 - 5MW_OC4Jckt_DLL_WTurb_WavesIrr_MGrowth (Failed) aerodyn elastodyn hydrodyn offshore openfast servodyn subdyn
    • 71 - Damped_Beam_Rotating (Failed) beamdyn linear openfast
    • 83 - MHK_RM1_Floating_MR_Linear (Failed) aerodyn elastodyn hydrodyn linear mhk moordyn multirotor offshore openfast servodyn
  • An r-test branch merge is required. A new test, md_syrope, has been added to r-test/modules/moordyn following the existing md_viscoelastic test. Like md_viscoelastic, this test is skipped by default. See https://github.com/zhilongwei/r-test/tree/feature/syrope-regtest/modules/moordyn/md_syrope.
  • OpenFAST version
**************************************************************************************************
 OpenFAST

 Copyright (C) 2026 National Renewable Energy Laboratory
 Copyright (C) 2026 Envision Energy USA LTD

 This program is licensed under Apache License Version 2.0 and comes with ABSOLUTELY NO WARRANTY.
 See the "LICENSE" file distributed with this software for details.
 **************************************************************************************************

 OpenFAST-v5.0.0-69-gf0549eae
 Compile Info:
  - Compiler: GCC version 14.2.0
  - Architecture: 64 bit
  - Precision: double
  - OpenMP: No
  - Date: May  1 2026
  - Time: 11:08:49
 Execution Info:
  - Date: 05/01/2026
  - Time: 11:23:27+0000


  OpenFAST terminated normally.

Notes for reviewers

  • I am not sure about the workflow for creating a PR to r-test. Should I complete this PR to OpenFAST first? Clarification on this would be appreciated.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Implements the Syrope polyester rope model in MoorDyn-F by extending line-type parsing, line state/data structures, and line tension/working-curve evaluation to support nonlinear, path-dependent rope behavior with optional initial conditions.

Changes:

  • Add input parsing for SYROPE:<working-curve-file> in line-type EA entries and a SYROPE IC section for initializing Syrope history variables.
  • Extend MoorDyn line/line-type data structures + registry serialization to store Syrope working-curve parameters and history state (e.g., Tmax, Tmean).
  • Add a new 1D interpolation helper and integrate Syrope working-curve setup/evaluation into line initialization and state-derivative calculations.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
modules/moordyn/src/MoorDyn.f90 Parses Syrope configuration/ICs and adds a working-curve file reader.
modules/moordyn/src/MoorDyn_Line.f90 Allocates/uses Syrope state and implements working-curve setup + Syrope tension/damping behavior.
modules/moordyn/src/MoorDyn_Misc.f90 Adds calculate1DinterpolationXY for table lookups used by Syrope.
modules/moordyn/src/MoorDyn_Types.f90 Adds Syrope fields to types and updates copy/pack/unpack/destroy logic.
modules/moordyn/src/MoorDyn_Registry.txt Registers new Syrope fields for serialization.
Comments suppressed due to low confidence (1)

modules/moordyn/src/MoorDyn.f90:2809

  • Lines using ElasticMod==3 also store dl_1 in the state vector (Line_Initialize sets dl_1 for ElasticMod>1 and <4), but this initialization only runs for ElasticMod==2 or 4. Include ElasticMod==3 here so the initial state vector is consistent with the line object's dl_1 values.
         ! if using viscoelastic model or Syrope model, initialize the internal states
         if (m%LineList(l)%ElasticMod == 2 .or. m%LineList(l)%ElasticMod == 4) then
            do I = 1,N
               x%states(m%LineStateIs1(l) + 6*N-6 + I-1) = m%LineList(l)%dl_1(I)   ! should be zero
            end do
         end if

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +162 to +163
CHARACTER(40) :: owcPath !
CHARACTER(40) :: wcFormula !
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I followed the same convention as for TempString1TempString6, where TempString1 stores the path to the nonlinear stiffness lookup file. I assumed this is intentional, likely to limit the path length.

Comment thread modules/moordyn/src/MoorDyn.f90 Outdated

! check for correct number of columns in current line
IF ( CountWords( Line ) /= N+2 ) THEN
CALL SetErrStat( ErrID_Fatal, ' Unable to parse line failure '//trim(Num2LStr(l))//' on row '//trim(Num2LStr(i))//' in input file. Row has wrong number of columns. Must be 5 columns.', ErrStat, ErrMsg, RoutineName )
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I simply copyed the similar syntex from the line failure section and forgot to update the error message.

Comment thread modules/moordyn/src/MoorDyn.f90 Outdated
Comment on lines +1812 to +1819
if (TempIDnums(il) <= p%nLines) then ! ensure line ID is in range
DO j = 1, m%LineList(TempIDnums(il))%N
m%LineList(TempIDnums(il))%Tmax(j) = Tmax0
m%LineList(TempIDnums(il))%Tmean(j) = Tmean0
END DO
else
CALL SetErrStat( ErrID_Fatal, ' Unable to parse Syrope line initial conditions '//trim(Num2LStr(l))//'. Line number '//TRIM(Int2LStr(TempIDnums(il)))//' out of bounds.', ErrStat, ErrMsg, RoutineName )
CALL CleanUp()
Comment thread modules/moordyn/src/MoorDyn.f90 Outdated
Comment on lines +1807 to +1808
IF (ErrStat2 == 0) THEN
READ(Line,*,IOSTAT=ErrStat2) TempIDnums(1:N), Tmax0, Tmean0
ErrMsg = ' Error allocating Syrope arrays, Tmax and Tmean.'
!CALL CleanUp()
RETURN
END IF
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line%Tmax and Line%Tmean are already initialized when reading the SYROPE IC section in MoorDyn.f90.

                  DO il = 1, N
                     if (TempIDnums(il) >= 1 .and. TempIDnums(il) <= p%nLines) then      ! ensure line ID is in range
                        DO j = 1, m%LineList(TempIDnums(il))%N
                           m%LineList(TempIDnums(il))%Tmax(j) = Tmax0
                           m%LineList(TempIDnums(il))%Tmean(j) = Tmean0
                        END DO
                     else
                        CALL SetErrStat( ErrID_Fatal, ' Unable to parse Syrope line initial conditions '//trim(Num2LStr(l))//'. Line number '//TRIM(Int2LStr(TempIDnums(il)))//' out of bounds.', ErrStat, ErrMsg, RoutineName )
                        CALL CleanUp()
                        return
                     endif 
                  END DO

Comment on lines +105 to +110
! find static strain of the slow spring on the original working curve if Syrope model is used
if (Line%ElasticMod == 4) then
DO I = 1,Line%nEApoints
Line%stiffZs(I) = Line%stiffXs(I) - 1.0 / Line%vbeta * log(1.0 + Line%vbeta / Line%alphaMBL * Line%stiffYs(I))
END DO
end if
Comment thread modules/moordyn/src/MoorDyn_Line.f90 Outdated
Comment on lines 328 to 331
REAL(DbKi) :: WCK1 ! Syrope working curve parameter 1
REAL(DbKi) :: WCK2 ! Syrope working curve parameter 2


Comment thread modules/moordyn/src/MoorDyn_Line.f90 Outdated
Comment on lines +1222 to +1223
Real(DbKi) :: WCK1 ! coefficient for the Syrope working curve formula
Real(DbKi) :: WCK2 ! coefficient for the Syrope working curve formula
Comment thread modules/moordyn/src/MoorDyn.f90 Outdated
Comment on lines +749 to +755
CALL MD_ReadSyropeWorkingCurves(tempString6, owcPath, wcFormula, wcK1, wcK2, ErrStat2, ErrMsg2)

if (ErrStat2 /= ErrID_None ) then
CALL SetErrStat( ErrID_Fatal, 'Failed to read SYROPE working curves for line type '//trim(Num2LStr(l))//'. Check error message for details.', ErrStat, ErrMsg, RoutineName )
CALL CleanUp()
RETURN
end if
@andrew-platt
Copy link
Copy Markdown
Collaborator

Dear @zhilongwei,

Thanks for adding this feature! We'll review this shortly.

For regression tests, the best method we have found is the following:

  1. create a fork of the r-test repository
  2. using the dev base branch, add your new test on an r-test branch (use the same name as this feature)
  3. for a new test case, edit the <openfast>/reg_tests/CTestList.cmake on your OpenFAST branch.
  4. commit the r-test sub-module change to your OpenFAST branch

If everything tests out ok, we will merge the r-test branch during the merge of this PR. This is admittedly not the cleanest workflow, but we haven't found a better solution yet.

Regards,

@zhilongwei
Copy link
Copy Markdown
Author

zhilongwei commented May 6, 2026

Dear @zhilongwei,

Thanks for adding this feature! We'll review this shortly.

For regression tests, the best method we have found is the following:

  1. create a fork of the r-test repository
  2. using the dev base branch, add your new test on an r-test branch (use the same name as this feature)
  3. for a new test case, edit the <openfast>/reg_tests/CTestList.cmake on your OpenFAST branch.
  4. commit the r-test sub-module change to your OpenFAST branch

If everything tests out ok, we will merge the r-test branch during the merge of this PR. This is admittedly not the cleanest workflow, but we haven't found a better solution yet.

Regards,

Dear @andrew-platt,

I found that r-test/dev is not currently synchronized with the OpenFAST branch used here: some cases are missing the new AutoRelax and RelaxFactor inputs. So I based my r-test branch on 818aa5a855a9adfbf6d9913775453b48dd4a6b2cff9b577119f5d056168d711b291d0156ee033955, the r-test commit this OpenFAST branch was already using, and added the Syrope test on top. See https://github.com/zhilongwei/r-test/commits/feature/syrope-for-polyester/.

I have added the md_syrope as well as the existing md_viscoelastic to the CTestList.cmake. All tests passed except for the three I reported in the PR:

  • 27 - 5MW_OC4Jckt_DLL_WTurb_WavesIrr_MGrowth (Failed) aerodyn elastodyn hydrodyn offshore openfast servodyn subdyn
  • 71 - Damped_Beam_Rotating (Failed) beamdyn linear openfast
  • 83 - MHK_RM1_Floating_MR_Linear (Failed) aerodyn elastodyn hydrodyn linear mhk moordyn multirotor offshore openfast servodyn

The new test md_syrope passed. See LastTest.log

Best regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants