Wave series as boundary condition

Hi,

I’m trying to set up a TOMAWAC-model for a smaller bay. I already have wave-data for the outer boundary of the bay. This wave data is in the format of Hs, Tp, and direction and values are given every hour. I wonder if it is possible to use this wave-file as input to the model?

Thanks!

hello

Unfortunately this is not (yet) implemented in Tomawac and you have to use a fortran user to read your file in the routine limwac and then call speini to initialize the variance spectrum.

[name removed]

Hello,

I meddled with this topic sometime ago, and this is what I came up with. You are welcome to use it and/or modify it to accommodate your needs. If you make improvements/corrections, please let me know.

Let me know if it works out.

[name removed]

princi.f (10.9 KB)
offshore_boundary_waves.txt (3.54 KB)

2 Likes

Thank you!

I got it running, but the model don’t seem to consider the input from the file.

Can you please attach a cas-file were you have implemented the princi.f (I assume I miss something in my cas-file).

Hello,

Here is what I had in my *.cas file:

FORTRAN FILE = 'princi.f'

LIMIT SPECTRUM MODIFIED BY USER = YES

FORMATTED FILE 1 = 'offshore_boundary_waves.txt'



STEERING FILE ='file.cas'

GEOMETRY FILE = 'file.slf'

BOUNDARY CONDITIONS FILE = 'file.cli'

Hope it helps,

[name removed]

Hello,

I’m actually working on the same subject, implementing wave series as boundary condition on TOMAWAC and coupling those results to TELEMAC2D. I’ve used your attachments in previous message.

I’ve tried to compile my .cas file but this error occured :

"**** ERROR LIMWAC ****

YOU DID NOT MODIFY THE BOUNDARY SPECTRUM WHEREAS YOU ASK fOR THAT".

I’ve found that this error comes from LIMWAC.f so does it mean that tomawac doesn’t take into account my own fortran file ? If it’s the case, how could I do to solve my problem ?

I’ve attached my files to explain my words.

Many thanks,

[name removed]

cas_telemac.cas (3.43 KB)
fichier_tomawac.cas (2.54 KB)

Hello,

In one of your steering files the keyword LIMIT SPECTRUM MODIFIED BY USER = YES, and in the other it is set to NO [by default]. Could this be the offending keyword?

Also, I didn’t see the initialization and specification of the spectrum parameters in the *.cas file. Can you try running a case first with a wave that doesn’t vary in time. Does it work?

[name removed]

Hello,

I think that LIMIT SPECTRUM MODIFIED BY USER is not in the vocabulary of TELEMAC2D so I didn’t need to set differently.

I’ve tried to simulate a wave only with initial condition and not with specific boundaries, is that what you mean by a constant wave ? But unfortunatly, Telemac2d still doesn’t present what I expect.

Many thanks,

[name removed]

Hello,

LIMIT SPECTRUM MODIFIED BY USER is a TOMAWAC keyword, and should be set to TRUE in the TOMAWAC steering file.

I think you have to have both initial and boundary conditions for the simulation to be valid and have reasonable results. I meant try setting boundary conditions for a case where waves don’t vary with time. There should be plenty of examples of this.

[name removed]

Now our model works (mine and SEBJAMs) but we are not fully satisfied with the output. The simulated wave heights are not as smooth as the input on the boundary. I have attached both the cas-file and a picture comparing the results and the input boundary data. It seems to get better when I decrease the time step but the computation is taking unreasonable long time if I lower it much more (now 60 s).

We would appriciate any help on this and other tips on how to decrease the computaion time!

SkaldW_v1-0_Sven.cas (3.51 KB)

Now our model works (mine and SEBJAMs) but we are not fully satisfied with the output. The simulated wave heights are not as smooth as the input on the boundary. I have attached both the cas-file and a picture comparing the results and the input boundary data. It seems to get better when I decrease the time step but the computation is taking unreasonable long time if I lower it much more (now 60 s).

We would appriciate any help on this and other tips on how to decrease the computaion time!

SkaldW_v1-0_Sven_2015-03-30.cas (3.51 KB)

Hello,

Sorry it took this long to reply.

I know there are guidelines on how to select a time step in TOMAWAC. Please have a look at post 4323.

Perhaps there is something in the mesh geometry that could be responsible for creating the osculations you are seeing. Do you have elements with steep change in bathymetry? What about mesh size?

I don’t know for sure this is a problem, but it is certainly worth investigating.

[name removed]

Thanks for your reply!

I have tried time steps down to 1 s but it doesn’t solve the problem. I have narrowed down the problem to appear when the wind direction changes. I have changed my input wave file to steps in the wind direction instead of constantly varying, and then the instability disappears (whith a time step of 3600 s). I will continue with some more tests and see if I can solve the problem - I will try your idea to smooth the bathymetry along the boundary.

Also I found that it is not possible to set NUMBER OF DIRECTIONS = 360 - why is that so?

[name removed]

Hello,

Just an answer on the number of directions :

If NA is the number of angles, ND the number of directions and NP the number of points in the mesh, the number of unknowns in Tomawac is NANDNP, and several arrays of this size have to be allocated, this is why 360 directions is probably too many.

With best regards,

[name removed]-Michel Hervouet

1 Like

Hello ,

I modified the limwac.f routine and although the wave height and peak frequency are

transferred alright to the boundary nodes of my mesh, the direction does not fit the entry from the file. I entered a print*, to my fortran file to check the direction and the calculation is correct. Is there any other subroutine where I can modify the variable TETA1L?

I have attached my fortran file

fortran_2016-01-12.f (11.6 KB)

many thanks

[name removed]

Hello,

I’m trying to do the same thing as [name removed] but also with spatial varying conditions.

I have begun with a constant in time and space series just to check where it is the best place to hook in the code.

First try : Modification in Limwac.f

Hm0,FPICL and TETA1L just hard coded in Limwac.f. It is the same “spirit” than [name removed] code but simplified.

FPICL is exactly represented. Hm0 seems to be well represented (delta varying around 0.001 between code and results). TETA1L is not well represented at all (in my example, asked 330, represented 187…)

Second try : Modification in Speini.f

Hm0,FPICL and TETA1L just hard coded in Speini.f.

Results are the same than 1st try : it is not satisfying for TETA1L. I just think the second try will be better for space varying (loop on boundary point…)

As a conclusion, even if I have tried another way, I have basically the same issue than [name removed]…

Does somebody have an idea ?

Regards

Hello [name removed]

the problem with TETA1L is that the value of direction is multiplied by pi/180.

So when you modify limwac.f routine after all your interpolation just multiply TETA1L with pi/180 and it will read the correct direction.

[name removed]

1 Like

[name removed],

Thank you for your advise, I have just checked it is working now!

Regards

Hi [name removed],

This topic have been discussed what I am doing. There is something that I have not understood clearly. it maybe some stupid questions but I have to ask :stuck_out_tongue:

  1. Why do we have to prescribe initial boundary conditions when we already use wave series at the boundary?

  2. Regarding types of boundary conditions in TOMAWAC, there are only two kinds of boundary conditions (P.70 in operational manual V7.1). My 2nd question is (not really related to this topic): in case of coupling with TELEMAC2D using THOMPSON boundary option, do I need to prescribe the boundary condition? and how?

I am confusing this because in the operational manual I don’t understand some words, by highlighting here:

"Only two kinds of boundary conditions are available in TOMAWAC.

The first one corresponds to a free boundary i.e. a boundary that fully absorbs the wave energy. It may be a liquid boundary: it is then assumed that the waves propagate beyond the domain and nothing else enters it. It may be a solid boundary: it is then assumed that the shore fully absorbs the wave energy.

The second one corresponds to a boundary with a prescribed value. In this case the wave action spectrum is then strictly imposed at each point along that boundary. This boundary condition allows wave energy to enter the computational domain"

Thank you all for sharing your knowledge and experience!

[name removed]

I am not sure to well understand your question, but I have tried to answer!

  1. When you use wave series and so user program, you choose where you enter in the code and what you modify. Maybe your code overwrite the case file values and you don’t “use it”. You can check easily putting different values in the wave series and the case file and see the results.

  2. Boundary conditions : as you say there is only two types and you define it on the boundary condition file.

Regards