# Sea and swell in HydroDyn

**URL:** <https://forums.nlr.gov/t/sea-and-swell-in-hydrodyn/4688>\
**Category:** Computer-Aided Engineering Software Tools\
**Created:** [March 23, 2023, 1:27pm UTC](https://forums.nlr.gov/t/sea-and-swell-in-hydrodyn/4688 "2023-03-23T13:27:23Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maurizio.Collu](https://dub1.discourse-cdn.com/nrel/user_avatar/forums.nlr.gov/maurizio.collu/32/6948_2.png) [@Maurizio.Collu](https://forums.nlr.gov/u/Maurizio.Collu)\
**Post date:** [March 23, 2023, 1:27pm UTC](https://forums.nlr.gov/t/sea-and-swell-in-hydrodyn/4688/1 "2023-03-23T13:27:23Z")

</div>

Hi, I would like to know what would be the best way to simulate a two-peaks wave spectrum in HydroDyn.  
I know that the following options are available in the HydroDy.day

- Irregular (stochastic) waves based on a user-defined frequency spectrum
- Externally generated wave-elevation time series

I suppose the simplest way is to define a user-defined frequency spectrum, with two-peaks i.e. including a sea and a swell, but how is this done practically? Is there an example somewhere?

Also, woudl it be possible to simulate a sea wave spectrum coming from one direction, and a swell wave spectrum coming from another direction?

I tried to look up for this in the forum, but found nothing relevant.

Thanks

---

<div class="post-metadata">

**Author:** ![Jason.Jonkman](https://dub1.discourse-cdn.com/nrel/user_avatar/forums.nlr.gov/jason.jonkman/32/3086_2.png) [@Jason.Jonkman](https://forums.nlr.gov/u/Jason.Jonkman)\
**Post date:** [March 23, 2023, 2:26pm UTC](https://forums.nlr.gov/t/sea-and-swell-in-hydrodyn/4688/2 "2023-03-23T14:26:51Z")

</div>

Dear @Maurizio.Collu,

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](https://github.com/OpenFAST/openfast/issues)) requesting this HydroDyn enhancement?

Best regards,

---

<div class="post-metadata">

**Author:** ![Maurizio.Collu](https://dub1.discourse-cdn.com/nrel/user_avatar/forums.nlr.gov/maurizio.collu/32/6948_2.png) [@Maurizio.Collu](https://forums.nlr.gov/u/Maurizio.Collu)\
**Post date:** [March 23, 2023, 3:56pm UTC](https://forums.nlr.gov/t/sea-and-swell-in-hydrodyn/4688/3 "2023-03-23T15:56:08Z")

</div>

Thanks @Jason.Jonkman , I’ll try and let you know.

I’ve also followed your suggestion and atted the issue in the OpenFAST Github.

Kind Regards

---

<div class="post-metadata">

**Author:** ![Riad.Elhamoud](https://dub1.discourse-cdn.com/nrel/user_avatar/forums.nlr.gov/riad.elhamoud/32/5481_2.png) [@Riad.Elhamoud](https://forums.nlr.gov/u/Riad.Elhamoud)\
**Post date:** [June 7, 2023, 2:50pm UTC](https://forums.nlr.gov/t/sea-and-swell-in-hydrodyn/4688/4 "2023-06-07T14:50:04Z")

</div>

Dear @Jason.Jonkman,

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 ?

Bets Regards,

Riad

---

<div class="post-metadata">

**Author:** ![Riad.Elhamoud](https://dub1.discourse-cdn.com/nrel/user_avatar/forums.nlr.gov/riad.elhamoud/32/5481_2.png) [@Riad.Elhamoud](https://forums.nlr.gov/u/Riad.Elhamoud)\
**Post date:** [June 7, 2023, 4:00pm UTC](https://forums.nlr.gov/t/sea-and-swell-in-hydrodyn/4688/5 "2023-06-07T16:00:36Z")

</div>

Dear @Jason.Jonkman ,

I solved the problem. In fact, one should paste the time and the wave elevation in a text file (.txt). Then, go to the properties of the file and change the extension from (.txt) to (.Elev)

The following link shows how to change the extension of a file in Windows 10:

> **[Change File Extension One-by-One and in Bulk](https://www.easeus.com/partition-master/change-file-extension-in-windows-10.html)**
>
> Have you ever wondered what is the .doc or .png of your files means? Do you want to know how to change a jpg to png? Here in this article, we will tell you how to change the file extension in Windows 10, and how to change the file extension in bulk.

Best Regards,

Riad

---

<div class="post-metadata">

**Author:** ![Jason.Jonkman](https://dub1.discourse-cdn.com/nrel/user_avatar/forums.nlr.gov/jason.jonkman/32/3086_2.png) [@Jason.Jonkman](https://forums.nlr.gov/u/Jason.Jonkman)\
**Post date:** [June 7, 2023, 4:08pm UTC](https://forums.nlr.gov/t/sea-and-swell-in-hydrodyn/4688/6 "2023-06-07T16:08:12Z")

</div>

Dear @Riad.Elhamoud,

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](https://github.com/OpenFAST/openfast/issues/179). You can find the old HydroDyn driver tests from FAST v8 here: [HydroDyn | Wind Research | NREL](https://www.nrel.gov/wind/nwtc/hydrodyn.html), but these will need to be upgraded to work with OpenFAST. Regardless, the `WvKinFile` example files should provide you the needed guidance.

Best regards,

---

<div class="post-metadata">

**Author:** ![Jundong.Wang](https://avatars.discourse-cdn.com/v4/letter/j/45deac/32.png) [@Jundong.Wang](https://forums.nlr.gov/u/Jundong.Wang)\
**Post date:** [March 3, 2026, 7:30pm UTC](https://forums.nlr.gov/t/sea-and-swell-in-hydrodyn/4688/7 "2026-03-03T19:30:55Z")

</div>

Dear @Jason.Jonkman  
I’ve noticed that OpenFAST now supports wavemod = 7 in seastate. Although I’ve found example .Comp files on GitHub to understand how to set it up, I still don’t know enough about it. Where can I get more information? My most urgent question is: if I generate waves using wavemod = 7, according to the seastate.dat file, wavedir is no longer effective. So, what determines the direction of the generated waves? My wave spectrum data comes from SWAN, and I want to simulate the same wind and wave conditions as in the SWAN simulation.

Best regards,

---

<div class="post-metadata">

**Author:** ![Jason.Jonkman](https://dub1.discourse-cdn.com/nrel/user_avatar/forums.nlr.gov/jason.jonkman/32/3086_2.png) [@Jason.Jonkman](https://forums.nlr.gov/u/Jason.Jonkman)\
**Post date:** [March 3, 2026, 7:48pm UTC](https://forums.nlr.gov/t/sea-and-swell-in-hydrodyn/4688/8 "2026-03-03T19:48:14Z")

</div>

Dear @Jundong.Wang,

The use of the `WaveMod` = 7 option of SeaState is explained here: [4.11.1. Input Files — OpenFAST v4.2.0 documentation](https://openfast.readthedocs.io/en/main/source/user/seastate/input_files.html#waves). For each wave component of a given frequency, the amplitude, direction/heading, and phase of the component are specified.

Best regards,
