LHEEA / HOS-ocean

High-Order Spectral method for oceanic simulations
GNU General Public License v3.0
70 stars 35 forks source link

3D wave-field analysis #1

Open gducrozet opened 9 years ago

gducrozet commented 9 years ago

Wave-by-wave analysis of 3D wavefields may be enhanced.

For now, analysis is made along mean directions x and y. A 3D wave is defined when a given crest in x-direction is also a crest in the y-direction.

Main drawback of this approach is that if a wave crest is not align with y-direction (i.e. it present a given angle of propagation), algorithm will detect several waves for one real 3D wave.

erwanhafizi commented 8 years ago
  1. Is it possible to prescribe other spectrum other than JONSWAP? I think it would be more general to provide input in term of frequency, amplitude, phasing & direction of each wave component so that other type of spectrum can be used. The wave component can be generated as a pre-processing step prior to running the code.
  2. Current implementation of HOS-ocean assumed random phasing between the wave component. It is possible to prescribe focused time (tf) and focused location (xf) such that a large focused wave event can be generated?
  3. Is it possible to run the code from time not equal to zero for example t=-32s?

What part of the codes should be modified in order to achieve the above issues?

rickyspaceguy commented 8 years ago

@erwanhafizi

You need to add a new case in initial_condition.f90 for your purpose. For all three cases cited it is only necessary to initialize phis & eta in the code ( t=-32s is just a different initialization). The inputs can be read directly from a file specified or you can hard code them as done for regular waves case. The core computational procedures in resol_HOS.f90, variables_3d.f90 & filters.f90 need not be touched, a bit of HOS.f90 modification may be required depending upon the end-usage. This paper from Ducrozet et al. describes in detail the procedures & the flow of the program. Frankly, HOS-NWT code is far better organized with regards to input, output and scaling. So you can have a look at input.f90 procedures in HOS-NWT code & based on that you can modify the input_HOS.f90 procedures in order to read directly from input_HOS.dat for HOS_Ocean code. I hope Dr. Ducrozet will agree with me.

erwanhafizi commented 8 years ago

@rickyspaceguy

Many thank for your reply. I have managed to run a random wave case using the code and really impressed with the speed of the calculation. I was hoping to validate HOS-ocean with the non-linear code that I have for focused wave case and see how far I can push HOS-ocean and get a sense of the speed and accuracy of HOS-ocean. If the result is positive, the next step would be to coupled HOS-ocean with the code that I have.

gducrozet commented 8 years ago

I agree with the answer of rickyspaceguy.

For the three different points, you can modify the file 'initial_condition.f90' to achieve your purpose. This is not already done in the code but should not represent a lot of coding:

  1. The JONSWAP spectrum definition is hard coded in the variable phi_JONSWAP(:,:). You can simply create a variable corresponding to your need and make the proper replacements in subroutine initiate_irreg
  2. In the same subroutine, you have to specify the correct phasing for each components in order to achieve the focusing at the time and location specified (i.e. specify the value of "angle+angle1+angle2"). This should also be straightforward.
  3. As answered by rickyspaceguy, this is just a matter of the initial condition you choose...

Hope this helps!

Guillaume.

erwanhafizi commented 8 years ago

Hi Guillaume,

Many thanks for your reply. I'm a bit confused about the scaling/normalization used in the code. Also, there is a couple of transformation done from spatial to frequency domain and vice versa. In the 'initial_condition.f90', do I need to use the normalized or real value of the wave component? I've managed to play around with the angle but couldn't get the wave to focused at the location that I wanted.

Kind regards, Erwan

rickyspaceguy commented 8 years ago

@erwanhafizi

I'm a bit confused about the scaling/normalization used in the code

Two scalings are used computations & output. Computations happen upon nondimensional quantities only. For this length scale variable is L while time scale variable is T. For all computations & indeed for the code these are most important. The output scales are variables L_out & T_out. They are not used for computations, only for output. They are provided for convenience since any of the two i.e. wavelength or depth is used as length scale for non-dimensional output in literature. If you are still unsure set both variables i.e. L_out & T_out equal to L & T, respectively.

Also, there is a couple of transformation done from spatial to frequency domain and vice versa.

These transformations are from physical space to fourier space & vice versa. This is part of HOS theory as the boundary value problem computations are done in fourier space while time integration is done on physical space. Hence, you see the back & forth work. There are other issues like dealiasing involved but more or less this is the reason as mentioned above.

In the 'initial_condition.f90', do I need to use the normalized or real value of the wave component?

Initial condition in HOS-Ocean is used to set up the variables phis & eta. Both are non-dimensional. You can compute phis & eta values in dimensional form and then add at the end the lines

eta= eta/L 
phis = phis/(L**2/T)
Jqsong commented 6 years ago

@gducrozet Hi Guillaume, Thanks for sharing the code. I get the similar interest with erwanhafizi, to make focused waves in HOS-ocean. However, I have been troubled in some difficulties:

  1. In the 'initial_condition.f90', I found the subroutine 'initiate_irreg' but confused with the using of angle1,angle2 and angle. As I see, for changing the initial phase of each wave component, you put 'exp(i*(angle1+angle2+angle)' in the definition of 'a_eta' as well as 'a_phis'. But if added up angle1,angle2 and angle, why put the definition of those three parts of angle separated?

  2. In paper '3-D HOS simulations of extreme waves in open seas', you had adjusted reducing the interval of random number in [0,2π]. So I let the definition of angle1&angle2 change to angle1 = rnd(i1,i2,1) TWOPI 0.3_rp.but I did not get the focused phenomenon of waves in the middle of zone. I guess the simulation time need backward a little, but I don't know how to achieve it in details.Here comes some picture of my simulation in the beginning times: 0 10 40

  3. So the last question comes : how to make each wave component (m, n) propagated at its own angular frequency, during the backward propagation duration T1, and where to set the backward propagation time in the HOS-ocean code?

Kind regards, Jiaqi Song

gducrozet commented 6 years ago

@Jqsong

Thanks for your interest in the code. I will try to answer your different questions:

  1. The introduction of two random angles angle1 and angle2 is indeed not necessary and is a just a remainder of some previous tests. For the variable angle it is a single value corresponding to the mean angle of propagation

  2. You may indeed reduce the interval of random numbers to produce the focused event. Using the current set-up of initial condition, this produces the focusing event in (x,y)=(0,0) as you observe in the figures. Due to periodic boundary conditions, this is perfectly equivalent to having the event in the middle of the domain. However, it is possible to change the focusing location by defining a (spatial) phase shift of the form phase=kx(i1)*x_focus+ky(i2)*y_focus) defining x_focus=xlen_star/2 and y_focus=ylen_star/2. Then phase term should be added similar to previous angles

  3. For the backward propagation, you should use the same procedure than previously, except you have to impose a (temporal) phase shift of the forme phase=omega_n2(i1,i2)*t_focus. For both phase shifts, you should do it in the initialisation procedure for simplicity.

Jqsong commented 6 years ago

@gducrozet Thank you very much for your reply. The guidance really works ! I have done many tries recently and read the codes carefully. So when I get your advice, I could immediately set the right initial condition.

0 10

It also rises my confidence to learn more about the codes. Hope I could add some other wave spectrums to the initialisation part. Thanks again!

Kind regards, Jiaqi Song

Zeracesharon commented 6 years ago

@gducrozet Hi, dear professor, i am new to this area,i got similiar interest with erwanhafizi and my problems are follows:

  1. i want to change the initial condition using different random wave spectrum, it may be JONSWAP,ITTC,TMA or any other spectrum that i obtained from the experiment, i need to change the intial_condition as well as the input code, but for each spectrum the parameter may different , for example ,for JONSWAP it has gama,but for PM, gama does not exist.
  2. also for the post-processing, i am interested in the modes_HOS_SWENSE.dat, is it possible for me to know the potential function (or the pressure of) a certain strucuture surface (the coordinate and shape information could be lead in)? if yes, could u please give some instruction? i read several reference but mainly about HOS_Tank but no open field. 3.i also want to get some surface elevation of certain district ,i think it can be achieved by probes.dat,right? i'd really appreciate if you could give me some instruction, thank you very much! Best wishes Zerace sharon
gducrozet commented 6 years ago

@Zeracesharon Please find below some elements for your different questions:

  1. There are two different issues:
  1. For the post-processing, I advise you to look at the wrapper Grid2Grid that is meant to provide velocities and pressure at any location in the fluid domain for any time.

  2. The file prob.inp is where you specify the wave gauges locations and the result file probes.dat indeed contains the temporal evolution of each probe (i.e. the free surface elevation at a given location as a function of time).

Best regards,

Guillaume

.

Zeracesharon commented 5 years ago

@gducrozet Hi,dear professor, last time, i followed ur advice and learned much about Grid2Grid, it's very useful, and with the help of the developer(he is really nice, kindly and patiently answer my question very quickly). i got new problem during the process that i try to use HOS-ocean in my project. My question is, is it possible for me to use HOS-ocean to deal with 3D problem with nonlinear regular waves which could be coupled with Grid2Grid ? i need regular and irregular analysis so that i could simulating wave-structure interaction in both conditions? if i could, could you give some suggestions? i have noticed that in the paper "HOS-ocean: Open-source solver for nonlinear waves in open ocean based on High-Order Spectral method" , you have mentioned about the paper of Rienecker and Fenton (using stream function), but i think it's only for 2D waves, so it does not suit for my needs. Finally, i would like to show my great respect for you to guide me~ Best wishes Zerace

rickyspaceguy commented 5 years ago

Although the question is not addressed to me, you can see: "The calculation of nonlinear short-crested gravity waves. A. J. Roberts, and L. W. Schwartz".

Zeracesharon commented 5 years ago

@rickyspaceguy thank you for ur reply, i have seen that paper but to found it's mainly about incident waves and reflected waves which does not aptly suit for my needs of project in hand. But i really appreciate the paper's method and idea. i have seen previous paper that involves HOS with CFD, called SWENSE method, so i actually only want incident waves(progressive waves). And i remember HOS used to use Airy wave and second-order Stokes to initiate the system. what we are instersted in is how this nonlinearity influence the structure's 6 freedom motion response. we wanna see the difference when using the theory of linear Airy waves &pure second-order Stokes wave and the waves produced by HOS(after long propagation) considering these waves interacting with the structure, to calculating forces and motion. so here comes my question: is it possible for me to initiate HOS with Airy waves or 2nd stokes waves (for regular case)? these waves have theory solution for reference so that i could saw the difference by comparison Best wishes Zerace

rickyspaceguy commented 5 years ago

@Zeracesharon As for using Airy waves/Stokes ordered waves,you can code the analytic formulae of Stokes e.g. Fenton's fifth order solution in initial_condition.f90. I did that long ago.

However, you should also remember that you have to choose the HOS order of non-linearity. Depending on that the long-term evolution will depend upon. Say you want Airy wave to behave as linear wave, then you choose the HOS order as 1. However, then there is no point of long term evolution, the waveform won't change for order 1.

If say you initialize the wave form as Stokes second order and kept HOS order again as 1. Because of linear ordering, the initialized waveform will be taken as superposition of two linear waves of wave numbers k & 2k. So for the 2k wave you will find the circular frequency as sqrt(2gk) and not the stokes second order 2sqrt(gk). Of course since order is 1, long time evolution will also not matter.

This is just to comment on how order matters.

For more on initialization problem (Dommermuth relaxation implemented in HOS-Ocean), you can see: "The initialization of nonlinear waves using an adjustment scheme, Dommermuth".

Also, "Non-Linear Initialization in Three-Dimensional High Order Spectra Deterministic Sea State Modeling, Perignon et al"

Naaba commented 5 years ago

Hi,

What do you intend with 3D regular waves? If it is just a 2d waves extended in the 3rd dimension, a solution as Rienecker and Fenton is better than Hos ocean + grid2grid because you can compute analytically all physical quantities everywhere without interpolation.

We have one model in Lheea that we will soon opensourced.

Best, Benjamin

Le sam. 20 oct. 2018 à 03:43, Zeracesharon notifications@github.com a écrit :

@rickyspaceguy https://github.com/rickyspaceguy thank you for ur reply, i have seen that paper but to found it's mainly about incident waves and reflected waves which does not aptly suit for my needs of project in hand. But i really appreciate the paper's method and idea. i have seen previous paper that involves HOS with CFD, called SWENSE method, so i actually only want incident waves(progressive waves). And i remember HOS used to use Airy wave and second-order Stokes to initiate the system. what we are instersted in is how this nonlinearity influence the structure's 6 freedom motion response. we wanna see the difference when using the theory of linear Airy waves &pure second-order Stokes wave and the waves produced by HOS(after long propagation) considering these waves interacting with the structure, to calculating forces and motion. so here comes my question: is it possible for me to initiate HOS with Airy waves or 2nd stokes waves (for regular case)? these waves have theory solution for reference so that i could saw the difference by comparison Best wishes Zerace

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/LHEEA/HOS-ocean/issues/1#issuecomment-431538771, or mute the thread https://github.com/notifications/unsubscribe-auth/AQ_X-OYIFplirh5OPn4HCqfltdB1tfjkks5umn_ZgaJpZM4DA1EU .

Zeracesharon commented 5 years ago

@Naaba Hi, thank you for ur message. Yes, With regular waves, we only need extended 2D waves, i have also seen some references about Rienecker and Fenton, and i think the future model which will be opensourced would definitely be a perk for my research concerns interaction between regular waves and 3D structures. i'm looking forward to it! I show great gratitude for your advice and informing ! thank you ! Best wishes Zerace

gdeskos commented 4 years ago

Hi, I was wondering if there is a straightforward way to output all three velocity components at the free surface in the 3d.dat tecplot file. Currently it only outputs eta(i1,i2) and phis(i1,i2). Thanks, George

gducrozet commented 4 years ago

@gdeskos You need to modify the code accordingly in the file output.f90. This is only minor changes:

Note that the velocities at the free surface needs to be reconstructed from the surface quantities (phisx/phisy etax/etay and W).

Best regards, Guillaume

gdeskos commented 4 years ago

Hi Guillaume, Thanks for your reply. I can easily make some changes in output.f90 so that I plot the velocities. However, I am not sure what these quantities should be. I guess phisx is the x-derivative of the velocity potential and etax the x-derivative of the wave amplitude. How do I need to combine these quantities to obtain the velocity fields u, v and w ? Would it just be u=phisx, v=phisy and w=W? Best, George

gducrozet commented 4 years ago

@gdeskos In the HOS model, what is solved is the velocity potential at the free surface (phis variable), which is not directly the velocity potential (phis(x,t)=phi(x,z=eta,t)). You need to do the derivative of the composite function. It leads you to

Best, Guillaume

95nq commented 9 months ago

@gducrozet Hi,dear professor,I am just a first-year graduate student,and recently I set the initial conditions according to the image below.

image

However, when performing wave field analysis with i_ana=3, it consistently shows a small number of waves and suggests limiting it to two dimensions. When loading the VP_card.dat file in Tecplot, it displays a regular wave field with a single propagation direction. What could be the issue?

gducrozet commented 9 months ago

I think you may have a problem in your initial condition (i_case in the input file) that is not selected according to the type of wavefield you want to study.