Bronchi, arteries and veins, tree branches and roots, all exhibit a fractal topology, i.e., networks formed by channels that successively split into smaller channels. A thorough literature review shows that self-similar topologies justify most empirical power laws encountered in nature and engineering design. Fractal models match but do not explain observations. Is the fractal topology optimal for all transport processes taking place between a porous system and a host medium? According to the constructal theory, the topology of a flow system should optimize an energy potential. The underlying assumption is that any network should have a purpose, a configuration, and constraints. The main theoretical assumptions and developments of the constructal theory are presented. The thermal efficiency of an isolated heat exchanger pile is analyzed for different topologies. Simulations show that slender network components are preferable to isotropic topologies only if the contrast between soil and pile thermal conductivities is between one and two orders of magnitude. The orientation of fragmentation of the heat exchanger should also depend on potential variations of thermal properties across soil layers. The applicability and limitations of the constructal theory to optimize injection and withdrawal processes in soils is discussed.