The metal-halide perovskite solar cell (PSC) has risen to the forefront of photovoltaic research, and presents the potential for low-cost fabrication with high-power conversion efficiency. Better understanding of the PSC operation mechanism is necessary and required to further improve the performance of the device. Therefore, in addition to numerous experimental studies, some number of optoelectrical simulations are necessary. However, usually, simulations are either electrical or optical and more in relation to one-dimensional (1D) structures such as planar cells. In this study, an approach to optoelectrical simulation of a 3D solar cell, such as the mesoporous PSC, has been presented. First, the 3D layers, such as the mesoporous layer, are modeled to a 1D effective layer using Bergman's effective medium theory. By using the spectral density function, this effective medium theory is able to introduce the 1D equivalent of the 3D layer. Then, the optical results by transfer matrix method are transferred to the SCAPS-1D code, in order to simulate the EQE spectrum and the JV curve of solar cells. The simulation results were compared with the experimental results for two mesoporous PSC, one without a capping perovskite layer and the other with the capping layer. The results of this study showed that the proposed procedure can simulate and therefore investigate the optoelectrical properties of 3D mesoporous solar cells, which can also be extended to similar 3D structures. This 1D simulation procedure, compared to 3D simulation, has a much lower execution time offering more simplicity and no need for commercial codes or specific hardware.