Exawind / nalu-wind

Solver for wind farm simulations targeting exascale computational platforms
https://exawind.github.io/nalu-wind/
Other
124 stars 85 forks source link

Fix nrel5MWactuatorLine test and ActuatorBulkFastTests unit test #1284

Closed marchdf closed 2 months ago

marchdf commented 3 months ago

This is the fix to the segfault in nrel5MWactuatorLine. https://github.com/OpenFAST/openfast/blob/dev/glue-codes/openfast-cpp/src/OpenFAST.cpp#L2072 needs valid values in TurbineHubPos. Curious to get thoughts from people who know this stuff better: @psakievich and @gantech.

Not quite the end of the story because the input files have drifted from the dev openfast so I still need to fix

terminate called after throwing an instance of 'std::runtime_error'
  what():  FAST_InitializeAll:FAST_Init:FAST_ReadPrimaryFile:Invalid numerical input for file "nrel5mw.fst" occurred while trying to read MHK

But that's much easier to deal with ;)

marchdf commented 3 months ago

actually I have no idea why it is complaining about MHK...

marchdf commented 3 months ago

Ah it's missing sea state information.

marchdf commented 3 months ago

Ok now dealing with:

 OpenFAST input file heading:
     FAST Certification Test #01: NREL 5.0 MW Baseline Wind Turbine (Onshore)

terminate called after throwing an instance of 'std::runtime_error'
  what():  FAST_InitializeAll:FAST_Init:ValidateInputData:DT_out must be at least DT (6.25000E-03 s).
jrood-nrel commented 3 months ago

I updated openfast input files here which might help https://github.com/Exawind/exawind-cases/pull/25

marchdf commented 3 months ago

yeah I've been digging around the openfast site. It's tricky because everything is on the dev branch because that's what we use with +fsi.

This is a bit of a maddening exercise though. My two current issues:

(lldb) frame s 8 frame #8: 0x00007fffef77dac6 libopenfastcpplib.so`fast::OpenFAST::prepareOutputFile(this=0x0000000000709630, iTurbLoc=0) at OpenFAST.cpp:615:33 612 } 613 } 614 -> 615 ierr = nc_put_vardouble(ncid, ncOutVarIDs["nac_ref_pos"], 616 &brFSIData[iTurbLoc][3].nac_ref_pos[0]); 617 ierr = nc_put_vardouble(ncid, ncOutVarIDs["nac_ref_orient"], 618 &brFSIData[iTurbLoc][3].nac_ref_pos[3]); (lldb)



Also should be noted that if this is all fixed, we still have a problem that these input files will only work with dev openfast, which means this test will only work with +fsi. 

I will take anyone's suggestions on how to proceed. Ideally someone who has looked at openfast/nalu-wind coupling. 

Tagging: @psakievich, @gantech, @lawrenceccheung, @neilmatula , @ndevelder  
marchdf commented 3 months ago

The above failed after this:

 OpenFAST input file heading:
     FAST Certification Test #01: NREL 5.0 MW Baseline Wind Turbine (Onshore)

  Running ElastoDyn.
 Nodal outputs section of ElastoDyn input file not found or improperly formatted.
  Running AeroDyn.
 Warning: Turning off Unsteady Aerodynamics because polar has constant data. (node 1, blade 1)
 Warning: Turning off Unsteady Aerodynamics because polar has constant data. (node 1, blade 2)
 Warning: Turning off Unsteady Aerodynamics because polar has constant data. (node 1, blade 3)
 Using uniform blade force node clustering.
  Running ServoDyn.
  Running ServoDyn Interface for Bladed Controllers (using GNU Fortran for Linux).
 Using legacy Bladed DLL interface.
turbineData[iTurb].inflowType = 2
turbineData[iTurbLoc].inflowType 2
turbineData[iTurbLoc].numForcePtsTwr = 20
turbineData[iTurbLoc].numForcePtsBlade = 50
turbineData[iTurbLoc].numForcePts = 171
nvelpts = 35
nfpts = 171  50 20
nvelpts = 35
nfpts = 171  50 20
nvelpts = 35
nfpts = 171  50 20
nvelpts = 35
nfpts = 171  50 20
naluX: putget.m4:745: putNCvx_double_double: Assertion `value != NULL' failed.
[1]    409417 abort (core dumped)  ../../../naluX -i  -o nrel5MWactuatorLine.log

Not sure how to proceed next.

marchdf commented 2 months ago

This actually solves broken ActuatorBulkFastTests unit tests so I might push for merging this.

marchdf commented 2 months ago

Let's merge this and see if it fixes the tests. A debug run was successful. But it's unclear what happened to the segfault I was seeing... Maybe a different openfast version?