eos_pars = {'.*': {'linear': True}} matid = 83719 matf = eos.EosMaterial(matid, tables=['Piz_DT', 'Uiz_DT', 'Pe_DT', 'Ue_DT', 'Zfc_DT'], options=eos_pars, units='eospac', backend='eospac') state0 = {"temp": 298, "rho": 2.7} state1 = {"pres": np.logspace(-0.2, 2.2, 100)*100} # GPa rh = RankineHugoniot.solve(state0, state1, backend='eospac', eos_pars=eos_pars, material=matid, root_opts={'method': 'lm'}) fig = plt.figure(figsize=get_figsize(wf=1.1, hf=0.6)) plt.subplots_adjust(wspace=0.3, hspace=0.3) ax = [plt.subplot(221), plt.subplot(222), plt.subplot(223), plt.subplot(224)] axins2 = inset_axes(ax[2], width="15%", height='12%', loc=4, bbox_to_anchor=(-0.553, 0.13, 1, 1), bbox_transform=ax[2].figure.transFigure) # no zoom axins1 = inset_axes(ax[1], width="15%", height='12%', loc=2, bbox_to_anchor=(0.623, -0.12, 1, 1), bbox_transform=ax[1].figure.transFigure) # no zoom for key, idf in df.iteritems(): ax[0].plot(idf.temp_source, idf.pres_0/100,'--', **plot_pars[key]) ax[1].plot(idf.pres_0/100, idf.u_s, '--', **plot_pars[key]) axins1.plot(idf.pres_0/100, idf.u_s, '--', **plot_pars[key]) ax[2].plot(idf.pres_0/100, idf.tion_0, '--', **plot_pars[key]) axins2.plot(idf.pres_0/100, idf.tion_0, '--', **plot_pars[key]) ax[3].plot(idf.velx_0, idf.u_s, '--', label='{0}'.format(key), **plot_pars[key]) ax[1].plot(rh.pres1/100, rh.u_s, **plot_pars['ref'])
state1['t'] = t state0['x'] = x_s state1['x'] = x_s sto.result = (state0, state1)#t, get_shock_position(sl), get_state(r0, 10e-4)) #t,x = np.array(storage.values()).T state0 = [] state1 = [] for val0, val1 in storage.values(): state0.append(val0) state1.append(val1) df0 = pd.DataFrame(state0) df1 = pd.DataFrame(state1) fig = plt.figure(figsize=get_figsize(wf=0.5, hf=0.5)) ax = [plt.subplot(111)] for dfi in [df0,df1]: dfi['u_s'] = savgol(np.array(dfi['t']), np.array(dfi['x']), window_size=5, order=2, deriv=1)*1e4 ax[0].plot(df0['t'],df0['x']*1e4, 'k') ax[0].set_xlabel('Time (t) [ns]') ax[0].set_ylabel('Shock position (x) [$\mathrm{\mu m}$]') ax[0].xaxis.set_ticks([0, 1, 2, 3]) ax[0].yaxis.set_ticks([0, 30, 60, 90]) ax[0].set_xlim(0, 3) ax[0].set_ylim(0, 90) ax[0].grid(which='both') fig.savefig('hugoniot_{0}_{1}.pdf'.format(EOS_TABLE, RUN_NAME), bbox_inches='tight')
tables=['Piz_DT', 'Uiz_DT', 'Pe_DT', 'Ue_DT', 'Zfc_DT'], options=eos_pars, units='eospac', backend='eospac') state0 = {"temp": 298, "rho": 2.7} state1 = {"pres": np.logspace(-0.2, 2.2, 100) * 100} # GPa rh = RankineHugoniot.solve(state0, state1, backend='eospac', eos_pars=eos_pars, material=matid, root_opts={'method': 'lm'}) fig = plt.figure(figsize=get_figsize(wf=1.1, hf=0.6)) plt.subplots_adjust(wspace=0.3, hspace=0.3) ax = [plt.subplot(221), plt.subplot(222), plt.subplot(223), plt.subplot(224)] axins2 = inset_axes(ax[2], width="15%", height='12%', loc=4, bbox_to_anchor=(-0.553, 0.13, 1, 1), bbox_transform=ax[2].figure.transFigure) # no zoom axins1 = inset_axes(ax[1], width="15%", height='12%', loc=2, bbox_to_anchor=(0.623, -0.12, 1, 1), bbox_transform=ax[1].figure.transFigure) # no zoom
state1['t'] = t state0['x'] = x_s state1['x'] = x_s sto.result = (state0, state1 ) #t, get_shock_position(sl), get_state(r0, 10e-4)) #t,x = np.array(storage.values()).T state0 = [] state1 = [] for val0, val1 in storage.values(): state0.append(val0) state1.append(val1) df0 = pd.DataFrame(state0) df1 = pd.DataFrame(state1) fig = plt.figure(figsize=get_figsize(wf=0.5, hf=0.5)) ax = [plt.subplot(111)] for dfi in [df0, df1]: dfi['u_s'] = savgol(np.array(dfi['t']), np.array(dfi['x']), window_size=5, order=2, deriv=1) * 1e4 ax[0].plot(df0['t'], df0['x'] * 1e4, 'k') ax[0].set_xlabel('Time (t) [ns]') ax[0].set_ylabel('Shock position (x) [$\mathrm{\mu m}$]') ax[0].xaxis.set_ticks([0, 1, 2, 3]) ax[0].yaxis.set_ticks([0, 30, 60, 90]) ax[0].set_xlim(0, 3)