pyfracval.pca_agg#
Implements Particle-Cluster Aggregation (PCA) for initial subclusters.
Module Contents#
- class pyfracval.pca_agg.PCAggregator(initial_radii, df, kf, tol_ov)[source]#
Performs Particle-Cluster Aggregation (PCA).
Builds a single cluster by sequentially adding individual primary particles (monomers) to a growing aggregate, attempting to match the target Df and kf via the Gamma_pc calculation at each step. Includes overlap checking and rotation to find valid placements.
- Parameters:
- run()[source]#
Run the complete PCA process for all N particles.
Sequentially adds particles from index 2 to N-1. For each particle k, it calculates Gamma_pc, finds potential sticking partners (candidates) in the existing aggregate (0..k-1), potentially swaps particle k with an unused one if no candidates are found initially.
It then attempts to stick particle k to each candidate partner, calculating an initial position based on sphere intersections defined by Gamma_pc. If overlap occurs, it rotates particle k around the intersection circle (_reintento) up to max_rotations times.
If a non-overlapping position is found for any candidate, the particle is successfully added, and aggregate properties are updated. If all candidates and all rotations fail for a particle k, or if the initial search/swap fails, the aggregation stops, not_able_pca is set True, and None is returned.
- Returns:
An Nx4 NumPy array [X, Y, Z, R] of the final aggregate if successful, otherwise None.
- Return type:
np.ndarray | None