  We systematically employ the method of matched asymptotic expansions to model
Helmholtz resonators, with thermoviscous effects incorporated starting from
first principles and with the lumped parameters characterizing the neck and
cavity geometries precisely defined and provided explicitly for a wide range of
geometries. With an eye towards modeling acoustic metasurfaces, we consider
resonators embedded in a rigid surface, each resonator consisting of an
arbitrarily shaped cavity connected to the external half-space by a small
cylindrical neck. The bulk of the analysis is devoted to the problem where a
single resonator is subjected to a normally incident plane wave; the model is
then extended using "Foldy's method" to the case of multiple resonators
subjected to an arbitrary incident field. As an illustration, we derive
critical-coupling conditions for optimal and perfect absorption by a single
resonator and a model metasurface, respectively.
