Gug-Young / Shallow_water_with_viscosity

Simulations for dam breaks and viscous fluids
4 stars 0 forks source link

droplet_simulation #9

Open DmStrkIndstrs opened 2 years ago

DmStrkIndstrs commented 2 years ago

[try1] - droplet이가운데에 위치한 모습

h = np.ones(N_x)0.8 drop = np.exp(-((x-L_x(0.55))*2/(2(0.05E+2)**2))) h = h+ drop

h[:300]= 2

slope = lambda x,b,L: (x>=b)(x-b)(L/(L_x-b)) dam = lambda x,a,b,L: ((x>=a)&(x<=b))*L

u = np.zeros(N_x) z = np.ones(Nx)*0.5 s = slope(x,0,1) d = dam(x,10,30,3) z = z + s z = np.zeros(N_x)

h = np.where(h>=z,h-z,0) plt.plot(h) plt.show()

z[150:200]=0

fig, (axh,axu) = plt.subplots(2, 1,facecolor ='white') line_u,=axu.plot(x,u) lineh,=axh.plot(x,h+z) fill=axh.fillbetween(x,z,z,color ='tab:orange')

Gug-Young commented 2 years ago

h = np.ones(N_x)0.2 drop = np.exp(-((x-L_x(0.7))*2/(2(0.05E+2)*2)))1.5 h = h+ drop

h[:300]= 2

slope = lambda x,b,L: (x>=b)(x-b)(L/(L_x-b)) dam = lambda x,a,b,L: ((x>=a)&(x<=b))*L

u = np.zeros(N_x) z = np.ones(Nx)*0.1 s = slope(x,0,1.5) d = dam(x,10,30,2) z = z + s z = np.zeros(N_x)

h = np.where(h>=z,h-z,0) plt.plot(h) plt.show()

z[150:200]=0

fig, (axh,axu) = plt.subplots(2, 1,facecolor ='white') line_u,=axu.plot(x,u) lineh,=axh.plot(x,h+z) fill=axh.fillbetween(x,z,z,color ='tab:orange')