Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Line Failures added to MoorDyn #2214

Merged
merged 11 commits into from
May 17, 2024
Merged

Conversation

RyanDavies19
Copy link
Contributor

@RyanDavies19 RyanDavies19 commented May 14, 2024

Feature or improvement description
Added line failure capabilities to MoorDyn, which can be triggered by a time or tension threshold. The corresponding docs update can be found here: FloatingArrayDesign/MoorDyn#213. This update includes error checking and has been tested for invalid input file configurations.

Heres what is in the docs: "This section (optional) describes the failure conditions of the system. Line failures can only be triggered at an existing point or rod end where a line/lines are attached. Failures can be triggered by a time or attachment tension threshold, which ever comes first. Users can specify multiple failures for a given point, but duplicate failure configurations will be ignored. If two lines attached to a point are listed to fail (failure 1 for example), then after the failure the lines will remain attached to each other by a free point. In this multi line case, if any line reaches the tension threshold then the failure will be triggered."

I've also enabled bodies and rods in fast farm, which just entailed properly reading in the input file. I also added a warning to waves in MoorDyn to check the beginning time of the wave elevation time series. I had a report of seg faults when the time series started at t != 0.

I also included a fix to the calculation of 6 DOF drag vector for Bodies, as reported in FloatingArrayDesign/MoorDyn#205

Impacted areas of the software
MoorDyn

Additional supporting information
The types file might need to be regenerated based on the registry update. I cannot get the most recent version of dev (after the unstable pointer merge) to compile locally so the types file is generated with the old method. If @andrew-platt or someone else with the most up-to-date version of dev could PR to my branch with an updated types file that would be great!

Test results, if applicable

Here are the results from the attached test case:

Figure_1

Example MD driver case:
fail_test.zip

@andrew-platt andrew-platt self-assigned this May 14, 2024
@andrew-platt andrew-platt added this to the v4.0.0 milestone May 14, 2024
@andrew-platt andrew-platt changed the base branch from main to dev May 14, 2024 01:57
Copy link
Collaborator

@jjonkman jjonkman left a comment

Choose a reason for hiding this comment

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

I'm not really qualified to review the code change, but overall the approach described makes sense to me. Thanks for implementing this!

@RyanDavies19
Copy link
Contributor Author

Added updated types after #2223 bug fix allows me to build locally. Thanks @andrew-platt

@andrew-platt andrew-platt merged commit d1f17a2 into OpenFAST:dev May 17, 2024
21 checks passed
@RyanDavies19 RyanDavies19 deleted the failures branch May 21, 2024 21:29
@jjonkman jjonkman mentioned this pull request Aug 17, 2024
@@ -379,14 +373,15 @@ SUBROUTINE Point_RemoveLine(Point, lineID, TopOfLine, rEnd, rdEnd)
REAL(DbKi), INTENT(INOUT) :: rdEnd(3)

Integer(IntKi) :: l,m,J
Integer(IntKi) :: found = 0
Copy link
Contributor

Choose a reason for hiding this comment

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

In Fortran, initializing a variable in the type declaration statement automatically gives it a "SAVE" attribute, which means it retains its value each time it is called (i.e., it's set to 0 only the first time the routine is called). Since this is called from an UpdateStates routine, I'd be surprised if this is how it was intended to be used.... and if that was the intention, it wouldn't work properly in a restart situation.

I'd recommend either

  1. rewriting like this:
Integer(IntKi) :: found

found = 0

or

  1. putting this variable in a MiscVar type, if you do intend for it to have the SAVE attribute.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, using a LOGICAL here might make it easier to read, unless you have plans for checking something other than found vs not-found .

Copy link
Contributor Author

@RyanDavies19 RyanDavies19 Aug 19, 2024

Choose a reason for hiding this comment

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

Thanks @bjonkman for the review. @andrew-platt if you have a PR or something merging soon can you add the found = 0 and the logical fix there? Otherwise I can open a PR. It's intent is a boolean flag that prints an error message (I probably should've made it throw a warning, because if it fails the simulation continues with the line attached)

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'll include this into a minor PR that I'll post tomorrow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks!

Copy link
Collaborator

Choose a reason for hiding this comment

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

See #2400

andrew-platt added a commit to andrew-platt/openfast that referenced this pull request Aug 29, 2024
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