In this study, an optimization of the maximum cooling of three radiant heat sources inside a closed square porous environment is performed. Three radiant-heat sources are cooled by airflow in a porous medium with an inclination angle. It is applied in the cooling of electronic equipment inside laptop computers. The cooling phenomenon is a function of five independent variables, such as the length of heat source, radiation parameter, Darcy number, the angle of inclination of a porous medium, and Rayleigh number. Differential equations are solved using the finite-difference approach. And those are solved by the Gauss-Seidel approach. Simulation is a numerical solution of the vorticity–stream equations. Coding is done in MATLAB software. And it is obtained the maximum objective function using the algorithm of particle swarm optimization. Cooling simulations are performed by drawing flow lines, constant temperature lines, dimensionless velocity component profiles, local Nusselt numbers, and mean Nusselt numbers. The main goal is to find the highest cooling rate in different amounts of five independent variables. The flow is in the laminar flow regime, and inclination angles are between 0 to 360°. The present study is the first study on the numerical solution of the cooling of three radiant-heat sources with an inclination angle by the porous media-filled square environment. And it is developed from the cooling of hot radiation walls problems in an inclined enclosure with constant temperature local radiant heat sources. This investigation showed the flow lines and their direction are influenced by the inclination angle of the porous medium strongly, and the maximum heat transfer is achieved at an angle of inclination of zero degrees. This investigation showed at the Darcy number, 0.001, and the radiation parameter, 1. The maximum and minimum Nusselt number is obtained for the inclination angle 60 and 180°, respectively.