fc["H3plus_density"][:] = tiny_number * fc["density"] fc["HCOplus_density"][:] = tiny_number * fc["density"] fc["HeHplus_density"][:] = tiny_number * fc["density"] fc["CH3plus_density"][:] = tiny_number * fc["density"] fc["CH4plus_density"][:] = tiny_number * fc["density"] fc["CH5plus_density"][:] = tiny_number * fc["density"] fc["O2Hplus_density"][:] = tiny_number * fc["density"] fc["energy"][:] = initial_temperature / \ fc.chemistry_data.temperature_units fc["x-velocity"][:] = 0.0 fc["y-velocity"][:] = 0.0 fc["z-velocity"][:] = 0.0 fc.calculate_hydrogen_number_density() # then begin collapse # evolve density and temperature according to free-fall collapse data = evolve_freefall_metal(fc, final_metallicity, final_time, dtmax=dtmax) ######### METALLICITY CONVERGENCE PLOTS ################### pyplot.loglog(data["time"], (np.divide(data["O_density"], (data["O_density"] + data["Water_density"] + data["OH_density"] + data["O2_density"]))), label='O', color='maroon',
#fc["de"][:] = (fc["HII"][:] + fc["Cplus_density"][:] + fc["OHplus_density"][:] + fc["Oplus_density"][:] + fc["O2plus_density"][:] + fc["COplus_density"][:]) * fc["density"] fc["de"][:] = 1.e-4 * fc["density"] fc["HeI"][:] = 8.333e-2 * fc["density"] fc["HeII"][:] = tiny_number * fc["density"] fc["HeIII"][:] = tiny_number * fc["density"] fc["energy"][:] = initial_temperature / \ fc.chemistry_data.temperature_units / \ fc.calculate_mean_molecular_weight() / \ (my_chemistry.Gamma - 1.0) fc["x-velocity"][:] = 0.0 fc["y-velocity"][:] = 0.0 fc["z-velocity"][:] = 0.0 fc["n_H"][:] = fc.calculate_hydrogen_number_density() # timestepping safety factor safety_factor = 0.1 # evolve density and temperature according to free-fall collapse data = evolve_freefall(fc, final_density, safety_factor=safety_factor) #fH2 data! logfH2_df = pd.DataFrame({ "log(n_H)": np.log10(data["n_H"]), "log(fH2)": np.log10(data["H2I"] / (data["HDI"] + data["HM"] + data["HI"] + data["HII"] + data["H2I"] + data["H2II"])) })