MoorDyn: Feature/syrope for polyester#3324
Conversation
…re/syrope-for-polyester
…re/syrope-for-polyester
There was a problem hiding this comment.
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 aSYROPE ICsection 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.
| CHARACTER(40) :: owcPath ! | ||
| CHARACTER(40) :: wcFormula ! |
There was a problem hiding this comment.
I followed the same convention as for TempString1–TempString6, where TempString1 stores the path to the nonlinear stiffness lookup file. I assumed this is intentional, likely to limit the path length.
|
|
||
| ! 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 ) |
There was a problem hiding this comment.
I simply copyed the similar syntex from the line failure section and forgot to update the error message.
| 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() |
| 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 |
There was a problem hiding this comment.
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
| ! 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 |
| REAL(DbKi) :: WCK1 ! Syrope working curve parameter 1 | ||
| REAL(DbKi) :: WCK2 ! Syrope working curve parameter 2 | ||
|
|
||
|
|
| Real(DbKi) :: WCK1 ! coefficient for the Syrope working curve formula | ||
| Real(DbKi) :: WCK2 ! coefficient for the Syrope working curve formula |
| 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 |
|
Dear @zhilongwei, Thanks for adding this feature! We'll review this shortly. For regression tests, the best method we have found is the following:
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 I have added the
The new test Best regards |
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:
Impacted areas of the software
Additional supporting information
Documentation has been updated to describe how to use the model. See PR #369.
A detailed reference for the numerical implementation is provided in:
ESOMOOR D5.1: Extended MoorDyn solver and validation report. The theory and validation remain valid but the input file format has changed since our discussion during the MoorDyn-C PR.
I tested the new functionality with the IEA-15-250-RWT semi-sub floater. Examples are available at https://github.com/zhilongwei/IEA-15-240-RWT/tree/ESOMOOR-Mooring/OpenFAST/IEA-15-240-RWT-UMaineSemi-ESOMOOR, where a README is also provided.
Generative AI usage
Test results
r-testbranch merge is required. A new test,md_syrope, has been added tor-test/modules/moordynfollowing the existingmd_viscoelastictest. Likemd_viscoelastic, this test is skipped by default. See https://github.com/zhilongwei/r-test/tree/feature/syrope-regtest/modules/moordyn/md_syrope.Notes for reviewers
r-test. Should I complete this PR to OpenFAST first? Clarification on this would be appreciated.