Geostatistical models of reservoir properties are high resolution with many grid cells; it is impractical to use them directly in flow simulation because of computational costs. Upscaling techniques are applied to average small-scale permeability values to larger flow simulation blocks. In cases where unstructured grids are used or the geological features inside the gridblock are not aligned with the block geometry, symmetric or full-permeability tensors arise instead of a simple diagonal tensor. A method is presented to calculate the permeability tensor for an unstructured gridblock to account for the small-scale heterogeneity information inside the gridblock. Single-phase flow-based upscaling is performed based on random boundary conditions and the effective tensor permeability is found through an optimization technique. Full, symmetric and diagonal permeability tensors are calculated for 2D and 3D blocks and sensitivity analysis is performed.