erdc / proteus

A computational methods and simulation toolkit
http://proteustoolkit.org
MIT License
88 stars 56 forks source link

CNW with CombineWaves, RandomWaves, NewWave #1268

Closed ghylander closed 2 years ago

ghylander commented 2 years ago

Hi, I'm looking to create a CNW (Time Domain Simulation of Jack-up Dynamics With the Extremes of a Gaussian Process, Taylor et al 1997) eta time series

I'm trying to generate it using the wavetools module, but I'm unsure about certain steps to create the involved classes.

First, I'm trying to create the NewWave object. I had previously implmented this myself, approaching the problem by assuming very large water depth, unidirectional waves, etc After reading through the NewWave class help and looking at the source code, I'm having a bit of trouble generating the NewWaveobject using these simplifications How would I approach this? I assume that I can pass a 1-element array to both the waveDir and g arguments to only consider a single wave direction, but is there any way of considering water depth large (so tanh(kd) ≈ 1)? Does inputting a sufficiently large depth parameter (i.e., ~500m) work?

Additionally, I'm unsure what the mwl argument is used for, or how is it defined. I assume it's a parameter used to calculate the velocity of wave particles, but I'm not interested in that output. Is it possible to not input such argument (or inputting a "garbage" without it affecting the eta time series)?

These doubts apply to the RandomWaves class too (mwl, depth, waveDir and g)

Finally, regarding the generation of a CNW, would the CombineWave class be a suitable match? The docs and source code provide little insight on the inner workings of the class

adimako commented 2 years ago

hello @ghylander. Few points to help you:

ghylander commented 2 years ago

Hi @adimako, thanks for your comment.

The first two points (regarding mwl and depth) were very insightful. I didn't understand the difference between the two. Now I understand the former is the distance between the z=0 origin and the water surface point and the letter the actual distance between the surface and the seabed.

Thanks for the comments on how to input the waveDir and g parameters, I had the wrong idea about how to input them.

Thanks for your comments! I was able to succesfully create the objects and execute the eta and writeEtaSeries methods.

I also have found that the wavetools.NewWave.writeEtaSeries() method does not write the results to file (as it seems it should do) Nevermind, there was a permission error exception being silently caught

Finally, my question regarding the suitability of the CombineWaves class to create a Constrained NewWave eta tiemseries from the NewWave and RandomWaves objects does remain.

cekees commented 2 years ago

The CombineWaves class assumes the principle of superposition applies to solutions. That is, it sums wave heights (or velocities) over the list of wave objects ("wave conditions") provided by the user: https://github.com/erdc/proteus/blob/main/proteus/WaveTools.py#L3328.

ghylander commented 2 years ago

I see thanks

Would you be interested in a CNW theory implementation for proteus? I can provide the basic python code, but I don't have experience with cython to the point where I could fully implement it

cekees commented 2 years ago

Yes, probably the thing to do is get things implemented in WaveTools.py first, along with tests covering the new class added to https://github.com/erdc/proteus/blob/main/proteus/tests/wave_tests/test_wavetools.py. The process is basically to fork proteus and then do a pull request from your fork with your changes. The general requirements for accepting a PR are that it provides something useful and does not decrease test coverage. We can worry about optimizing it via Cython or pybind once the pure Python PR is ready to merge. @adimako may have more comments on what constitutes useful functionality for the WaveTools module--he is the main author of that. If you wanted to continue with the PR, you can close this issue. We can discuss further once you have an initial PR.

ghylander commented 2 years ago

Some notes before I get to work and opening a PR

How would you like the class to be used? To apply the theory, first one would create a random wave, with its own Hs, Tp, etc Then, the NewWave is generated (using the appropriate Hs, Tp, etc). The NewWave formula is not applied, however. Only the auto-correlation function (or unit NewWave) is needed. The required parameters for the CNW are the following:

image (image source: Non-Linear Analysis of Jack-Up Structures Subjected to Random Waves, M. Cassidy 1999)

(1) The random waves surface elevation time series ηrw(t) (2) The unit NewWave r(t) (3) The NewWave scaling factor (α, Acr or wt.NewWave() 'Hs' parameter) (4) The random waves surface elevation at t=tf or wt.NewWave() 'tfocus' parameter) (5) The unit NewWave slope ṙ(t) (5*) λ2, extracted from the 2nd spectral moment of the wave energy spectrum (m22·σ2) (6) The constrained surface slope ἁ (for a crest, ἁ=0) (7) The random waves surface elevation at t=tf

And the auto-correlation function or unit NewWave (r(t) or ρ(t)) is defined as (A new model for the kinematics of large ocean waves-application as a design wave, Tromans 1991): image Where τ= t - tf,

Given all of this, how would you like the class to be constructed? Do you want to generate a RandomWaves object and pass it to the ConstrainedNewWave class? Do you want the random waves to be generated fully inside the ConstrainedNewWave class? How do you want to define at what point in time inside the random waves eta series the NewWave is constrained? (In the equation above, t=0 is defined as tf)

Any option is good for me, but how do you want the object to be constructed by the user?