### Updated documentation of plotting scripts

parent 938d7745
 ... ... @@ -31,8 +31,6 @@ E0= 1. # Energy of the explosion N_inject = 21 # Number of particles in which to inject energy fileName = "sedov.hdf5" #L = 101 #--------------------------------------------------- glass = h5py.File("glassPlane_128.hdf5", "r") ... ... @@ -50,10 +48,9 @@ m = zeros(numPart) u = zeros(numPart) r = zeros(numPart) for i in range(numPart): r[i] = sqrt((pos[i,0] - 0.5)**2 + (pos[i,1] - 0.5)**2) m[i] = rho0 * vol / numPart u[i] = P0 / (rho0 * (gamma - 1)) r = sqrt((pos[:,0] - 0.5)**2 + (pos[:,1] - 0.5)**2) m[:] = rho0 * vol / numPart u[:] = P0 / (rho0 * (gamma - 1)) # Make the central particle detonate index = argsort(r) ... ...
 ... ... @@ -18,7 +18,7 @@ # ############################################################################## # Computes the analytical solution of the 3D Sedov blast wave. # Computes the analytical solution of the 2D Sedov blast wave. # The script works for a given initial box and dumped energy and computes the solution at a later time t. # Parameters ... ... @@ -85,6 +85,8 @@ P = sim["/PartType0/Pressure"][:] rho = sim["/PartType0/Density"][:] # Now, work our the solution.... from scipy.special import gamma as Gamma from numpy import * ... ... @@ -190,6 +192,8 @@ def sedov(t, E0, rho0, g, n=1000, nu=3): rho *= rho0 return r, p, rho, u, r_s, p_s, rho_s, u_s, shock_speed # The main properties of the solution r_s, P_s, rho_s, v_s, r_shock, _, _, _, _ = sedov(time, E_0, rho_0, gas_gamma, 1000, 2) # Append points for after the shock ... ... @@ -202,6 +206,8 @@ v_s = np.insert(v_s, np.size(v_s), [0, 0]) u_s = P_s / (rho_s * (gas_gamma - 1.)) #internal energy s_s = P_s / rho_s**gas_gamma # entropic function # Plot the interesting quantities figure() ... ...