Skip to content

Commit

Permalink
Add one more test for perpendicular direction
Browse files Browse the repository at this point in the history
  • Loading branch information
RemiLehe committed Sep 16, 2024
1 parent 1a57716 commit a408735
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,18 @@ def compare_gaussian_flux(u, w, u_th, u_m, label=""):

# Check that the normal component of the velocity is consistent with the expected distribution
r = np.sqrt(x**2 + y**2 + z**2)
un = ux * (x / r) + uy * (y / r) + uz * (z / r) # normal component
compare_gaussian_flux(un, w, u_th=0.1, u_m=0.07, label="u_n")
# Normal direction
nx = x / r
ny = y / r
nz = z / r
u_n = ux * nx + uy * ny + uz * nz # normal component
compare_gaussian_flux(u_n, w, u_th=0.1, u_m=0.07, label="u_n")

# Pick a direction that is orthogonal to the normal direction, and check the distribution
vx = ny / np.sqrt(nx**2 + ny**2)
vy = -nx / np.sqrt(nx**2 + ny**2)
u_perp = ux * vx + uy * vy
compare_gaussian(u_perp, w, u_th=0.01, label="u_perp")

# compare_gaussian(ux, w, u_th=0.1, label="u_x")
# compare_gaussian(uz, w, u_th=0.1, label="u_z")
Expand Down

0 comments on commit a408735

Please sign in to comment.