Skip to content

HydroDyn primary input file passing and parsing#756

Merged
andrew-platt merged 13 commits intoOpenFAST:devfrom
andrew-platt:f/HD_InputFileParsing
Oct 29, 2021
Merged

HydroDyn primary input file passing and parsing#756
andrew-platt merged 13 commits intoOpenFAST:devfrom
andrew-platt:f/HD_InputFileParsing

Conversation

@andrew-platt
Copy link
Collaborator

@andrew-platt andrew-platt commented May 15, 2021

This PR is not ready to mere yet!!

Feature or improvement description
The parsing of the primary input file is now handled using the ProcessComFile subroutine to populate the FileInfoType data structure. This is then read into the InputFileType data structure during initialization. The purpose of this is to allow passing the complete input file as the FileInfoType data structure into the HydroDyn_Init routine (this data structure is essentially a string array with metadata). This greatly simplifies coupling the HydroDyn module into Python or Julia codes, such as WEIS or OpenTurbineCoDe, using C style bindings for the ATLANTIS projects.

This is similar to how AD15, InflowWind, MoorDyn V2, and ServoDyn handle their input files.

Related issue, if one exists

Impacted areas of the software
Only the HydroDyn input file parsing has been changed.

Additional supporting information
This PR is needed for the ATLANTIS CCT2 and Rutgers projects, and will for the basis of the further HD linearization work within the ATLANTIS WEIS project.

Test results, if applicable
No test results change with this update (there are slight changes due to the PR's this depends upon). One input file change was required in 5MW_OC4Jckt_DLL_WTurb_WavesIrr_MGrowth test case to remove an extra entry for the WaveDT.

Input file data had originally been stored in InitInp so that it could be passed in directly.  However, we are now migrating to a method of passing all the input file data as datatype FileInfo (basically a string array with some meta-data).  This simplifies setting up to pass input file information from a different language (such as python through a c-bound library interface to HD -- which is needed for an ATLANTIS project).

It is a little bit messier than I like at the moment -- the InputFile datatype contains some WAMIT, Waves, and other InitInput types.  But right now I don't see a simpler option that won't require lots of work.
…ata structure

The input parser no longer reads the file directly.
The Parse*Var routines only handled ReKi and DbKi --> this was a problem reading in SiKi vars when compiling in double precision

Modified them so we can handle SiKi, R8Ki, and QuKi.
a few floating regression tests were failing -- incorrectly set ptfmRot values
@andrew-platt andrew-platt self-assigned this May 15, 2021
@andrew-platt andrew-platt marked this pull request as draft May 15, 2021 13:17
@andrew-platt andrew-platt added this to the v3.1.0 milestone Oct 25, 2021
@andrew-platt andrew-platt marked this pull request as ready for review October 27, 2021 23:30
@andrew-platt andrew-platt marked this pull request as draft October 27, 2021 23:33
@codecov-commenter
Copy link

codecov-commenter commented Oct 28, 2021

Codecov Report

Merging #756 (45653d1) into dev (572ff1a) will decrease coverage by 0.13%.
The diff coverage is 5.55%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev     #756      +/-   ##
==========================================
- Coverage   11.30%   11.17%   -0.14%     
==========================================
  Files         211      211              
  Lines      310787   310652     -135     
  Branches   178127   181332    +3205     
==========================================
- Hits        35137    34714     -423     
- Misses     231510   231806     +296     
+ Partials    44140    44132       -8     
Flag Coverage Δ
regtests 11.06% <5.55%> (-0.14%) ⬇️
unittests 2.57% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
modules/hydrodyn/src/HydroDyn.f90 16.20% <ø> (-0.37%) ⬇️
modules/hydrodyn/src/HydroDyn_Input.f90 20.68% <ø> (-3.71%) ⬇️
modules/hydrodyn/src/HydroDyn_Types.f90 6.87% <1.76%> (-0.92%) ⬇️
modules/nwtc-library/src/NWTC_IO.f90 26.33% <30.30%> (-0.31%) ⬇️
modules/hydrodyn/src/HydroDyn_Output.f90 27.41% <33.33%> (ø)
modules/hydrodyn/src/Waves_Types.f90 0.51% <0.00%> (-2.16%) ⬇️
modules/hydrodyn/src/WAMIT2_Types.f90 2.24% <0.00%> (-2.07%) ⬇️
modules/hydrodyn/src/Current_Types.f90 1.07% <0.00%> (-1.73%) ⬇️
modules/hydrodyn/src/Conv_Radiation_Types.f90 3.81% <0.00%> (-1.11%) ⬇️
... and 21 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 572ff1a...45653d1. Read the comment docs.

@andrew-platt andrew-platt force-pushed the f/HD_InputFileParsing branch from 0f64689 to 3c0d19e Compare October 28, 2021 00:09
@andrew-platt andrew-platt force-pushed the f/HD_InputFileParsing branch from 3c0d19e to 45653d1 Compare October 28, 2021 00:10
@andrew-platt andrew-platt marked this pull request as ready for review October 28, 2021 14:59
Copy link
Contributor

@ebranlard ebranlard left a comment

Choose a reason for hiding this comment

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

This all looks good and a great addition!

My personal preference would be to put the if (failed()) return at the end of line to save space (I agree that multiple meaningful statements per line is not the best) , and not break the indentation. But that's a personal preference :)

@andrew-platt andrew-platt merged commit 34ef10e into OpenFAST:dev Oct 29, 2021
@andrew-platt andrew-platt deleted the f/HD_InputFileParsing branch November 16, 2021 17:27
@rafmudaf rafmudaf mentioned this pull request Mar 2, 2022
11 tasks
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.

3 participants

Comments