← Back to team overview

yade-users team mailing list archive

Re: [Question #601679]: about simulate ocean wave

 

Question #601679 on Yade changed:
https://answers.launchpad.net/yade/+question/601679

    Status: Open => Answered

Robert Caulk proposed the following answer:
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

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.