A series of metal-free dye-sensitized solar cells featuring a D-pi-A-pi-A configuration is devised, employing various heterocyclic derivative pi-spacers in both open and fused configurations. Employing DFT and TD-DFT methods, the optoelectronic and photovoltaic characteristics of the dye are scrutinized. To evaluate the impact of diverse heterocyclic spacers, structural parameters such as distance and dihedral angle, alongside thermodynamic metrics including electron injection efficiency (Delta Ginject), regeneration efficiency (Delta Greg), light harvesting efficiency (LHE), open-circuit photovoltage (VOC), and short-circuit current density (JSC) are assessed. Results indicate that selected dyes with open and fused configurations of heterocyclic pi-spacers such as O-CNC-2, OCNN-4, O-NNC-7, O-NNN-8, F-NNC-2, and F-NNN-1 exhibited superior electron density distribution, higher Delta Ginject, lower Delta Greg, elevated VOC, and JSC compared to their counterparts based on open configurations. These D-pi-A-pi-A dyes can emerge as promising candidates for future applications in solar cells.