Carbon deposition has a serious effect on the failure mechanism of solid oxide fuel cells. A comprehensive investigation based on a two-dimensional model of a solid oxide fuel cell with the detailed electrochemical model is presented to study the mechanism and effects of carbon deposition and unsteady state porosity variation. Studies of this kind can be an aid to identify the SOFC optimal working conditions and provide an approximate fuel cell lifetime. It has been revealed that, due to carbon deposition, the porosity coefficient of the fuel cell decreases. Consequently, a reduction in the amount of fuel consumption along the fuel cell and the chemical and electrochemical reaction rates are resulted which can be clearly seen in the off-gases molar ratio. The percentage of output fuel changes in the timeframe is useful information for optimizing CHP systems including fuel cells. The percentage of the output water vapor, which usually increases compared to the input, decreases by 17% at the end of the working period. Also, unreacted methane in the output of the fuel cell increased by 12%; in other words, it is wasted. The other consequence of carbon deposition reduced electrochemical and chemical reaction rates and the reduction of temperature difference along the cell. The study shows that after 145 working days, the temperature difference along the cell varies from 117 °C for the starting time to 7 °C. Also, by reducing the current density, the cell output power density decreases by 72% after 145 working days.