The analysis of a flow pattern in cerebral aneurysms and the effect of strut shapes and stent porosity in 2D and 3D model are presented in this paper. The efficiency of a stent is related to several parameters, including porosity and stent strut shapes. The goal of this paper is to identify numerically how the stent strut shape and the porosity affect the hemodynamics properties of the flow inside an aneurysm. The lattice Boltzmann method (LBM) of a non-Newtonian blood fluid is used. To ease the code development, a scientific programming strategy based on object-oriented concepts is developed. An extrapolation method for wall and stent boundary conditions is used to resolve the characteristics of a highly complex flow. The reduced velocity, vorticity magnitude, and shear rate were observed when the proposed stent shapes and porosities are used. The rectangular strut shape stent is observed to be optimal and decrease the magnitude of the velocity by 89.25% in 2D model and 53.92% in 3D model in the aneurysm sac. Our results show how the porosity and stent strut shapes play a role and help us to understand the characteristics of stent strut design.