To generate irregular waves with a wave spectrum that includes two peaks, I agree that you could use WaveMod = 4 (user-defined spectrum) or 5 (user-defined wave elevation time series) as you propose. Using WaveMod = 4 will require that you implement in source code the spectrum within SUBROUTINE UserWaveSpctrm(), a template of which is provided in the Waves.f90 source file of HydroDyn, and recompile OpenFAST.
HydroDyn does not currently make it easy to define irregular waves with a wind waves and a swell waves coming from different directions. You could always use WaveMod = 6 (user-defined full wave kinematics), but that is a bit of a pain. OpenFAST v4.0 will include a major upgrade to HydroDyn, including the inclusion of a WaveMod = 7 option (user-defined waves based on frequency components) that will make it easier to define direction-dependent wave data. That said, we should add to the HydroDyn to-do list even easier approaches to define irregular waves with wind waves and a swell waves coming from different directions. Would you like to add a feature request to the OpenFAST issues page (Issues · OpenFAST/openfast · GitHub) requesting this HydroDyn enhancement?
I want to simulate the spar OC3 Hywind in OpenFAST in the case of user-defined wave elevation time series. I read in HydroDyn module that is possible to do this but one should set WaveMod=5 in HydroDyn input file. According to HydroDyn Manual, the externally generated wave data is provided through input files, all of which have the root name given by the WvKinFile.
I searched a lot but i did not succeed to find an example of the input file. Even in the r-test, none of them contain externally generated wave data.
Could you please share with the community an example of such input file ?
I’m not aware of any OpenFAST test cases that support WaveMod = 5 or 6. There were some tests in the old HydroDyn driver of FAST v8 that supported WaveMod = 5 or 6, but it doesn’t appear that these have been ported over to the OpenFAST r-test per OpenFAST issue #179. You can find the old HydroDyn driver tests from FAST v8 here: HydroDyn | Wind Research | NREL, but these will need to be upgraded to work with OpenFAST. Regardless, the WvKinFile example files should provide you the needed guidance.