The simulation and free‐cooling economic optimization of a phase change material (PCM)‐air heat exchanger (PAHX), including containers filled with fictitious SiO2 nano‐enhanced PCM (NEPCM), are investigated. The airside, PCM side and heat balance governing equations are solved numerically by employing analytical solutions during the 3‐month summer from June 22 to September 22. Two climate zones of Tehran and Mashhad have been selected due to temperature contrast, especially at off‐peak times. Particle swarm optimization is employed to determine indoor setpoint temperatures (SPTs) and phase change temperatures (PCTs) to optimize the total cooling energy cost of a residential building. The effects of local climate, airflow rate, nanoparticle concentrations, and SPT range on optimization variables are studied. Two SPTs for day and night and two PCTs for melting and solidifying are between 22°C and 26°C. The mass percentage of nanoparticles is considered to be from 0% to 14%. Based on optimization analysis, Toff‐peak = 22°C, and Tpeak = 26°C are considered the best SPTs for both cities, for Mashhad Ts = 24.05°C, Tl = 18.97°C while for Tehran Ts = 24.83°C, Tl = 25.35°C are considered as the best PCTs. The optimum electrical cost increases significantly with increasing airflow rate and SPT range, while nanoparticle concentration has a low influence of up to about 3% for all desired days.