指定した物理モデルをプログラミング言語で実装してください。
物理モデル：数値流体力学モデル
プログラミング言語：Python
import numpy as np
import matplotlib.pyplot as plt

def scale_velocity(u, v):
    ''' scale velocity for numerical stability '''
    u_max = np.max(np.abs(u))
    v_max = np.max(np.abs(v))
    u_norm = np.sqrt(u**2 + v**2)
    u_scaled = u / u_norm
    v_scaled = v / u_norm
    return u_scaled, v_scaled

def step(u, v, dt, dx, dy, Viscosity):
    ''' compute equation to calculate velocity at the next step  '''
    u_new = u + ((Viscosity * dt / dx**2) * (u[1:, :] - 2 * u[1:, :] + u[:-1:, :])
                + (Viscosity * dt / dy**2) * (u[:, 1:] - 2 * u[:, 1:] + u[:, :-1:]))
    v_new = v + ((Viscosity * dt / dx**2) * (v[1:, :] - 2 * v[1:, :] + v[:-1:, :])
                + (Viscosity * dt / dy**2) * (v[:, 1:] - 2 * v[:, 1:] + v[:, :-1:]))
    # scale velocity
    u_new, v_new = scale_velocity(u_new, v_new)
    return u_new, v_new

# compute velocity at the next step
u_new, v_new = step(u, v, dt, dx, dy, Viscosity)