This paper presents a new version Java code for the three-dimensional simulation of Cluster–Cluster Aggregation (CCA) model to replace the previous version. Many redundant traverses of clusters-list in the program were totally avoided, so that the consumed simulation time is significantly reduced. In order to show the aggregation process in a more intuitive way, we have labeled different clusters with varied colors. Besides, a new function is added for outputting the particle’s coordinates of aggregates in file to benefit coupling our model with other models. New version program summaryProgram Title: CCA v04Program Files doi:http://dx.doi.org10.17632/zwz37tvjny.1Licensing provisions: Apache-2.0Programming language: JavaJournal reference of previous version: Computer Physics Communications 207 (2016) 547–548Does the new version supersede the previous version?: YesNature of problem: The previous program for CCA model can be optimized for yielding better operation efficiency and visualization effects. Besides, it can be extended for coupling with other models by adding some new functions.Solution method: Some redundant traverses of the clusters-list for updating an important variable were removed technically. Furthermore, displaying different clusters with distinct colors can benefit to the effectiveness of visualization. We have also introduced a new function for outputting the aggregated clusters, so that this model can be easily coupled with other models.Reasons for the new version:1. In the previous versions [1–3], the global variable of Dmax, which means the maximum diffusion coefficient of clusters, is supposed to be calculated when aggregation occurs. In fact, this variable is critical to determine whether the currently selected cluster carries out diffusion or not. In the previous version, we had to traverse the clusters-list to update Dmax, even though it may keep unchanged after a round of aggregation. But, we have explored that it is not necessary to traverse all clusters, if we compare the previous variable of Dmax with the diffusion coefficient of the new cluster, which is formed by aggregating two clusters. In the case of the new one is larger, Dmax will be updated to it; otherwise, Dmax keep unchanged. Obviously, removing redundant traverses can enhance algorithm efficiency, and the time complexity of the algorithm is closely related to the loop in it. As a result, the new version of code can greatly cut down the simulation time, in contrast to the previous codes.2. The old versions paint all particles with same color, which does not help to identify different clusters. In order to show the visualization of the 3D aggregate process in different states intuitively, we introduce labeling different clusters with different colors. Consequently, the particles belong to one cluster are painted with the same color.3. A new function is added to record intermediate or final state of clusters so that it can be used for further research when using other relevant models.Summary of revisions:1. Reduce unnecessary traverses of the clusters-list for speeding up simulation.2. Paint clusters with different colors to pursuit better visualization effects.3. Add a new function of exporting the coordinates of clusters to a text file for benefiting other models.Additional comments:To test the optimization effects offered by the new version of code, we have carried out a comparison experimentto measure the simulation time with different initial particles, by using the new and the previous version 3.0 of code. In the experiments, we set concentration C to 0.01, diffusion exponent γ to 0, sticking probability exponent σ to 1, the sticking probability P1 to 0.1, absolute temperature T to 298 K, and the side length L of cube was respectively set to 30, 40, 50, 60, 70 and 80 to yield different initial particles, as the number of particles N can be calculated by the formula N=C∗L3 [1]. To avoid the influences of hardware and software, we use Monte Carlo steps (MCS) as our simulation time [4–6]. As shown in Fig. 1, the slope coefficient caused by this new version of code is about 1.3813, it is close to line complexity, as for the previous version, it is 1.5703, larger than the new one. It is obvious the new one has a faster running speed than the previous one. More importantly, the reduction of simulation time becomes more obvious when the number of simulated particles is getting larger.The changed visualization of our program is shownin Fig. 2. We can clearly see how much clusters in simulation system, and how they distribute. And the button “save” marked red in Fig. 2 can help realize our new function by exporting the particle coordinates to a text file, which also store the related initial conditions.AcknowledgmentsThis work was partially supported by “National Natural Science Foundation of China (Nos. 41271292, 61303038)”.
Read full abstract