In this study, mathematical modeling of natural gas dehydration by the method of TSA with two bed was studied. Single-layer bed and two layered bed with Zeolite 3A and silica-gel adsorbents are considered as case studies. In this model, the heat and mass balance equations in the gas phase were developed using convective and diffusive terms and adsorption of all adsorbable components taken into account. In the calculation of mass transfer rate at adsorber bed, the LDF model was used. At regeneration bed, the results of diffusion model are compared with local equilibrium between gas and adsorbent and due to controlling heating rate in this bed, local equilibrium is used. For the correlating equilibrium between gas and adsorbed components, Dual Site Langmuir model is chosen. In this model, at adsorber bed, the temperature distribution isn’t considered in bed and at regeneration bed, the conservation of energy is developed for the gas phase and each particle of the adsorber is lumped of heat transfer. It is assumed that wall is adiabatic and has no heat capacity. The Ergun equation is used for calculation of pressure drop in bed. In this study, the effect of temperature and pressure variations and mass transfer on the velocity is considered. Development of conservation laws redounds to the nonlinear set of partial and algebraic equations that must be solved numerically. In this study, we use the finite volume and implicit method for discretization of unsteady partial differential equations. For the validation of simulation, the results of this model are compared with the data from articles. By use of this model’s results, breakthrough time increases with increasing of silica gel length proportion to zeolite 3A length in the bed. According to the case study, single bed breakthrough time is 430 mintutes while breakthrough time of optimal two-layered bed with 3.7 meter silica-gel length is 787. At the optimum two layered bed, the numbered of TSA’s cycle reduces in a period time and as a result, the lifetime of bed’s adsorbers increase that this factor reduces costs. Energy consumed in optimum two layered bed is less than the single-layer bed on one year and this factor reduces costs again. At two layered bed, a heat exchanger needs that it costs many while at single-layer bed doesn’t need it. Considering these three factors, the use of two-layered bed is more cost-effective than the single-layer bed. Keywords: Dehydration, Natural-gas, Mathematical modeling, Adsorption, Two-layered bed.