about simulate ocean wave

Asked by bin deng

Hello all,

I'm trying to use flowengine to simulate wave pressure, such as stationary wave( e.g. p=Asin(t/T)cos(x/L)). However, I fail to simulate it by using waveAction, sinMagnitude and sineAverage. On the other hand, I find that the pore pressure first occurs build-up and then slowly decreases to zero. I hope the pressure condition can always change with the cycle.

Thanks to Robert, I modify my code according to his guidance. Here is my code:

## ______________ FLOW section _________________
# Activate flow engine and set boundary conditions
flow.waveAction=1
A=500
T=0.5
avg=0
t=O.time
scale=math.sin(2*pi*t/T)
flow.bndCondIsPressure=[0,0,0,1,0,0]
flow.updateTriangulation=True
flow.meshUpdateInterval=50
flow.sinMagnitude=A*scale
flow.sineAverage=avg*scale
O.dt=0.1e-3
O.run(1,1)
*************************************************************************

As shown above, though waveAction can allow sinusoidal pressure condition to simulate ocean wave, I still don't know what is the simulated pressure expression and how to take into account of the pressure varies with the cycle and x variables.

Thank you for any suggestions.

Best,
Deng

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
bin deng
Solved:
Last query:
Last reply:
Revision history for this message
Robert Caulk (rcaulk) said :
#1

Hey Deng,

This is a duplicate thread, this question belongs in the thread we were working in before [1] since the content has not changed.

Why did you remove the while loop? Without it, your pressure will not change with time. Here is the code I recommended from the other thread:

Set up scene
Set up flow with flow.waveAction = True

A = some amplitude
avg = some average
time = some time
t = 0
while t < time:
    t = O.dt*O.iter
    scale = np.sin(t/time)
    flow.sineMagnitude = A*scale
    flow.sineAverage = avg*scale
    flow.updateTriangulation = True
    O.run(some steps)

w.r.t spatial variation, waveAction does this with sineMagnitude and sineAverage. The pressure at one end of the specimen is sineAverage-sineMagnitude and the pressure at the other end is sineAverage+sineMagnitude. waveAction uses 30 intervals along the specimen to interpolate the pressures between the ends according to your description of the sine wave.

[1]https://answers.launchpad.net/yade/+question/593653

Revision history for this message
Robert Caulk (rcaulk) said :
#2

See other thread [1] for Bruno's recommended solution, it is more efficient.

[1]https://answers.launchpad.net/yade/+question/593653

Revision history for this message
bin deng (dengbintju) said :
#3

Thanks Robert, that solved my question.