The evolution of pore space plays a crucial role in evaluating the physical properties of rocks, primarily influenced by processes such as sedimentation, compaction, dissolution, cementation, and other diagenetic phenomena. Current research in related field primarily relies on sample analysis and qualitative investigations, with a scarcity of predictive models to explore how sedimentary heterogeneity influences diagenesis and pore space evolution. This study introduces a numerical simulation framework that integrates the generation, deposition, compression, flow, solute transport, dissolution, and cementation of mineral grains. Specifically, the Quartet Structure Generation Set (QSGS) is employed to produce three-dimensional mineral grains, while the Discrete Element Method (DEM) simulates deposition and compaction, and the Finite Volume Method (FVM) is used for fluid flow, geochemical reactions, and the computation of rock physical properties. The capability of this framework is demonstrated through two case studies: the sedimentation and cementation of quartz, and the deposition, compaction, dissolution, and cementation of multiple minerals. The simulation results for porosity-depth trends and cementation processes closely align with established analytical models. This newly developed numerical framework demonstrates robustness and significant potential for dynamic prediction of pore-space evolution, porosity, permeability, and other rock physical properties during sedimentation, compaction, and diagenesis.