Today, the increasing consumption of fossil fuels and their harmful effects on the environment, as well as increasing energy consumption in heating and cooling of the buildings, has led to the use of energy storage systems with phase change materials. In the present study, the amount of thermal energy storage in the building wall has been investigated by using the addition of two types of copper (Cu) and aluminum oxide (Al2O3) nanoparticles in octadecane phase change material. To optimizing the thermal energy storage by phase change material, the parameters such as nanoparticle type, nanoparticle concentration, displacement of the position of the octadecane layer, and also the optimal thickness of the phasechange material layer are investigated. Addition of Cu nanoparticles in all volumetric percentages (0.5%, 1%, 3%, 5%) compared to Al2O3 with the same volumetric percentages (1% and 3%), and the pure octadecane, shows a higher increase in thermal energy storage. In the presence of Cu nanoparticles, the greatest increase in thermal energy storage is observed in 1% vol. The optimum thickness is 1.2 centimeters in the case where the phase change material is located behind the inner wall layer, which is 1.5 centimeters when the phasechange material is between the brick and the gypsum and soil layer (near layer to the external wall) which reduces the weight of the octadecane by 30%.