Welcome, Guest
Username: Password: Remember me

TOPIC: Power spectrum outputs in TOMAWAC

Power spectrum outputs in TOMAWAC 7 years 7 months ago #25880

  • huyquangtran
  • huyquangtran's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 271
  • Thank you received: 23
Dear All,

I would like to know if there is any way to get the outputs from TOMAWAC that we can see the contribution of wave power over different frequencies at every time step like this:
untitled.jpg



Thanks & Best Regards

Huy
The administrator has disabled public write access.

Power spectrum outputs in TOMAWAC 7 years 7 months ago #25883

  • Phelype
  • Phelype's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 140
  • Thank you received: 64
If I understand your question, what you want is to save the spectrum as an output variable, like HM0, am I correct?

If so, there is a problem here. TOMAWAC, although treated as a 3D model (the directions as the third dimension), only saves 2D results, integrating the wave spectrum at each step.

What you would need to do, in that case, is to program yourself the output of the spectrum to a selafin file other than the standard results file, since it would need to be 3D.

It is fairly simple to do, but quite expensive in terms of disk space (saving a value for all the mesh nodes, all the directions and all the frequencies).

If this is what you want, I may be able to help, as I already done something like that.

Best regards,

Phelype
The administrator has disabled public write access.
The following user(s) said Thank You: huyquangtran

Power spectrum outputs in TOMAWAC 7 years 7 months ago #25889

  • huyquangtran
  • huyquangtran's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 271
  • Thank you received: 23
Dear Phelype

what you said is the one I need.. so could you help?

Thank you a lot in advance,

Best Regards
HUY
The administrator has disabled public write access.

Power spectrum outputs in TOMAWAC 7 years 7 months ago #25914

  • Phelype
  • Phelype's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 140
  • Thank you received: 64
Huy,

I attached a modified version of the wac.f subroutine. My modifications are in the lines 111-124, 815-848, and 1137-1152.

The first part is the declaration of a few auxiliary variables;
The second part is the writing of the selafin file header and;
The third part is the writing of the spectrum at each time step.

What I did was create an additional selafin file (It can be read with any tool that works with selafin files; Blue Kenue, Matlab, Python) containing the wave spectrum at each mesh node.

Each of the discretized frequencies is saved as a variable in the selafin file.

There are two problems with this:
- The first is it only saves the integrated spectrum (as you showed in the picture), not the directional spectrum. Although this can be easily modified making a 3D selafin file, with the "third direction" being the discretized directions.
- It does not work in parallel. I had little time to work with this project, so it is rather crude. To make it work in parallel you'd need to create scheme to make each processor save its own result (like tomawac does) or, create a communication structure between the processors to broadcast the spectrum at each saving step. But I'll leave that to you ;D

This is not an elegant solution but, for a start, it works.

Hope it helps. Any trouble, feel free to contact me.

Best regards,

Phelype
Attachments:
The administrator has disabled public write access.
The following user(s) said Thank You: huyquangtran
Moderators: tfouquet

The open TELEMAC-MASCARET template for Joomla!2.5, the HTML 4 version.