The twist-bend nematic (N_{TB}) phase is a doubly degenerated heliconical structure with nanometric pitch and spontaneous bend and twist deformations. It is favored by symmetry-breaking molecular structures, such as bent dimers and bent-core molecules, and it is currently one of the burgeoning fields of liquid-crystal research. Although tremendous advances have been reported in the past five years, especially in molecular synthesis, most of its potential applications are held back by the lack of a proper and definitive elastic model to describe its behavior under various situations such as confinement and applied field. In this work we use a recently proposed stable state elastic model and the fact that the mesophase behaves as a lamellar structure to propose a mesoscopic or coarse-grained model for the N_{TB} phase. By means of standard procedures used for smectic and cholesteric liquid crystals, we arrive at a closed-form energy for the phase and apply it to a few situations of interest. The predicted compressibility for several values of the cone angle and the critical field for field-induced deformation agree well with recent experimental data.