Convergence testing the 1st-order acoustic example
In this notebook, Schism’s immersed boundary implementation for the free surface with the 1st-order acoustic wave equation against the previously presented exact solution.
Generating stencils for Derivative(p(t, x, y), x)
Generating stencils for Derivative(p(t, x, y), y)
Generating stencils for Derivative(v_x(t + dt, x + h_x/2, y), x)
Generating stencils for Derivative(v_y(t + dt, x, y + h_y/2), y)
Operator `Kernel` ran in 0.62 s
Operator `normals` ran in 0.01 s
Generating stencils for Derivative(p(t, x, y), x)
Generating stencils for Derivative(p(t, x, y), y)
Generating stencils for Derivative(v_x(t + dt, x + h_x/2, y), x)
Generating stencils for Derivative(v_y(t + dt, x, y + h_y/2), y)
Operator `Kernel` ran in 4.14 s
Operator `normals` ran in 0.01 s
Generating stencils for Derivative(p(t, x, y), x)
Generating stencils for Derivative(p(t, x, y), y)
Generating stencils for Derivative(v_x(t + dt, x + h_x/2, y), x)
Generating stencils for Derivative(v_y(t + dt, x, y + h_y/2), y)
Operator `Kernel` ran in 1.27 s
Operator `normals` ran in 0.01 s
Generating stencils for Derivative(p(t, x, y), x)
Generating stencils for Derivative(p(t, x, y), y)
Generating stencils for Derivative(v_x(t + dt, x + h_x/2, y), x)
Generating stencils for Derivative(v_y(t + dt, x, y + h_y/2), y)
Operator `Kernel` ran in 2.59 s
Operator `normals` ran in 0.01 s
Generating stencils for Derivative(p(t, x, y), x)
Generating stencils for Derivative(p(t, x, y), y)
Generating stencils for Derivative(v_x(t + dt, x + h_x/2, y), x)
Generating stencils for Derivative(v_y(t + dt, x, y + h_y/2), y)
Operator `Kernel` ran in 13.16 s
Operator `normals` ran in 0.01 s
Generating stencils for Derivative(p(t, x, y), x)
Generating stencils for Derivative(p(t, x, y), y)
Generating stencils for Derivative(v_x(t + dt, x + h_x/2, y), x)
Generating stencils for Derivative(v_y(t + dt, x, y + h_y/2), y)
Operator `Kernel` ran in 15.08 s
Operator `normals` ran in 0.01 s
Generating stencils for Derivative(p(t, x, y), x)
Generating stencils for Derivative(p(t, x, y), y)
Generating stencils for Derivative(v_x(t + dt, x + h_x/2, y), x)
Generating stencils for Derivative(v_y(t + dt, x, y + h_y/2), y)
Operator `Kernel` ran in 48.36 s
Operator `normals` ran in 0.01 s
Generating stencils for Derivative(p(t, x, y), x)
Generating stencils for Derivative(p(t, x, y), y)
Generating stencils for Derivative(v_x(t + dt, x + h_x/2, y), x)
Generating stencils for Derivative(v_y(t + dt, x, y + h_y/2), y)
Operator `Kernel` ran in 22.40 s
Operator `normals` ran in 0.01 s
Generating stencils for Derivative(p(t, x, y), x)
Generating stencils for Derivative(p(t, x, y), y)
Generating stencils for Derivative(v_x(t + dt, x + h_x/2, y), x)
Generating stencils for Derivative(v_y(t + dt, x, y + h_y/2), y)
Operator `Kernel` ran in 22.50 s
Operator `normals` ran in 0.01 s
Generating stencils for Derivative(p(t, x, y), x)
Generating stencils for Derivative(p(t, x, y), y)
Generating stencils for Derivative(v_x(t + dt, x + h_x/2, y), x)
Generating stencils for Derivative(v_y(t + dt, x, y + h_y/2), y)
Operator `Kernel` ran in 27.83 s
Operator `normals` ran in 0.01 s
Generating stencils for Derivative(p(t, x, y), x)
Generating stencils for Derivative(p(t, x, y), y)
Generating stencils for Derivative(v_x(t + dt, x + h_x/2, y), x)
Generating stencils for Derivative(v_y(t + dt, x, y + h_y/2), y)
Operator `Kernel` ran in 34.76 s
Operator `normals` ran in 0.01 s
Generating stencils for Derivative(p(t, x, y), x)
Generating stencils for Derivative(p(t, x, y), y)
Generating stencils for Derivative(v_x(t + dt, x + h_x/2, y), x)
Generating stencils for Derivative(v_y(t + dt, x, y + h_y/2), y)
Operator `Kernel` ran in 42.36 s
Operator `normals` ran in 0.01 s
Generating stencils for Derivative(p(t, x, y), x)
Generating stencils for Derivative(p(t, x, y), y)
Generating stencils for Derivative(v_x(t + dt, x + h_x/2, y), x)
Generating stencils for Derivative(v_y(t + dt, x, y + h_y/2), y)
Operator `Kernel` ran in 51.60 s
Operator `normals` ran in 0.01 s
Generating stencils for Derivative(p(t, x, y), x)
Generating stencils for Derivative(p(t, x, y), y)
Generating stencils for Derivative(v_x(t + dt, x + h_x/2, y), x)
Generating stencils for Derivative(v_y(t + dt, x, y + h_y/2), y)
Operator `Kernel` ran in 60.17 s
Operator `normals` ran in 0.01 s
Generating stencils for Derivative(p(t, x, y), x)
Generating stencils for Derivative(p(t, x, y), y)
Generating stencils for Derivative(v_x(t + dt, x + h_x/2, y), x)
Generating stencils for Derivative(v_y(t + dt, x, y + h_y/2), y)
Operator `Kernel` ran in 72.86 s
Operator `normals` ran in 0.01 s
Generating stencils for Derivative(p(t, x, y), x)
Generating stencils for Derivative(p(t, x, y), y)
Generating stencils for Derivative(v_x(t + dt, x + h_x/2, y), x)
Generating stencils for Derivative(v_y(t + dt, x, y + h_y/2), y)
Operator `Kernel` ran in 87.00 s
Operator `normals` ran in 0.01 s
Generating stencils for Derivative(p(t, x, y), x)
Generating stencils for Derivative(p(t, x, y), y)
Generating stencils for Derivative(v_x(t + dt, x + h_x/2, y), x)
Generating stencils for Derivative(v_y(t + dt, x, y + h_y/2), y)
Operator `Kernel` ran in 93.06 s
Plotting the convergence, we can see we have an approximately fourth-order trend, and a knee at a grid increment of around \(\Delta x = 0.02\), after which the order of convergence drops off somewhat.
import matplotlib.pyplot as pltimport numpy as npplt.loglog(2*np.pi/(240*np.array(refinements)), errs_max, 'kx')plt.loglog(2*np.pi/(240*np.array(refinements)), errs_max, 'k')plt.title("Convergence of the 4th-order scheme")plt.xlabel("Grid increment")plt.ylabel("Maximum error")plt.savefig("convergence_plot_1st_order")plt.show()
Finding the convergence gradient in the upper section of the curve, it is observed that the scheme attains just short of 4th-order.