def f2(z, t): """2x2 system for sphere with Re-dependent drag.""" zout = np.zeros_like(z) v = abs(z[1]) Re = v*d/nu CD = cd_sphere(Re) alpha = 3.0*rho_f/(4.0*rho_s*d)*CD zout[:] = [z[1], g - alpha*z[1]**2] return zout
def f(z, t): """4x4 system for smooth sphere with drag in two directions.""" zout = np.zeros_like(z) C = 3.0 * rho_f / (4.0 * rho_s * d) vrx = z[2] - vfx vry = z[3] - vfy vr = np.sqrt(vrx**2 + vry**2) Re = vr * d / nu CD = cd_sphere(Re) # using the already defined function zout[:] = [z[2], z[3], -C * vr * (CD * vrx), C * vr * (-CD * vry) - g] return zout
def f(z, t): """4x4 system for smooth sphere with drag in two directions.""" zout = np.zeros_like(z) C = 3.0*rho_f/(4.0*rho_s*d) vrx = z[2] - vfx vry = z[3] - vfy vr = np.sqrt(vrx**2 + vry**2) Re = vr*d/nu CD = cd_sphere(Re) # using the already defined function zout[:] = [z[2], z[3], -C*vr*(CD*vrx), C*vr*(-CD*vry) - g] return zout