<jupyter_start><jupyter_text>Lab 3 -- a numerical convergence study using the Taylor-Sedov blast wave problemIn this lab, we will set up a numerical experiment matching the physics problem of the Taylor-Sedov blast wave. A large amount of thermal energy is placed at the origin of a sphere of constant density gas. It then expands into the surrounding medium, producing a shock where the physical conditions are discontinuous between the ambient medium and the region the blast wave has passed through.We will quantitatively compare numerical results from our hydrodynamics code to one theoretical prediction for shock waves. We will determine whether the errors decrease with increasing number of numerical grid zones in the way expected for our numerical algorithm. This is often called a "convergence study" in astrophysics -- seeing whether and how quickly our numerical answer approaches the correct value from theory as the number of resolution elements goes to infinity.<jupyter_code># define a dictionary of arguments that we will pass to the hydrodynamics code specifying the problem to run
args = {'nz':500,'ut0':3e5,'udens':1e-6,'utslope':0.,'pin':0,'piston_eexp':1e51,'v_piston':1e9,'piston_stop':10,'r_outer':5e13,'rmin':1e10,'t_stop':5e4,'noplot':1}

# define the variable h which is a "lagrange_hydro_1d" object (instance of a class)
h = hydro3.lagrange_hydro_1d(**args)
# variables stored within our object h are accessed by h.variable_name
h.bctype=[h.INFLOW, h.OUTFLOW]
h.itype=h.POWERLAW
h.setup_initial_conditions()
h.initialize_boundary_conditions()<jupyter_output><empty_output><jupyter_text>1. make some plots of the initial conditions we have given the code so far. --do they match those of the Sedov-Taylor blast wave problem? what part is missing?  2. modify the initial condition--distribute an initial energy $E_0 = 10^{52}$ erg uniformly over the volume contained by the first 5-10 grid zonesNOTE: the hydro code variable h.zones.e is the internal energy per unit *mass*, so that $e = u/\rho$ with $u$ the internal energy density from class and $\rho$ the mass density  now try running the code!<jupyter_code>h.run()<jupyter_output><empty_output><jupyter_text>let's figure out what happened  4. make log-linear (plt.semilogx) plots of the density, pressure, and velocity as functions of radius--what do you see in the curves? How is this different than what we started with? Describe in 1-2 sentences.  now let's run the code longer<jupyter_code>h.t_stop=h.t*2.
h.run()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.07278481012658228, 'fraction_numerical': 0.01740506329113924, 'mean_word_length': 5.518041237113402, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '623698', 'license': 'MIT', 'n_tokens_mistral': 736, 'n_tokens_neox': 693, 'n_words': 326, 'path': 'lab3/astr3400_lab3.ipynb', 'repo_name': 'jadexter/astr3400', 'size': '2528'}