Context : Aims : The aim of this work is to understand the richness of chemical species observed in the isolated high-mass envelope of AFGL 2591 , a prototypical object for studying massive star formation . Methods : Based on HIFI and JCMT data , the molecular abundances of species found in the protostellar envelope of AFGL 2591 were derived with a Monte Carlo radiative transfer code ( Ratran ) , assuming a mixture of constant and 1D stepwise radial profiles for abundance distributions . The reconstructed 1D abundances were compared with the results of the time-dependent gas-grain chemical modeling , using the best-fit 1D power-law density structure . The chemical simulations were performed considering ages of 1 - 5 \times 10 ^ { 4 } years , cosmic ray ionization rates of 5 - 500 \times 10 ^ { -17 } s ^ { -1 } , uniformly-sized 0.1 - 1 ~ { } \mu m dust grains , a dust/gas ratio of 1 \% , and several sets of initial molecular abundances with C/O < 1 and > 1 . The most important model parameters varied one by one in the simulations are age , cosmic ray ionization rate , external UV intensity , and grain size . Results : Constant abundance models give good fits to the data for CO , CN , CS , HCO ^ { + } , H _ { 2 } CO , N _ { 2 } H ^ { + } , CCH , NO , OCS , OH , H _ { 2 } CS , O , C , C ^ { + } , and CH . Models with an abundance jump at 100 K give good fits to the data for NH _ { 3 } , SO , SO _ { 2 } , H _ { 2 } S , H _ { 2 } O , HCl , and CH _ { 3 } OH . For HCN and HNC , the best models have an abundance jump at 230 K. The time-dependent chemical model can accurately explain abundance profiles of 15 out of these 24 species . The jump-like radial profiles for key species like HCO ^ { + } , NH _ { 3 } , and H _ { 2 } O are consistent with the outcome of the time-dependent chemical modeling . The best-fit model has a chemical age of \sim 10 - 50 kyr , a solar C/O ratio of 0.44 , and a cosmic-ray ionization rate of \sim 5 \times 10 ^ { -17 } s ^ { -1 } . The grain properties and the intensity of the external UV field do not strongly affect the chemical structure of the AFGL 2591 envelope , whereas its chemical age , the cosmic-ray ionization rate , and the initial abundances play an important role . Conclusions : We demonstrate that simple constant or jump-like abundance profiles constrained with 1D Ratran line radiative transfer simulations are in agreement with time-dependent chemical modeling for most key C- , O- , N- , and S-bearing molecules . The main exceptions are species with very few observed transitions ( C , O , C ^ { + } , and CH ) or with a poorly established chemical network ( HCl , H _ { 2 } S ) or whose chemistry is strongly affected by surface processes ( CH _ { 3 } OH ) .