4.5. Ondes de gravité et surface libre#

Marc BUFFAT, département mécanique Lyon 1

ondes de surface

%matplotlib inline
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
from IPython.core.display import HTML
import matplotlib.animation as animation
from matplotlib import rc
from metakernel import register_ipython_magics
register_ipython_magics()
from IPython.display import YouTubeVideo

YouTubeVideo('MNyebpog_i0', width=600, height=400)

4.5.1. Equation des ondes de surface#

soit \(h(x,t)\) la variation de la hauteur d’eau dans un bassin de longueur \(L\) et \(u(x,t)\) la perturbation de vitesse horizontale. Les équations de SAint Venant linéarisées s’écrivent:

  • bilan de masse:

\[ \frac{\partial h}{\partial t} + h_0 \frac{\partial u}{\partial x} = 0 \]
  • bilan de qte mouvement horizontal

\[ h_0\frac{\partial u}{\partial t} + g h_0 \frac{\partial h}{\partial x} = 0 \]

Il peut se développer des ondes de surface dans un bassin de longueur L, solution de l’équation des ondes:

\[\frac{\partial^2 h}{\partial t^2} - c_0^2\frac{\partial^2h}{\partial x^2}=0\]

avec des conditions aux limites \(\frac{\partial h}{\partial x}(0,t) = \frac{\partial h}{\partial x}(L,t) = 0\) :

  • solution élémentaire: onde stationnaire $\(hk(x,t)=A_{k}\cos(\frac{k\pi x}{L})\cos(\frac{k\pi c_{0}t}{L})\)$

  • solution générale $\(h'(x,t)=\sum_{k}A_{k}\cos(\frac{k\pi x}{L})\cos(\frac{k\pi c_{0}t}{L})\)$

4.5.1.1. paramètres#

  • g gravité

  • h0 hauteur d’eau

  • a0 amplitude perturbation

  • L longueur bassin

Influences des paramètres sur le mouvement des ondes ?

# parametres
g=10.0
h0=1.
a0=0.1
c0=np.sqrt(g*h0)
L =20.
Np=128
X=np.linspace(0,L,Np,endpoint=False)
print("parametres célérité= {:.2f}m/s   h0/L={:.3f}  a0/h0={:.3f}".format(c0,h0/L,a0/h0))
parametres célérité= 3.16m/s   h0/L=0.050  a0/h0=0.100

4.5.1.2. solution élémentaire: onde stationnaire#

# solution elementaire CL de tye Neuman
def hk(k,x,t):
    global c0,L
    return np.cos(k*np.pi*x/L)*np.cos(k*np.pi*c0*t/L)
# solutions elementaires
plt.rc('font', family='serif', size='18')
plt.figure(figsize=(12,4))
plt.plot(X,hk(1,X,0),label="k=1")
plt.plot(X,hk(2,X,0),label="k=2")
plt.plot(X,hk(3,X,0),label="k=3")
plt.plot(X,hk(16,X,0),label="k=16")
plt.plot(X,np.zeros(X.size),'-k',lw=2)
plt.legend()
plt.title("Solutions élémentaires")
plt.xlabel('x')
plt.ylabel('h');
../../_images/ef59d61a723ff50100415edca5d4822bc1a2cafb1b8cc4a36fa0477c0e5bc955.png
#%activity /usr/local/commun/ACTIVITY/MGC3062L/questionOndeStationnaire

4.5.1.2.1. animation#

# choix du mode
mode=8
#
periode=2*L/(mode*c0)
t=np.linspace(0,2*periode,41)
fig = plt.figure(figsize=(10,4))      
ax  = plt.axes()
line, = ax.plot([], [],linewidth=2)  
plt.axis((0,L,-1.,0.5))
plt.title("ondes stationnaire mode={}".format(mode))
plt.xlabel('x')
plt.ylabel('h(x,t)')
def plot_mode(t):
    Y = a0*hk(mode,X,t)
    line.set_data(X,Y) 
    
anim=animation.FuncAnimation(fig, plot_mode, frames=t)
../../_images/c135e06e10936768a074420122ac6affb8975466a940180deeddeb624c9fcfed.png
rc('animation', html='jshtml')
anim

4.5.1.3. calcul de la vitesse u(x,t)#

\[ \frac{\partial u}{\partial t} + g\frac{\partial h}{\partial x} = 0\]
def uk(k,x,t):
    global c0,L,g
    return (g/c0)*np.sin(k*np.pi*x/L)*np.sin(k*np.pi*c0*t/L)
mode=2
plt.figure(figsize=(12,4))
plt.plot(X,a0*uk(mode,X,2),label="u(x,t)")
plt.plot(X,a0*hk(mode,X,2),label="h(x,t)")
plt.plot(X,np.zeros(X.size),'-k',lw=2)
plt.legend()
plt.title("vitesse et hauteur mode {}".format(mode))
plt.xlabel('x')
plt.ylabel('h');
../../_images/8e4b24743db5d82e7f86c2dbfa02d531cd62b987093844a6813f49164e85d753.png

4.5.1.3.1. Animation#

mode = 2
periode=2*L/(mode*c0)
t=np.linspace(0,2*periode,41)
XP = np.linspace(0,L,11)
YP = -0.25*np.ones(XP.size)
UP = a0*uk(mode,XP,0)+1.e-3
VP = np.zeros(UP.size)
fig = plt.figure(figsize=(12,4))
ax  = plt.axes()
plt.axis((0,L,-1.,0.5))
Q   = ax.quiver(XP,YP,UP,VP,scale_units='xy',scale=0.1)
Line, = plt.plot(X,a0*hk(mode,X,2),label="h(x,t)")
plt.title("vitesse et hauteur mode {}".format(mode))
def plot_mode(t):
    Y  = a0*hk(mode,X,t)
    Line.set_data(X,Y)
    UP = a0*uk(mode,XP,t)+1.e-3
    Q.set_UVC(UP,VP)
#
anim=animation.FuncAnimation(fig, plot_mode, frames=t)
../../_images/9cff745672d23f88efc2c73dfd7073fe221db35e0c63192fc9aec18df7ebcc0d.png
rc('animation', html='jshtml')
anim

4.5.1.4. décomposition en ondes progressives#

utilisation de l’identité trigonométrique

\[ \cos a \cos b = \frac{1}{2} (\cos(a+b) + \cos(a-b))\]
# ondes progressive et régressive
def hkp(k,x,t):
    global c0,L
    return 0.5*np.cos(k*np.pi*(x-c0*t)/L)
def hkm(k,x,t):
    global c0,L
    return 0.5*np.cos(k*np.pi*(x+c0*t)/L)
mode = 5
t0 = 2*L/(mode*c0)/4
plt.figure(figsize=(10,4))
plt.title("ondes progressives mode={}".format(mode))
plt.xlabel('x')
plt.ylabel('h(x,t)')
plt.plot(X,a0*hk(mode,X,t0),label="h")
plt.plot(X,a0*hkp(mode,X,t0),label="h+")
plt.plot(X,a0*hkm(mode,X,t0),label="h-")
plt.legend();
../../_images/9740b18f30588e1c71b3b6a91608e9e254e60a9a33e5bea236bbcf65a83017c6.png

4.5.1.4.1. Animation#

periode=2*L/(mode*c0)
t=np.linspace(0,2*periode,41)
fig = plt.figure(figsize=(10,4))      
ax  = plt.axes()
line1, = ax.plot([], [],linewidth=2,label="h+") 
line2, = ax.plot([], [],linewidth=2,label="h-") 
plt.axis((0,L,-0.5,0.25))
plt.title("ondes progressives mode={}".format(mode))
plt.xlabel('x')
plt.ylabel('h(x,t)')
plt.legend()
def plot_mode(t):
    Y1 = a0*hkp(mode,X,t)
    line1.set_data(X,Y1)
    Y2 = a0*hkm(mode,X,t)
    line2.set_data(X,Y2)
    return
anim=animation.FuncAnimation(fig, plot_mode, frames=t)
../../_images/8622571a5f7c48cb762f69eca8b3b8440211cd62579436b73a1527221da019cd.png
rc('animation', html='jshtml')
anim