diff --git a/doc/source/examples/dem/plate-discharge/plate-discharge.rst b/doc/source/examples/dem/plate-discharge/plate-discharge.rst index fb2c7bf858..9611723a9b 100644 --- a/doc/source/examples/dem/plate-discharge/plate-discharge.rst +++ b/doc/source/examples/dem/plate-discharge/plate-discharge.rst @@ -449,7 +449,7 @@ Angle of Repose The angles of repose are calculated from the data extracted from the VTU output files. The 2 angles of repose are calculated from the pile of particles on the plate for comparison with the literature, and from the piles formed by the discharge for curiosity. -The configuration of the case gives a symmetrical formation of the piles, meaning that there are 2 angles of repose to calculate for the pile at the top of the plate and for the 2 piles at the bottom. The angles of repose are calculated by linear regressions from the highest particle positions in y-axis from :math:`-0.35 \ \text{m}` to :math:`-0.15 \ \text{m}` for the left angles and from :math:`0.15 \ \text{m}` to :math`0.35 \ \text{m}` for the right angles along the x-axis. The following figure shows the areas where the angles are calculated. The areas where the angle of repose is calculated for the left (blue) and right (red) sides of the piles. +The configuration of the case gives a symmetrical formation of the piles, meaning that there are 2 angles of repose to calculate for the pile at the top of the plate and for the 2 piles at the bottom. The angles of repose are calculated by linear regressions from the highest particle positions in y-axis from :math:`-0.35 \ \text{m}` to :math:`-0.15 \ \text{m}` for the left angles and from :math:`0.15 \ \text{m}` to :math:`0.35 \ \text{m}` for the right angles along the x-axis. The following figure shows the areas where the angles are calculated. The areas where the angle of repose is calculated for the left (blue) and right (red) sides of the piles. .. figure:: images/angle-areas.png @@ -468,7 +468,7 @@ The given angles of repose are the linear regressions from the positions with ab The angles of repose calculated from the simulation data. The solid lines are the angles computed from the highest particles on both side, while the shaded areas represent the angles for the left and the right. -According to Zhou *et al.* [#zhou2002]_, the angle of repose for this type of configuration is calculated with the following theoretical formula: +According to Zhou *et al.* [#zhou2002]_, the angle of repose for this type of configuration is calculated with the following empirical formula: .. math:: \phi = 68.61 \mu_{\text{f,pp}}^{0.27} \mu_{\text{f,pw}}^{0.22} \mu_{\text{r,pp}}^{0.06} \mu_{\text{r,pw}}^{0.12} d_p^{-0.2} diff --git a/examples/dem/3d-plate-discharge/plate-discharge_post-processing.py b/examples/dem/3d-plate-discharge/plate-discharge_post-processing.py index fe1738e8b0..321b40c912 100644 --- a/examples/dem/3d-plate-discharge/plate-discharge_post-processing.py +++ b/examples/dem/3d-plate-discharge/plate-discharge_post-processing.py @@ -103,21 +103,21 @@ angle_top_plot.plot(time, postprocessing.theoritical_angle * np.ones(len(time)), '--', color='k', label='Theoretical angle', linewidth=1.00) for k in range(0, len(names)): - time = data_list[k]['time'].values - mass_plot.plot(time, data_list[k]['mass'], '--', color='C' + str(k), + time = data_list[k]['time'].to_numpy() #values + mass_plot.plot(time, data_list[k]['mass'].to_numpy(), '--', color='C' + str(k), label=f'{dict_names[names[k]]}', linewidth=1.00) - angle_top_plot.plot(time, abs(data_list[k]['angle_top']), color='C' + str(k), label=f'{dict_names[names[k]]}', linewidth=1.00) + angle_top_plot.plot(time, abs(data_list[k]['angle_top'].to_numpy()), color='C' + str(k), label=f'{dict_names[names[k]]}', linewidth=1.00) angle_top_plot.fill_between(time, - abs(data_list[k]['left_angle_top'].values).astype(float), - abs(data_list[k]['right_angle_top'].values).astype(float), color='C' + str(k), alpha=0.5) + abs(data_list[k]['left_angle_top'].to_numpy()).astype(float), + abs(data_list[k]['right_angle_top'].to_numpy()).astype(float), color='C' + str(k), alpha=0.5) - angle_bottom_plot.plot(time, abs(data_list[k]['angle_bottom']), + angle_bottom_plot.plot(time, abs(data_list[k]['angle_bottom'].to_numpy()), color='C' + str(k), label=f'{dict_names[names[k]]}', linewidth=1.00) angle_bottom_plot.fill_between(time, - abs(pd.to_numeric(data_list[k]['left_angle_bottom'].values, + abs(pd.to_numeric(data_list[k]['left_angle_bottom'].to_numpy(), errors='coerce')), - abs(pd.to_numeric(data_list[k]['right_angle_bottom'].values, + abs(pd.to_numeric(data_list[k]['right_angle_bottom'].to_numpy(), errors='coerce')), color='C' + str(k), alpha=0.5) start = 10 @@ -152,15 +152,16 @@ fig_angle.savefig(f'./plate-discharge-angle-data.png', bbox_inches='tight', dpi=300) if process_log: - time = log_list[0]['time'].values + time = log_list[0]['time'].to_numpy() + #print(time) for k in range(0, len(names)): - performance_plot.plot(time, log_list[k]['dem_walltime'].rolling(3).mean(), + performance_plot.plot(time, log_list[k]['dem_walltime'].rolling(3).mean().to_numpy(), color='C' + str(k), label=f'{dict_names[names[k]]}', linewidth=1.00) if k != 0: speedup = log_list[0]['dem_walltime']/log_list[k]['dem_walltime'] speedup[0] = 0.0 - speedup_plot.plot(time, speedup.rolling(5).mean(), '--', color='C' + str(k), label=f'{dict_names[names[k]]}', linewidth=1.00) + speedup_plot.plot(time, speedup.rolling(5).mean().to_numpy(), '--', color='C' + str(k), label=f'{dict_names[names[k]]}', linewidth=1.00) speedup_plot.plot(time[-1], speedup.iat[-1], 'o', color='C' + str(k), markersize=5) speedup_plot.annotate(f'{speedup.iat[-1]:.2f}x', (time[-1], speedup.iat[-1]), textcoords="offset points", xytext=(-31, 1.75), color='C' + str(k))