A finite element heterogeneous multiscale method is proposed for solving the Stokes problem in porous media. The method is based on the coupling of an effective Darcy equation on a macroscopic mesh, with unknown permeabilities recovered from micro finite element calculations for Stokes problems on sampling domains centered at quadrature points in each macro element. The numerical method accounts for non-periodic microscopic geometry that can be obtained from a smooth deformation of a reference pore sampling domain. The computational work is nevertheless independent of the smallness of the pore structure. A priori error estimates reveal that the overall accuracy of the numerical scheme is limited by the regularity of the solutions of the Stokes micro problems. This regularity is low for a typical situation of non-convex microscopic pore geometries. We therefore propose an adaptive scheme with micro-macro mesh refinement driven by residual-based indicators that quantify both the macro and micro errors. A posteriori error analysis is derived for the new method. Two and three dimensional numerical experiments confirm the robustness and the accuracy of the adaptive method.Keywords. Stokes flow, Darcy equation, numerical homogenization, a posteriori error estimates, adaptive finite element method AMS subject classifications. 65N30, 76D07, 74Qxx, 35Q861. Introduction. Fluid flow through porous media is an important process appearing in a wide range of engineering and technical applications. It is present in the modeling of subsurface contamination and filtration, textile properties, biomedical materials, or natural reservoirs [30,50,55,56]. The length-scale of a porous structure is usually much smaller than the computational domain of interest. Standard numerical methods relying on discretization of the porous domain, such as the finite element method (FEM), need to resolve the finest scale of the geometry, which is denoted by ε in what follows. Such techniques often lead to numerical problems of prohibitive size and computational cost.In practical applications one is often interested in macroscopic quantities such as bulk properties of the fluid flow. Mathematical models describing such macroscopic quantities are based on averaging techniques such as homogenization. The derivation of effective equations of flow in porous media can be traced back to Darcy [28]. Rigorous homogenization theory of Stokes flow in periodic porous media appeared first in [44] with a proof of convergence by Tartar [47]. This proof was generalized by Allaire [10] to allow for connected solid porous structures in three dimensions. The effective pressure is given by an elliptic (Darcy) equation which contains the effective permeability tensor that depends on the pore geometry and can be computed using the so-called Stokes micro problems. The homogenization theory was further expanded by introducing correctors and ε-dependent error estimates [34] (see also [21]) and to random stochastically homogeneous media [15].Numerical multiscale algo...