The phonon Boltzmann transport equation with the frequency-dependent model is solved numerically to study the thermal conductivity in nanoporous thin film and nanocomposite. Local angle between heat fluxes, defined as the angle between the directions of heat flux component qx and the local heat flux q, is introduced. At a fixed porosity or interface area, the thermal conductivity, local angle distribution, and the average angle of the two-dimensional nanoporous thin films with circular, hexagonal, square, and triangular pores are reported, and the thermal conductivity decreases with the increase in the interface area or porosity. Furthermore, the relationship between the thermal conductivity and average angle is also discussed for the three-dimensional nanoporous thin films with aligned or staggered pores, and silicon-germanium embedded and compacted nanocomposites. All the results show that the nanostructured material with a larger average angle between heat fluxes has a lower thermal conductivity.