Skip to content
Snippets Groups Projects
Commit 7de066f8 authored by Bert Vandenbroucke's avatar Bert Vandenbroucke Committed by Matthieu Schaller
Browse files

Hydro test fixes

parent 5baeeec0
No related branches found
No related tags found
8 merge requests!1715Update planetary strength after planetary plus's master rebase,!1693More threapool plotting tweaks,!1668before Mag.Egy in all the flavors,!1663Initial sync to work again,!1662Initial sync from previous months,!1642When searching for more particles in a ghost task we walk up the cell tree,...,!1633When searching for more particles in a ghost task we walk up the cell tree,...,!1623Hydro test fixes
...@@ -51,7 +51,7 @@ if gamma != 1.4: ...@@ -51,7 +51,7 @@ if gamma != 1.4:
"Error: SWIFT was run with the wrong adiabatic index. Should have been 1.4", "Error: SWIFT was run with the wrong adiabatic index. Should have been 1.4",
gamma, gamma,
) )
exit() exit(1)
ref = np.loadtxt("interactingBlastWaves1D_exact.txt") ref = np.loadtxt("interactingBlastWaves1D_exact.txt")
......
#!/bin/bash #!/bin/bash
# Generate the initial conditions if they are not present. # Generate the initial conditions if they are not present.
if [ ! -e glassPlane_128.hdf5 ]
then
./getGlass.sh
fi
if [ ! -e kelvinHelmholtzGrowthRate.hdf5 ] if [ ! -e kelvinHelmholtzGrowthRate.hdf5 ]
then then
echo "Generating initial conditions for the Kelvin-Helmholtz growth rate " \ echo "Generating initial conditions for the Kelvin-Helmholtz growth rate " \
......
#!/bin/bash #!/bin/bash
# Generate the initial conditions if they are not present. # Generate the initial conditions if they are not present.
if [ ! -e glassCube_64.hdf5 ]
then
./getGlass.sh
fi
if [ ! -e kelvinHelmholtzGrowthRate.hdf5 ] if [ ! -e kelvinHelmholtzGrowthRate.hdf5 ]
then then
echo "Generating initial conditions for the Kelvin-Helmholtz growth rate " \ echo "Generating initial conditions for the Kelvin-Helmholtz growth rate " \
......
...@@ -58,25 +58,25 @@ pos = sim["/PartType0/Coordinates"][:, :] ...@@ -58,25 +58,25 @@ pos = sim["/PartType0/Coordinates"][:, :]
x = pos[:, 0] - boxSize / 2 x = pos[:, 0] - boxSize / 2
y = pos[:, 1] - boxSize / 2 y = pos[:, 1] - boxSize / 2
vel = sim["/PartType0/Velocities"][:, :] vel = sim["/PartType0/Velocities"][:, :]
v_norm = sqrt(vel[:, 0] ** 2 + vel[:, 1] ** 2) v_norm = np.sqrt(vel[:, 0] ** 2 + vel[:, 1] ** 2)
rho = sim["/PartType0/Densities"][:] rho = sim["/PartType0/Densities"][:]
u = sim["/PartType0/InternalEnergies"][:] u = sim["/PartType0/InternalEnergies"][:]
S = sim["/PartType0/Entropies"][:] S = sim["/PartType0/Entropies"][:]
P = sim["/PartType0/Pressures"][:] P = sim["/PartType0/Pressures"][:]
# Plot the interesting quantities # Plot the interesting quantities
plt.figure() plt.figure(figsize=(7, 7 / 1.6))
# Azimuthal velocity profile ----------------------------- # Azimuthal velocity profile -----------------------------
plt.subplot(231) plt.subplot(231)
scatter( plt.scatter(
pos[:, 0], pos[:, 0],
pos[:, 1], pos[:, 1],
c=vel[:, 0], c=vel[:, 0],
cmap="PuBu", cmap="PuBu",
edgecolors="face", edgecolors="face",
s=4, s=0.25,
vmin=-1.0, vmin=-1.0,
vmax=1.0, vmax=1.0,
) )
...@@ -91,7 +91,14 @@ plt.ylim(0, 1) ...@@ -91,7 +91,14 @@ plt.ylim(0, 1)
# Radial density profile -------------------------------- # Radial density profile --------------------------------
plt.subplot(232) plt.subplot(232)
plt.scatter( plt.scatter(
pos[:, 0], pos[:, 1], c=rho, cmap="PuBu", edgecolors="face", s=4, vmin=0.8, vmax=2.2 pos[:, 0],
pos[:, 1],
c=rho,
cmap="PuBu",
edgecolors="face",
s=0.25,
vmin=0.8,
vmax=2.2,
) )
plt.text(0.97, 0.97, "${\\rm{Density}}$", ha="right", va="top", backgroundcolor="w") plt.text(0.97, 0.97, "${\\rm{Density}}$", ha="right", va="top", backgroundcolor="w")
plt.xlabel("${\\rm{Position}}~x$", labelpad=0) plt.xlabel("${\\rm{Position}}~x$", labelpad=0)
...@@ -102,7 +109,7 @@ plt.ylim(0, 1) ...@@ -102,7 +109,7 @@ plt.ylim(0, 1)
# Radial pressure profile -------------------------------- # Radial pressure profile --------------------------------
plt.subplot(233) plt.subplot(233)
plt.scatter( plt.scatter(
pos[:, 0], pos[:, 1], c=P, cmap="PuBu", edgecolors="face", s=4, vmin=1, vmax=4 pos[:, 0], pos[:, 1], c=P, cmap="PuBu", edgecolors="face", s=0.25, vmin=1, vmax=4
) )
plt.text(0.97, 0.97, "${\\rm{Pressure}}$", ha="right", va="top", backgroundcolor="w") plt.text(0.97, 0.97, "${\\rm{Pressure}}$", ha="right", va="top", backgroundcolor="w")
plt.xlabel("${\\rm{Position}}~x$", labelpad=0) plt.xlabel("${\\rm{Position}}~x$", labelpad=0)
...@@ -113,7 +120,14 @@ plt.ylim(0, 1) ...@@ -113,7 +120,14 @@ plt.ylim(0, 1)
# Internal energy profile -------------------------------- # Internal energy profile --------------------------------
plt.subplot(234) plt.subplot(234)
plt.scatter( plt.scatter(
pos[:, 0], pos[:, 1], c=u, cmap="PuBu", edgecolors="face", s=4, vmin=1.5, vmax=5.0 pos[:, 0],
pos[:, 1],
c=u,
cmap="PuBu",
edgecolors="face",
s=0.25,
vmin=1.5,
vmax=5.0,
) )
plt.text( plt.text(
0.97, 0.97, "${\\rm{Internal~energy}}$", ha="right", va="top", backgroundcolor="w" 0.97, 0.97, "${\\rm{Internal~energy}}$", ha="right", va="top", backgroundcolor="w"
...@@ -126,7 +140,14 @@ plt.ylim(0, 1) ...@@ -126,7 +140,14 @@ plt.ylim(0, 1)
# Radial entropy profile -------------------------------- # Radial entropy profile --------------------------------
plt.subplot(235) plt.subplot(235)
plt.scatter( plt.scatter(
pos[:, 0], pos[:, 1], c=S, cmap="PuBu", edgecolors="face", s=4, vmin=0.5, vmax=3.0 pos[:, 0],
pos[:, 1],
c=S,
cmap="PuBu",
edgecolors="face",
s=0.25,
vmin=0.5,
vmax=3.0,
) )
plt.text(0.97, 0.97, "${\\rm{Entropy}}$", ha="right", va="top", backgroundcolor="w") plt.text(0.97, 0.97, "${\\rm{Entropy}}$", ha="right", va="top", backgroundcolor="w")
plt.xlabel("${\\rm{Position}}~x$", labelpad=0) plt.xlabel("${\\rm{Position}}~x$", labelpad=0)
......
...@@ -12,4 +12,5 @@ fi ...@@ -12,4 +12,5 @@ fi
# Plot the solution # Plot the solution
python3 plotSolution.py 100
python3 makeMovieSwiftsimIO.py python3 makeMovieSwiftsimIO.py
...@@ -98,9 +98,8 @@ binned_marker_size = 4 ...@@ -98,9 +98,8 @@ binned_marker_size = 4
scatter_props = dict( scatter_props = dict(
marker=".", marker=".",
ms=1, ms=4,
markeredgecolor="none", markeredgecolor="none",
alpha=0.2,
zorder=-1, zorder=-1,
rasterized=True, rasterized=True,
linestyle="none", linestyle="none",
...@@ -110,7 +109,7 @@ errorbar_props = dict(color=binned_color, ms=binned_marker_size, fmt=".", lw=1.2 ...@@ -110,7 +109,7 @@ errorbar_props = dict(color=binned_color, ms=binned_marker_size, fmt=".", lw=1.2
# Velocity profile -------------------------------- # Velocity profile --------------------------------
plt.subplot(231) plt.subplot(231)
plt.plot(r, v, **scatter_props) plt.plot(x, v, **scatter_props)
plt.plot(x_s, v_s, "--", color=line_color, alpha=0.8, lw=1.2) plt.plot(x_s, v_s, "--", color=line_color, alpha=0.8, lw=1.2)
plt.xlabel("${\\rm{Position}}~x$", labelpad=0) plt.xlabel("${\\rm{Position}}~x$", labelpad=0)
plt.ylabel("${\\rm{Velocity}}~v_x$", labelpad=-4) plt.ylabel("${\\rm{Velocity}}~v_x$", labelpad=-4)
...@@ -119,7 +118,7 @@ plt.ylim(-1.2, 1.2) ...@@ -119,7 +118,7 @@ plt.ylim(-1.2, 1.2)
# Density profile -------------------------------- # Density profile --------------------------------
plt.subplot(232) plt.subplot(232)
plt.plot(r, rho, **scatter_props) plt.plot(x, rho, **scatter_props)
plt.plot(x_s, rho_s, "--", color=line_color, alpha=0.8, lw=1.2) plt.plot(x_s, rho_s, "--", color=line_color, alpha=0.8, lw=1.2)
plt.xlabel("${\\rm{Position}}~x$", labelpad=0) plt.xlabel("${\\rm{Position}}~x$", labelpad=0)
plt.ylabel("${\\rm{Density}}~\\rho$", labelpad=0) plt.ylabel("${\\rm{Density}}~\\rho$", labelpad=0)
...@@ -128,7 +127,7 @@ plt.ylim(0.95, 4.4) ...@@ -128,7 +127,7 @@ plt.ylim(0.95, 4.4)
# Pressure profile -------------------------------- # Pressure profile --------------------------------
plt.subplot(233) plt.subplot(233)
plt.plot(r, P, **scatter_props) plt.plot(x, P, **scatter_props)
plt.plot(x_s, P_s, "--", color=line_color, alpha=0.8, lw=1.2) plt.plot(x_s, P_s, "--", color=line_color, alpha=0.8, lw=1.2)
plt.xlabel("${\\rm{Position}}~x$", labelpad=0) plt.xlabel("${\\rm{Position}}~x$", labelpad=0)
plt.ylabel("${\\rm{Pressure}}~P$", labelpad=0) plt.ylabel("${\\rm{Pressure}}~P$", labelpad=0)
...@@ -137,7 +136,7 @@ plt.ylim(-0.05, 1.8) ...@@ -137,7 +136,7 @@ plt.ylim(-0.05, 1.8)
# Internal energy profile ------------------------- # Internal energy profile -------------------------
plt.subplot(234) plt.subplot(234)
plt.plot(r, u, **scatter_props) plt.plot(x, u, **scatter_props)
plt.plot(x_s, u_s, "--", color=line_color, alpha=0.8, lw=1.2) plt.plot(x_s, u_s, "--", color=line_color, alpha=0.8, lw=1.2)
plt.xlabel("${\\rm{Position}}~x$", labelpad=0) plt.xlabel("${\\rm{Position}}~x$", labelpad=0)
plt.ylabel("${\\rm{Internal~Energy}}~u$", labelpad=0) plt.ylabel("${\\rm{Internal~Energy}}~u$", labelpad=0)
...@@ -146,7 +145,7 @@ plt.ylim(-0.05, 0.8) ...@@ -146,7 +145,7 @@ plt.ylim(-0.05, 0.8)
# Entropy profile --------------------------------- # Entropy profile ---------------------------------
plt.subplot(235) plt.subplot(235)
plt.plot(r, S, **scatter_props) plt.plot(x, S, **scatter_props)
plt.plot(x_s, s_s, "--", color=line_color, alpha=0.8, lw=1.2) plt.plot(x_s, s_s, "--", color=line_color, alpha=0.8, lw=1.2)
plt.xlabel("${\\rm{Position}}~x$", labelpad=0) plt.xlabel("${\\rm{Position}}~x$", labelpad=0)
plt.ylabel("${\\rm{Entropy}}~S$", labelpad=-9) plt.ylabel("${\\rm{Entropy}}~S$", labelpad=-9)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment